n = 1
test1(n).x = 50
test1(n).y = 100
test1(n).xdest = 1
test1(n).ydest = 0
'add fire
n = n + 1
test1(n).xdest = 1
test1(n).ydest = 1
bounce
border
check
CIRCLE (spider.x
, spider.y
), 5, _RGB(177, 83, 127)
_PUTIMAGE (test1
(i
).x
, test1
(i
).y
), test1
(i
).fire
IF test1
(i
).xdest
= 1 THEN test1
(i
).x
= test1
(i
).x
+ 5 IF test1
(i
).xdest
= 0 THEN test1
(i
).x
= test1
(i
).x
- 5
IF test1
(i
).ydest
= 1 THEN test1
(i
).y
= test1
(i
).y
- 5 IF test1
(i
).ydest
= 0 THEN test1
(i
).y
= test1
(i
).y
+ 5
'lazy teacher!
'these fill in the code templates are not teaching
'make us write our own code!
_PUTIMAGE (test1
(i
).x
, test1
(i
).y
), test1
(i
).fire
SUB bounce
'makes the fire bounce test1(i).xdest = 0
test1(i).xdest = 1
test1(i).ydest = 1
test1(i).ydest = 0
SUB border
'prevents palyer from going OOB IF spider.x
> 630 THEN spider.x
= spider.x
- 5 IF spider.x
< 0 THEN spider.x
= spider.x
+ 5 IF spider.y
> 470 THEN spider.y
= spider.y
- 5 IF spider.y
< 0 THEN spider.y
= spider.y
+ 5 IF (spider.x
- test1
(i
).x
) ^ 2 + (spider.y
- test1
(i
).y
) ^ 2 <= 2 ^ 3 THEN END _PRINTSTRING (300, 240), "GAME OVER: PRESS ENTER TO RESTART" fired