Jump to content
IGNORED

Morg Blaster .... creating while learning with RXB


Retrospect

Recommended Posts

Hello everyone.

 

I'm creating another little game for RXB, this time I'd like to document the progress and hopefully pick up some tips from people as I go along.

So far I've got the title screen and the start of the game.  No enemies actually move yet, but the player does , and player can fire.

 

The player is a sprite as is the player missile, the Morgs are character graphics, this was done so as not to trigger the 4 sprite limitation.

 

The screen is simple, a boundary wall with 8 large blocks in the middle.  The player and morgs aren't supposed to be able to pass through these "walls", but as yet there's no code in there to stop any of that.

 

I've used the CALL JOYLOCATE command to move the Schooner around the screen, but as yet I've no idea how to stop the Schooner from passing into a wall due to the nature of JOYLOCATE not giving me the chance to "check my neighbours" before I make a move, unless anyone has any ideas on this?

 

Attached is a little video of the game as is, and the documented badly written source code.  :)

 

I'm going to bed now.

 

MORG BLASTER.txt << RXB source

 

 

 

  • Like 4
Link to comment
Share on other sites

Well I think this will work:

 

! ************
! * JOYSTICK *
! ************
2100 RR=R :: CC=C ! Save R and C incase 104 the h
2101 CALL JOYLOCATE(1,X,Y,8,8,#1,R,C,K)  GOTO 2150 

2104 CALL GCHAR(INT(R+7)/8),INT(C+7)/8,X) :: IF X=104 THEN R=RR :: C=CC :: GOTO 2101 ! If a h is hit it resets
2105 IF Y=4 THEN D=1::FD=1::GOTO 2145
2110 IF Y=-4 THEN D=2::FD=2::GOTO 2145
2115 IF X=-4 THEN D=3::FD=3::GOTO 2145
2120 IF X=4 THEN D=4::FD=4

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

8 hours ago, RXB said:

Well I think this will work:

 

! ************
! * JOYSTICK *
! ************
2100 RR=R :: CC=C ! Save R and C incase 104 the h
2101 CALL JOYLOCATE(1,X,Y,8,8,#1,R,C,K)  GOTO 2150 

2104 CALL GCHAR(INT(R+7)/8),INT(C+7)/8,X) :: IF X=104 THEN R=RR :: C=CC :: GOTO 2101 ! If a h is hit it resets
2105 IF Y=4 THEN D=1::FD=1::GOTO 2145
2110 IF Y=-4 THEN D=2::FD=2::GOTO 2145
2115 IF X=-4 THEN D=3::FD=3::GOTO 2145
2120 IF X=4 THEN D=4::FD=4

Hi Rich.  I inserted that code, but I got a Syntax Error in 2104.  Although I know this code should work.  

Link to comment
Share on other sites

I've put an extra bracket in the statement that you wrote, @RXB , and it no longer gives an error, but it's affected the left/right pattern change and doesn't stop the Schooner from walking through walls.  We'll get there, even if it means I have to go with CALL JOYST and a check beforehand for char 104 in the end ....

 
2104 CALL GCHAR((INT(R+7)/8),INT(C+7)/8,X) :: IF X=104 THEN R=RR :: C=CC :: GOTO 2101 ! If a h is hit it resets
 

 

 

  • Like 2
Link to comment
Share on other sites

So I've managed to get the Schooner to recognise the walls (char 104) and recognise when he's landed on a Morg ... for now the game stops when a morg is stepped on, but there will be a death routine programmed in later.   I've slowed down the player missile so it has less chance of wrapping around the screen.  

 

In order for me to do this I had to use CALL JOYST but it does work.  

 

morg blaster call joyst routine.txt

 

Also , when I get the Morgs moving, I want to use the CALL HPUT commands to move them, as @RXB proved , the other day, that the CALL HPUT command is quite a bit faster than CALL HCHAR.  

 

 

  • Like 2
Link to comment
Share on other sites

morg blaster call joyst routine.txt << morg movement routine at line 2300

 

And now we have the Morgs moving.  They won't kill the player yet (only when the player treads on a Morg, then game stops , for now, still)

The code is clunky but it is working.  I used a routine that rasmus provided for me , in 2013.  That's ten years ago.  Time flies.

 

 

 

  • Like 2
Link to comment
Share on other sites

4 hours ago, Retrospect said:

ooohh ... I got the TI tall font!  Nice!   Is that what was supposed to happen?

Yea nice thing about RXB is you could move just a few of them or all of them unlike most others that move entire thing.

Say you only want capital C to E, you could not do that with others but can with RXB.

  • Like 1
  • Thanks 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...