Game Development Reference
In-Depth Information
5. Drag out a
if () else ()
block.
6. Update it to be a
if (my_grid_idx < bad_food_start_grid_idx)
block. If this true,
then add the
then
and
switch costume to (pick random good_food_start_cos_idx
to ())
blocks; enter
8
. The costumes with index ranging from
good_food_start_
cos_idx
to
num_costumes
are good. The variable
bad_food_start_grid_idx
controls whether bad food should show in this grid. For example, if the value of
bad_food_start_grid_idx
is 2, then bad food will show from grid 2 and up.
This is to tweak the Hunger Run difficulty level. If
bad_food_start_grid_idx
is
low, bad food would show sooner, thus the game, harder.
7. If the condiion in the
if (my_grid_idx <bad_food_start_grid_idx)
block is false,
then add the
else
and
switch costume to pick random () to ()
blocks; enter
1
and
8
respecively. The costume selecion set includes bad food.
8. Finally, go to the staring locaion in the grids. Enter
-120
in the
go to x: my_start_
loc_in_grids y: ()
block.
Perform the following steps to scroll with the plaforms:
1.
Start with a
when I start as a clone
block.
2.
Add a
forever
block.
3.
In the
forever
block, add the
set x to curr_scroll_amount + my_start_loc_in_grids
block.
4.
To check when this clone has gone out of the viewable area, add an
if () then ()
block. Then, update it to be a
if <abs> of x posiion > ()
block; enter
230
. Then,
add the
hide
,
else
, and
show
blocks accordingly. Instead of
240
, we use
230
to
avoid clones geing stuck at the edge because their posiion never gets larger than
240
or smaller than
-240
. You can test it out on your own by changing the value to
240
to see the undesirable "sicking" efect.