[REBOL] Re: Can someone remember this small TANK GAME tutorial based on DRAW
From: antonr::lexicon::net at: 30-Aug-2005 15:07
Hi Gerard,
It needs two fixes to work on View 1.3.1:
Notes: {
Original: http://www.rebol.cz/~cyphre/draw-tutor-2.r
Working properly on View 1.2.1
CPU tanks disappear at 1.2.8
<- various clipping and pen color bugs can be seen in these intermediate
versions
View 1.2.57: Getting continuous stream of
** Script Error: Invalid argument: -
** Where: wake-event
** Near: show f
View 1.2.100 is same as 1.2.48
View 1.2.104 gets the Invalid argument again, which seems to be forever
after
Fixed by Anton to work with View 1.3:
- BOOGIE-CAR and TOWER both use rebol addition and subtraction to
calculate colours directly in the
DRAW block. That is no longer allowed, so now using COMPOSE to evaluate
the final colours once at
the beginning.
- ARRAY/INITIAL changed its functionality so that block values are
inserted as blocks (like INSERT/ONLY).
See http://www.rebol.com/docs/changes.html#section-3.5
The difference is reflected between View beta versions 1.2.5 and 1.2.8
This caused the cpu tanks to disappear.
Fixed by using LOOP to replace ARRAY.
}
boogie-car: compose [
fill-pen brown
polygon 150x50 150x150 130x150 130x50
polygon 70x50 70x150 50x150 50x50
fill-pen (leaf - 40)
polygon 132x60 132x140 68x140 68x60
]
tower: compose [
fill-pen (leaf + 30)
polygon 75x150 75x100 85x70 115x70 125x100 125x150
fill-pen (leaf + 50)
pen (leaf - 80)
circle 95x125 10
fill-pen (leaf + 70)
polygon 105x72 95x72 95x10 105x10
fill-pen leaf
polygon 108x18 92x18 92x0 108x0
]
;pane: reduce join [game/my-tank ] array/initial 5 [game/cpu-tank]
pane: reduce [game/my-tank]
loop 5 [append pane game/cpu-tank]
Regards,
Anton.