CONTROLS Movement - Arrow Keys EXPLANATION This project demonstrates how lists can be used to "transfer" data from one clone to another using lists. You might be familiar with using variables to do this, but if two or more clones attempt to write to the variable at the same time, then the last one will overwrite the other clones. To overcome this issue, we use lists instead as they can store multiple values.
Usually, if you want a sprite to shoot bullets, you'd make the bullet clone go to the sprite's position and face the direction that sprite is facing. But what if sprite is a clone? You can't use the [go to sprite] block since it refers to the original sprite, not clones. To work around this, the clone can use variables for all sprites to tell the bullet clone where to go. But what if multiple bullets are created at the same frame? Variables can't hold multiple values and the last value will override earlier ones, causing all bullets to go to the same position. Lists are the answer to this. Each enemy clone will put their position and direction to a list. The bullet sprite will then loop through this list and create a bullet clone for every item in it. This happens in the constructor() custom block in Bullet sprite.