CODING CHALLENGE #1

STOS programming section.

Moderator: troed

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

CODING CHALLENGE #1

Post 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.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23497
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: CODING CHALLENGE #1

Post 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
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
Post Reply

Return to “STOS”