this game uses two robots. Both are controlled by users.
Each user is planting seeds which grow into Mashrooms. User A
grows
mashrooms MA and user B grows MB. If user A runs into mashroom
MB he
loses a point and vice versa. If a user loses three points the
game is over.
User A uses the standard arrows key to control speed and direction and
the "1" keypad key to grow mashrooms
User B uses the keys z w a s to control speed and direction and the
"x" key to grow mashrooms.
The code of the program:
Local Score1 Score2
arrows 2 15
//
score1=3 score2=3
robot 1 [on shape [size 0.3 [star 5]] speed = 20 RGT -100 0 ]
robot 2 [on shape [size 0.3 [star 6]] speed = 19 RGT 100 0
]
key "z" [robot 2 [speed=speed - 2]]
key "w" [robot 2 [speed=speed + 2]]
key "a" [robot 2 [dir=dir + 15]]
key "s" [robot 2 [dir=dir - 15]]
key "NumPad1" [robot 1 [solid red [box 10 10]] ]
key "End" [robot 1 [solid red [box 10 10]] ]
key "x" [robot 2 [solid green [circle 10]]]
robot 1 [crash green[ score1 = score1 - 1 circle 30]]
robot 2 [crash red[ score2 = score2 - 1 box 30 30]]
every 1 [if score1 <= 0 [bg yellow bg white jt 0 0
wr "B Won" after 3 [ stop]]
if score2 <=0 [bg yellow bg white jt 0 0 wr "A Won"
after 3 [ stop]]]