CODING CHALLENGE #1

STOS programming section.
Post Reply
User avatar
exxos
Site Admin
Site Admin
Posts: 4542
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

CODING CHALLENGE #1

Post by exxos » Sat Aug 18, 2018 7:46 pm

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.
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

User avatar
exxos
Site Admin
Site Admin
Posts: 4542
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: CODING CHALLENGE #1

Post by exxos » Sun Aug 19, 2018 12:29 am

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
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

Post Reply