diff --git a/!TheEscape/!RunImage,ffb b/!TheEscape/!RunImage,ffb index 3e7b226..3b21248 100644 Binary files a/!TheEscape/!RunImage,ffb and b/!TheEscape/!RunImage,ffb differ diff --git a/!TheEscape/!RunImage,ffb.bas b/!TheEscape/!RunImage,ffb.bas index f947b5e..c667d14 100644 --- a/!TheEscape/!RunImage,ffb.bas +++ b/!TheEscape/!RunImage,ffb.bas @@ -1,3 +1,6 @@ +SCREENMODE%=32 +SCREENGFXWIDTH%=1600 +SCREENGFXHEIGHT%=1200 PROC_main END @@ -7,12 +10,14 @@ DEF PROC_main DIM Scr% 0 DIM PlayerLocation%(1) - PlayerLocation%(0) = 800 + PlayerLocation%(0) = SCREENGFXWIDTH%/2 PlayerLocation%(1) = 100 - PlayerVelocity%=1 + PlayerVelocity%=0 PlayerShields%=100 PlayerStructuralIntegrity%=100 - XMovePerCent%=10 + DIM PlayerHitbox%(3) + PlayerHitbox%() = 0,0,60,81 + XMovePerCent%=5 ResetShipSprite% = 0 REM Show/hide debug display @@ -20,15 +25,17 @@ DEF PROC_main DIM SpecLocations%(1,49) FOR Spec%=0 TO 49 - SpecLocations%(0,Spec%) = RND(1600) - SpecLocations%(1,Spec%) = RND(1200) + SpecLocations%(0,Spec%) = RND(SCREENGFXWIDTH%) + SpecLocations%(1,Spec%) = RND(SCREENGFXHEIGHT%) NEXT Spec% REM Used for centiseconds per frame calcs Cents% = TIME - REM 800x600x256 GFX Area 1600x1200 - MODE 32 + MODE SCREENMODE% + + REM Position text cursor at graphics location + VDU 5 REM Sprite set sprite_area% = FNload_sprites("Spr") @@ -43,23 +50,21 @@ DEF PROC_main CLS + REM Space dust / stars FOR Spec%=0 TO 49 GCOL 0,0 LINE SpecLocations%(0,Spec%),SpecLocations%(1,Spec%),SpecLocations%(0,Spec%),SpecLocations%(1,Spec%) SpecLocations%(1,Spec%) = SpecLocations%(1,Spec%) - ((Cents% - LastCents%) * PlayerVelocity%/10) IF SpecLocations%(1,Spec%) < 0 THEN - SpecLocations%(1,Spec%) = 1200 - SpecLocations%(0,Spec%) = RND(1600) + SpecLocations%(1,Spec%) = SCREENGFXHEIGHT% + SpecLocations%(0,Spec%) = RND(SCREENGFXWIDTH%) ENDIF NEXT Spec% REM Draw LCARS in top left - PROCdraw_sprite("lcars",0,940) - - IF DebugOut% = 1 THEN - PROCdebugoutput - ENDIF + PROCdraw_sprite("lcars",4,SCREENGFXHEIGHT%-180) + REM If using l/r sprites we debounce to stop it looking twitchy IF Cents% > ResetShipSprite% THEN ShipSprite$ = "player_ship" ENDIF @@ -67,9 +72,7 @@ DEF PROC_main REM Handle Key inputs PROCinputs - REM Use graphics cursor for text (TODO: Is this needed in loop?_) - VDU 5 - + REM Attribute names GCOL 0,0 MOVE 75,1150 PRINT "Sheilds" @@ -78,6 +81,7 @@ DEF PROC_main MOVE 75,1090 PRINT "Velocity" + REM Attribute values GCOL 0,7 MOVE 130,1150 PRINT PlayerShields% @@ -89,6 +93,10 @@ DEF PROC_main REM Draw player ship PROCdraw_sprite(ShipSprite$,PlayerLocation%(0),PlayerLocation%(1)) + IF DebugOut% = 1 THEN + PROCdebugoutput + ENDIF + REM Wait for rendering to complete WAIT @@ -137,6 +145,7 @@ DEF PROCdebugoutput MOVE 0,500 PRINT "X: " + STR$(PlayerLocation%(0)) " Y: " STR$(PlayerLocation%(1)) PRINT "CPF: " + STR$(Cents% - LastCents%) + RECT PlayerLocation%(0) + PlayerHitbox%(0), PlayerLocation%(1) + PlayerHitbox%(1), PlayerHitbox%(2), PlayerHitbox%(3) ENDPROC REM Delay routine - thanks Sophie diff --git a/!TheEscape/Spr,ff9 b/!TheEscape/Spr,ff9 index 1d9182d..d39688f 100644 Binary files a/!TheEscape/Spr,ff9 and b/!TheEscape/Spr,ff9 differ diff --git a/README.md b/README.md index 03e103e..9f9a037 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,18 @@ # TheEscape RiscOS Game -Totally not at all based on Star Trek. All files are in RiscOS format, with the exception of .BAS files which are plain text conversions of the tokenised BASIC files for easy diffing +Totally not at all based on Star Trek. + +All files are in RiscOS format, with the exception of .BAS files which are plain text conversions of the tokenised BASIC files for easy diffing at GitHub. + +Tested on RPCEmu emulating a Risc PC - StrongARM with 32MB of RAM. + +Controls so far: + +Left Arrow: Left +Right Arrow: Right +Up Arrow: Incrase velocity +Right Arrow: Decrease velocity +Q: Display debug info + +This was written as a BASIC re-learning exercise - any or all of this could have been implemented the wrong way. \ No newline at end of file