Jump to content
IGNORED

My 7800 Vertical Shooter - Heofonfīr


Recommended Posts

Link to comment
Share on other sites

On 10/17/2020 at 12:51 PM, SlidellMan said:

Here's my latest sprite for one of the player characters.

heofonfir_160b_playerselect_lucelia_WIP_02.png

Looks like Princess Booty needs to dye her roots! ?

 

Something for the older generation.                          Keeping it real!

Edited by Jinks
  • Haha 1
Link to comment
Share on other sites

I'm currently writing in a Twin laser power-up for the shooting demo.

power_up_obtained
    if power_upFlag=1 then 
    if joy0fire && joyposup=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
    if joy0fire && joyposdown=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
    if joy0fire && joyposleft=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
    if joy0fire && joyposright=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
    if !joy0fire then twinlaserX=playerX+2:twinlaserY=playerY-8

No build, just the source files this time.

vertical_shooting_laser.png

Vertical Shooter 10-23-2020.zip

Update: Here's the latest ROMs and list file.

New_VerticalShooter_Test_sprani.78b.a78 New_VerticalShooter_Test_sprani.78b.bin New_VerticalShooter_Test_sprani.78b.list.txt

Edited by SlidellMan
New Rom!
  • Like 2
Link to comment
Share on other sites

  • 1 month later...

It has been over one month since I last touched this, but I'm still confounded on how to get the return to title screen to work upon the Game Over screen. Here's the subroutine:

gameover_loop
    if lives<1 then gameover_flag=1:clearscreen
    plotchars 'Game Over!' 0 40 16
    if joy0fire then fire_debounce=1
    if !joy0fire then fire_debounce=0
    goto gameover_loop
    if fire_debounce=1 then clearscreen:goto plot

What also needs to be done:

-Get the laser power-up working

-Get the explosions to work properly

-Get the firing sound effect to work properly

-Get the Lives and score to display properly

Link to comment
Share on other sites

The logical flow of the code that you posted has some problems.

 

The clear screen would only happen if lives was less than 1, you might want to clear the screen anyway, not just if the "if" condition is met, especially if this is a subroutine for gameover. You would also need a drawscreen in the gameover loop otherwise your message won't get plotted.

 

You also have an if test after the "goto gameover_loop" so that if test will never be tested because of the goto just before it.

 

I'd suggest testing for lives = 0 or lives <1 in your main loop and then if it's found to be true (ie the player has run out of lives) then jump to the game over loop. You only need to go to that piece of code if it is "game over" and not every frame, otherwise you are just adding processing overhead to the game. 

 

This is Pseudo code to demonstrate:

Main_loop 
   clear the screen
   plot stuff
   draw the screen
   test stuff
   if lives = 0 then goto game_over
   goto Main_loop 


game_over
    clear the screen
    plotchars "game over!" 0 40 16
    do debounce checks
    if fire button pressed and debounce is ok then goto title_page else goto game_over
    

Writing pseudo code can be a good way to figure out the logic of what you want to do before you actually try to code it. I do this a lot and it helps spot holes in your logic and also helps with the logical flow and structure of the code. I used to be pencil and paper for a few hours before I start to code, but now I use a spreadsheet :) 

 

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

@MuddyfunsterThanks, and points taken. As a token of my gratitude, here's the latest source. Oh, and I tested the latest build in Bup System, and it works.

Vertical Shooter 12-11-2020.zip

New_VerticalShooter_Test_sprani.78b.a78 New_VerticalShooter_Test_sprani.78b.bin New_VerticalShooter_Test_sprani.78b.list.txt

Edited by SlidellMan
Forgot to include the regular binary.
  • Like 2
Link to comment
Share on other sites

Here's some new progress on an older source file:

 

I also would like to mention that it took a few minutes to realize that syntax error.

heofonfir_lucelia_160b_wip.png

shooting_test.78b.a78 shooting_test.78b.bin shooting_test.78b.list.txt shooting Test 12-18-2020.zip

 

Quick update: I just added a continue screen routine to my other demo. However, here's the catch:

--- Unresolved Symbol List
BREAKPROTECTOFF          0000 ????         (R )
0.playerX                0000 ????         (R )
0.titlescreen_loop       0000 ????         (R )
 
   stack allowance: 30 nested subroutines.
   the canary is situated at: $1c1
   873 bytes of ROM space left in the main area.
             790 bytes of ROM space left in DMA hole 0.
     $1880 to $1fff used as zone memory, allowing 15 display objects per zone.
     2310 bytes left in the 7800basic reserved area.

 

Vertical Shooter 12-18-2020.zip

Edited by SlidellMan
Link to comment
Share on other sites

I decided to write down some notes in regards to what I have learned over the months.

1. Be sure to set up what you need.

2. Be sure to dim your variables, properly plot them, and never dim labels.

3. '&&' comes in between 'if' and 'then'; ':' always comes after 'then'.

4. All subroutines must be placed after 'goto mainloop'.

Link to comment
Share on other sites

For now, I have decided to comment out the continue screen routine. This will remain that way until I find out how to rectify that. As usual, I have included the source code, list file, and the ROMs.

gameover
    gameover_flag=0
gameover_loop
    if lives=0 then gameover_flag=1:clearscreen
    plotchars 'Game Over!' 0 40 16
    if joy0fire then fire_debounce=1
    if !joy0fire then fire_debounce=0
    if fire_debounce=1 then clearscreen:goto plot
    goto gameover_loop
 ;   goto continue_loop
/*
continue
    continue_flag=1
continue_loop
    plotchars 'Continue?' 0 40 3
    plotchars 'Yes' 0 24 4
    plotchars 'No' 0 72 4
    if joy0fire0 then fire_debounce=1
    if !joy0fire0 then fire_debounce=0
    if joy0left && fire_debounce=1 then clearscreen:goto playerX=80 : playerY=144:playerFlag=0:explosion_aniframe=0:goto main
    if joy0right && fire_debounce=1 then clearscreen:goto titlescreen_loop
    goto continue_loop
*/

So far, the game over screen still works.

Vertical Shooter 12-21-2020.zip New_VerticalShooter_Test_sprani.78b.a78 New_VerticalShooter_Test_sprani.78b.bin New_VerticalShooter_Test_sprani.78b.list.txt

  • Like 1
Link to comment
Share on other sites

On 12/19/2020 at 11:24 PM, SlidellMan said:

I decided to write down some notes in regards to what I have learned over the months.

1. Be sure to set up what you need.

2. Be sure to dim your variables, properly plot them, and never dim labels.

3. '&&' comes in between 'if' and 'then'; ':' always comes after 'then'.

4. All subroutines must be placed after 'goto mainloop'.

3. && is used to represent "AND", it's a boolean operator that you can use if you want to test an extra condition. It's not mandatory in an IF...THEN statement. Using it creates a compound statement.

 

For example.

 

if dog = 6 && cat = 8 then goto mouse

 

this logic tests to see if dog = 6 and cat = 8, if so it jumps to the code routine labeled "mouse". If one (or both) of the conditions is not met, it does not jump. That's the point of && (and) here, to test for multiple conditions.

 

I could just test without it :

 

if dog = 6 then goto mouse

 

and not use "&&", but then I am not testing the second condition.

 

Also, ":" doesn't come after "then". Not sure what you mean here. Usually the code that comes after "then" is the code that gets executed depending on the IF test condition, as in the example above. You can have commands after a "then" command to do more stuff and that's when to use ":" to separate them. eg.

 

if dog = 6 && cat = 8 then duck = 0 : goto mouse

 

so you are just using ":" to separate the commands. The "goto mouse" code only gets executed if the conditions in the compound statement occur.

 

This might help

 

  • Like 2
Link to comment
Share on other sites

I just changed

if joy0fire then clearscreen:savescreen:lives=$04:score0=0:goto main:playsfx sfx_bling

to

if joy0fire then clearscreen:savescreen:lives=$04:score0=0:playsfx sfx_bling:goto main

in my current working file. I can't believe that I overlooked that all this time I was working on it. If there is anything else I have overlooked, I would like to know.

Vertical Shooter 12-26-2020.zip New_VerticalShooter_Test_sprani.78b.a78 New_VerticalShooter_Test_sprani.78b.bin New_VerticalShooter_Test_sprani.78b.list.txt

Edited by SlidellMan
Source files and ROM downloads.
  • Like 1
Link to comment
Share on other sites

I just wanted to thank those who provided criticism and advice on my project, as well as those who downloaded the ROMs and tried them on actual hardware and emulators. Especially to @Muddyfunster, @SmittyB, @RevEng, @mksmith, and @Mord. It means a lot.

gameover
    gameover_flag=0
    fire_debounce = 1
gameover_loop
    if lives=0 then gameover_flag=1:clearscreen
    plotchars 'game over!' 0 40 16
    if joy0fire && !fire_debounce then clearscreen:goto continue
    if !joy0fire then fire_debounce=0
    goto gameover_loop


continue
    continue_flag=0
continue_loop
    plotchars 'continue?' 0 40 3
    plotchars 'yes' 0 24 4
    plotchars 'no' 0 72 4
    if joy0fire0 then fire_debounce=1
    if !joy0fire0 then fire_debounce=0
    if joy0left && fire_debounce=1 then clearscreen:playsfx sfx_plainlaser:goto playerX=80 : playerY=144:playerFlag=0:explosion_aniframe=0:goto main
    if joy0right && fire_debounce=1 then clearscreen:playsfx sfx_plainlaser:goto plot
    goto continue_loop

Anyways, here's my attempt at a continue subroutine with an edit of the current Game Over one.

Update: Here's the latest source code and ROM files. They are in the enclosed .zip.

Vertical Shooter 1-05-2021.zip

Edited by SlidellMan
New Rom!
  • Like 1
Link to comment
Share on other sites

Here's the latest update:

continue
    continue_flag=0
    fire_debounce = 1
continue_loop
    plotchars 'continue?' 0 40 3
    plotchars 'yes' 0 24 4
    plotchars 'no' 0 72 4
;    if joy0fire0 then fire_debounce=1
    if !joy0fire0 then fire_debounce=0
    if joy0left && joy0fire && !fire_debounce then clearscreen:playsfx sfx_plainlaser:goto playerX=80 : playerY=144:playerFlag=0:explosion_aniframe=0:goto main
    if joy0right && joy0fire && !fire_debounce then clearscreen:playsfx sfx_plainlaser:goto plot
    goto continue_loop

 

Vertical Shooter 1-11-2021.zip

Link to comment
Share on other sites

I finally decided to try to get my twin laser power up to work so I changed:

if joy0fire && joyposup=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if joy0fire && joyposdown=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if joy0fire && joyposleft=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if joy0fire && joyposright=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser

to

if twinlaser_flag=1 && joy0fire && joyposup=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if twinlaser_flag=1 && joy0fire && joyposdown=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if twinlaser_flag=1 && joy0fire && joyposleft=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser
if twinlaser_flag=1 && joy0fire && joyposright=1 then twinlaserY=twinlaserY-10 : playsfx sfx_plainlaser

However, upon testing, no real change.

Before I go, congratulations to those 7800 Homebrew nominees.

New_VerticalShooter_Test_continue.78b Vertical Shooter 1-16-2021.zip New_VerticalShooter_Test_continue.78b.a78 New_VerticalShooter_Test_continue.78b.bin New_VerticalShooter_Test_continue.78b.list.txt

  • Like 2
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...