Jump to content
IGNORED

Having written the HAL/API this seemed the logical step....


CyranoJ

Recommended Posts

OK....

 

48 hours....

 

post-11520-0-47347100-1417768522_thumb.png

 

100 REM SPRITE TEST

110 REM
120 SPRX=8: SPRY=12
130 OFFD=PI*2/3
140 FOR POS=0 TO (PI*2) STEP (PI*2) / 200
150 FOR OBJ=1 TO 3
160 RSETOBJ OBJ,SPRX,(160+(SIN(POS+OFFS)*120))<<16
170 RSETOBJ OBJ,SPRY,(120+(COS(POS+OFFS)*90))<<16
180 OFFS=OFFS+OFFD
190 NEXT OBJ
200 RUPDALL
210 NEXT POS
220 GOTO 130
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRaptor!
  • Like 3
Link to comment
Share on other sites

Whats next a compiler or will you embed the basic code in the maincode to have a final .o code ?

 

Dunno, thought I'd talk about it for a year or so first... maybe start a Hero port, or a Klax port, or dream of joypad input .. oh wait, it's already got that. Maybe I could talk about magnitudes of somethings more or less than something else unrelated.

 

Or maybe, just maybe, I'll finish this and release it for everyone to play with ;)

 

Because, you know... all mouth and no trousers isn't much fun.

Edited by CyranoJ
  • Like 3
Link to comment
Share on other sites

I've cleaned up the syntax - all parameters are now passed in parenthesis* (much nicer to read) - I also changed U235PAD1 to U235PAD(x) so both pads can be read.

 

*added advantage, RPRINT can now take a string variable value instead of a direct string in "" ;)

 

New commands added are U235MOD(x) and U235SND(x,y) to play a module, or a sound effect on a channel.

 

So, with that we now have code that looks like:

 

100 REM SPRITE TEST
101 REM
110 U235MOD(0)
120 RSETLIST(1): RUPDALL
130 IF U235PAD(1)=0 GOTO 130
140 RSETLIST(0): RUPDALL
150 PX=100
160 PY=100
170 SPRX=8: SPRY=12
180 OFFD=PI*2/3
190 FOR POS=0 TO (PI*2) STEP (PI*2) / 200
200 FOR OBJ=1 TO 3
210 RSETOBJ(OBJ,SPRX,(160+(SIN(POS+OFFS)*120))<<16)
220 RSETOBJ(OBJ,SPRY,(120+(COS(POS+OFFS)*90))<<16)
230 OFFS=OFFS+OFFD
240 NEXT OBJ
250 HIT=RHIT(1,3,4,4)
260 IF HIT<>-1 THEN RPRINT("COLLISION!",0,0,2,1): U235SND(0,4)
270 IF HIT=-1 THEN RPRINT(" ",0,0,2,1)
280 PAD=U235PAD(1)
290 IF PAD=1 THEN PY=PY-1
300 IF PAD=2 THEN PY=PY+1
310 IF PAD=4 THEN PX=PX-1
320 IF PAD=8 THEN PX=PX+1
330 RSETOBJ(4,SPRX,PX<<16): RSETOBJ(4,SPRY,PY<<16)
340 RUPDALL
350 NEXT POS
360 GOTO 190

and here is the sample binary.....

 

rbasic-example2.zip

 

If all goes well, we'll open this to the public sometime this weekend.

  • Like 4
Link to comment
Share on other sites

Here's a small sample game that I put together to show how easy and quickly things can be built - it's a simple dodge game.

 

post-11520-0-85908600-1417837788_thumb.png

 

And the code:

 

100 REM SIMPLE DODGE GAME
101 REM
110 U235MOD(0)
120 SPRX=8: SPRY=12: SPRACT=4: SPRXADD=16: SPRWHIT=112: SPRHITS=132
130 FRCOUNT=0: CURRENT=0
140 PY=100
300 REM MAIN LOOP
310 FRCOUNT=FRCOUNT+1
320 IF FRCOUNT=10 THEN GOSUB 800: REM ADD NEW ENEMY
330 STICK=U235PAD(1)
340 IF (STICK=1 AND PY>20) THEN PY=PY-2
350 IF (STICK=2 AND PY<200) THEN PY=PY+2
360 RSETOBJ(1,SPRY,PY<<16)
370 IF RHIT(1,1,2,22)<>-1 THEN U235SND(0,4)
380 RUPDALL
390 GOTO 300
800 REM NEW ENEMY
810 RSETOBJ(2+CURRENT,SPRX,352<<16)
820 RSETOBJ(2+CURRENT,SPRY,INT(RND(0)*200)<<16)
830 RSETOBJ(2+CURRENT,SPRWHIT,-1)
840 RSETOBJ(2+CURRENT,SPRHITS,1)
850 RSETOBJ(2+CURRENT,SPRXADD,-2<<16)
860 RSETOBJ(2+CURRENT,SPRACT,1)
870 CURRENT=CURRENT+1: IF CURRENT=20 THEN CURRENT=0
880 FRCOUNT=0
890 RETURN

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...