![]() Write code so that, when a turtle is hit by a paintball, the paintball disappears and the turtle gets 'painted all over'. Part 6: Program the Collision between Paintball and Turtle If this does not work correctly in SLN, check your code in the "paintball" tab - especially all the "if." blocks and the "= 15.Paintballs should disappear when they reach the edge of spaceland.Note that you may need to slow the simulation down to catch the paintball moving. If this does not work correctly in NetLogo, check the button settings and the "toShoot" code.If this does not work correctly in SLN, check your code in the "paintball" tab.Pressing the "S" key should shoot a single paintball in the direction you're facing.If this does not work correctly in NetLogo, check the button settings and the "toForward" etc code.If this does not work correctly in SLN, check your code in the "player" tab.You should be able to move the player around spaceland with the A, D, W and X keys.Note that, in NetLogo, you write code for specific agents by putting it inside an "ask." block rather than in the agent's tab as you do in SLN.īe sure that your code can do all of these things (you should learn to push it hard and try to "break" it. You can change this by clicking the "settings" button at the upper right of the controls in NetLogo. Spaceland in NetLogo extends from -16 to 16 in the x direction and -16 to 16 in the y direction with 0,0 in the center. comparison blocks (>, 48 or x > 49 instead of x = 50. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |