Agents+with+Collisions

==In Starlogo, collisions are where agents collide or run into each other. Upon these "collisions" various actions take place ranging from agents "dying", score increases, and other changes to the program's behavior.==

==In this activity, the students will create a game where they control a "Hero" to collect "Treasure rings" while avoiding moving "Bad Guys". The students have the option to name the agents as they deem appropriate. The "Bad Guys" are not a group of different agents but the same agent being used multiple times.==

[[file:Multiple Agents with Collisions.sltng]]
Multi Agents (Hero, Bad Guys, and Treasure Rings) with Collisions.

We will produce a game where you control an agent (Hero) to evade Bad Guys and gather Treasure. If you run into a Bad Guy (Collision), you will die. If you run into a Treasure Ring (Collision), you will gain points. The game runs for a set time limit.

1) Create your Hero, Bad Guy, and Treasure.

2) You will be creating a normal Setup but using blocks for your agents. Besides providing number of agents, you will be able to, , 3) The block will allow the program to run for a specific amount of time. The block starts with a section for seconds. There are sections for each agent underneath. The blocks found in [Orange Logic Drawer]. The Movement blocks are found in the [Red Movement Drawer]. Keyboard Controls are found in [Yellow Controls Drawer]. The block is found in [Orange Logic Drawer] to provide a pause in movements.

The Hero moves as you want. The Bad Guys move forward and bounce off walls. The Treasure Rings spin in place.

4) Collisions blocks are found in My Blocks (to the left of Factory Blocks).

In it, you describe the actions of agents bumping into (colliding) with each other. Grab two collision blocks for Bad Guys-Hero and Hero-Treasure Rings.

When the Bad Guys collide with the Hero, the Hero dies with the sound of breaking glass and the Bad Guys saying something.

When the Hero collides with a Treasure Ring, the Treasure Ring disappears with a laugh sound and the Hero’s score increases by 1.

The blocks are found in [Orange Logic Drawer] to kill agents. The and blocks are found in the [Green Sound Drawer]. The and blocks are found in the {Light Blue Text Drawer] The block is found in the [Dark Red Setup Drawer].