Page 1 of 1
CODING CHALLENGE #1
Posted: 18 Aug 2018 19:46
by exxos
A simple routine to get things moving.
Write a simple routine which will move either a sprite, bob, joey etc, in a square in low resolution with a 100pixel movement in each direction.
Re: CODING CHALLENGE #1
Posted: 19 Aug 2018 00:29
by exxos
Jon S. Stock
Here's my attempt. It uses the "animals1.mbk" stock assets from the STOS disk.
10 mode 0 : flash off
20 load "a:\animals1.mbk",1
30 cls
40 sprite 1,50,50,11
50 rem Start of loop
60 move on
70 repeat : K$=upper$(inkey$) : MX=x sprite(1) : MY=y sprite(1)
80 if MX=50 and MY=50 then gosub 140
90 if MX=150 and MY=50 then gosub 150
100 if MX=150 and MY=150 then gosub 160
110 if MY=150 and MX=50 then gosub 170
120 until K$="Q"
130 end
140 move x 1,"(1,1,0)E150" : move on : return
150 move y 1,"(1,1,0)e150" : move on : return
160 move x 1,"(1,-1,0)e50" : move on : return
170 move y 1,"(1,-1,0)e50" : move on : return