Game Development Reference
In-Depth Information
6.
Enter
8
in the
set <num_costumes> to ()
block.
7.
Then, enable
hide
because we only want the clones on stage, not the main sprite.
Perform the following steps to handle the
level_start
message:
1.
Start with a
when I receive <level_start>
block.
2.
Add a
repeat unil ( new_grid_idx > grid_count)
block.
3.
Inside the
repeat unil ( new_grid_idx > grid_count)
block, add a
repeat num_food_
per_grid
block.
4.
Inside the
repeat num_food_per_grid
block, add a
create clone of <myself
> block.
5.
Place a
change <new_grid_idx> by ()
block following the
repeat num_food_per_
grid
block; enter
1
.
Perform the following steps to iniialize a clone's look and locaion when it starts:
1. Start with a
when I start as a clone
block.
2. Set my grid index to the new grid index using the
set <my_grid_idx> to new_grid_
idx
block.
3. Add a set
<my_loc_in_grid> to pick random () to ()
block; enter
-240
and
240
respecively.
4. Set the startup locaion in the grids for this clone using the
set <my_start_loc_in_
grids> to ((my_grid_idx * grid_length) + (my_loc_in_grid))
block.