Jump to content
IGNORED

My 7800 Vertical Shooter - Heofonfīr


Recommended Posts

Here's the latest source and ROMs with attempts at fixing the bullet bug. Edit: I just found out that I forgot to add the demo part to the filenames when adding them to the incgraphic section. Here are the updated ROMs and source.

Vertical Shooter 11-17-2021.zip New_Vertical_Shooter_Rewrite5.78b.a78 New_Vertical_Shooter_Rewrite5.78b.bin

Edited by SlidellMan
Bug just fixed.
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

One idea that I've been thinking about adding to Heofonfīr: A Time Trial/Attack mode. Granted, I still need to work on my engine to make sure it runs properly.

Durations:

2:30 (Brief)

5:00 (Medium)

7:30 (Long)

10:00 (Let's see if you can clear each stage within this.)

In Time Trial mode, you can gain time for shooting down enemies. Think of this as something for fans of Naxat Soft and Hudson Soft's Shmups.

I also plan on adding difficulty settings for those who want a decent challenge.

Link to comment
Share on other sites

  • 2 weeks later...

I might as well post my shooting routine...

    if joy0up && joyposup=-2 then gosub Set_Bullet_home
    if joy0down && joyposdown=-2 then gosub Set_Bullet_home
    if joy0left && joyposleft=-2 then gosub Set_Bullet_home
    if joy0right && joyposright=-2 then gosub Set_Bullet_home
;Firing Routine
    if joy0fire && joyposup=1 && joyposdown=1 && joyposleft=1 && joyposright=1 then pBullet1_y = pBullet1_y-8: pBullet2_y = pBullet2_y-8: pBullet3_y = pBullet3_y-8: pBullet4_y = pBullet4_y-8
    
    Set_Bullet_home
    pBullet1_x=playerX-8:pBullet1_y=playerY-4
    pBullet2_x=playerX-8:pBullet2_y=playerY-4
    pBullet3_x=playerX-8:pBullet3_y=playerY-4
    pBullet4_x=playerX-8:pBullet4_y=playerY-4
    return
    
    check_firebutton
    if fire_debounce>0 && joy0fire then return ;&& joyposup=1 && joyposdown=1 && joyposleft=1 && joyposright=1  bullet1_xpos=bullet1_xpos+1 :
    if !joy0fire then fire_debounce=0 : return
    temp5 = 255
    for temp1 = 0 to 2
        if pBullet1_y[temp1]!=200 then temp5 = temp1
    next
    if temp5 = 255 then return
    playsfx sfx_pulsecannon
    fire_debounce = 255
    pBullet1_time[temp5] = 200
    pBullet1_x[temp5]=playerX+0
    pBullet1_y[temp5]=playerY-8

    temp5=temp5-6
    return

move_bullets
    if pBullet1_time<>200 then pBullet1_y = pBullet1_y-4
    if pBullet2_time<>200 then pBullet2_y = pBullet2_y-4
    if pBullet3_time<>200 then pBullet3_y = pBullet3_y-4
    if pBullet4_time<>200 then pBullet4_y = pBullet4_y-4
    return

check_bullet_time
    for temp1=0 to 2
        if pBullet1_time[temp1]>0 then pBullet1_time[temp1]=pBullet1_time[temp1]-1 else pBullet1_x[temp1]=200
    next
 return

check_bullet_boundary
    for temp1=0 to 2
        temp_x=pBullet1_x[temp1]
        temp_y=pBullet1_y[temp1]
        if temp_x<1 || temp_x>159 then pBullet1_y[temp1]=200
        if temp_y<1 || temp_y>191 then pBullet1_y[temp1]=200
    next
 return

draw_player_bullets
    for temp_loop=0 to 2
        temp_x=pBullet1_x[temp_loop]
        temp_y=pBullet1_y[temp_loop]
        if temp_x<>200 then plotsprite vertical_shooting_bullet 0 temp_x temp_y
    next
 return

    
    

 

Vertical Shooter 2-27-2022.zip New_Vertical_Shooter_Rewrite5.78b.a78 New_Vertical_Shooter_Rewrite5.78b.bin

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

@SlidellMan, looking over your code I see what could be the issue.

 

It looks like your routine is set to allow three bullets to shoot (0 to 2).

When you run through the loop you check to see if pBullet_y[temp1]!=200 then you make temp5 = temp1

 

After that for loop you check to see if temp5 is still 255. If it isn't, then you continue and set the pBullet1_time[temp5]

 

The problem here is that if the logic allows you to go past the loop, then temp5 is always going to be 2 and you are setting pBullet1_time[temp5] (which should allow you to set all of the bullets in the array) and pBullet1_x and pBullet1_y. But because you don't have another loop here it only sets the last (number 2) item of each array.

 

Try adding another "for temp1 = 0 to 2" loop around those values and see if that allows you to animate the bullets properly. And also check before that to ensure that you are setting the X and Y of each bullet (based on the player position) properly and not resetting or overwriting the value in the loop.

 

Does that help?

 

Try changing from this:

    temp5 = 255
    for temp1 = 0 to 2
        if pBullet1_y[temp1]!=200 then temp5 = temp1
    next
    if temp5 = 255 then return
    playsfx sfx_pulsecannon
    fire_debounce = 255
    pBullet1_time[temp5] = 200
    pBullet1_x[temp5]=playerX+0
    pBullet1_y[temp5]=playerY-8

To this:

    temp5 = 255
    for temp1 = 0 to 2
        if pBullet1_y[temp1]!=200 then temp5 = temp1
    next
    if temp5 = 255 then return
    playsfx sfx_pulsecannon
    fire_debounce = 255
      
    for temp1 = 0 to 2
      pBullet1_time[temp1] = 200
      pBullet1_x[temp1]=playerX+0 ; check to make sure you are using the actual player's X position
      pBullet1_y[temp1]=playerY-8; check to make sure you are using the actual player's Y position - 8
    next
Edited by saxmeister
  • Thanks 1
Link to comment
Share on other sites

Now that I've seen this in action I can tell a bit more about it.

  • The bullets start off in the correct position but then move to the bottom of the screen.
  • Looking over your code now I see that you are using pBullet1_x, pBullet2_x, etc. and there are 4 variables but the loops only run 0 to 2 meaning only 3 bullets get drawn.
  • I don't fully understand why the subroutine "check_firebutton". It seems to check and set the bullet X and Y axes multiple times without correctly setting the Y axis

I highly recommend adding comments to your code as both a reminder for yourself and as a guide to what is happening in the code.

 

Some example code from the Krull project I'm working on:

 

The variables are not only defined but documented how they are used in the code.

  dim level           = b          ; Global: (integer) Variable that communicates what level we have reached. Values are 1-4 for each level
  dim livesleft       = c          ; Global: (integer) Used to tell how many lives the user has; Default is 3 but could be configured in the pre-game options
  dim playerx         = d.e        ; Global: (decimal) Player's X position (decimal)
  dim playery         = f.g        ; Global: (decimal) Player's Y position (decimal)
  dim playerdir       = h          ; Global: (integer) Player's direction: 0=north, 1=south, 2=west, 3=east, 4=northwest, 5=northeast, 6=southwest, 7=southeast

Here the code tells what the subroutine is doing and gives a description of what is happening.

  rem ** Have we picked up all of the glaive shards? No? Then draw them **
  rem ** But, if we have the shard then plot the score instead where we picked it up **
  if gotshard[0]=0 then plotsprite glaive_shard 5 var50 var55 else plotsprite points 5 var50 var55
    ...

Have you ever written in pseudocode? If you haven't, think of it as a story book description of what your code is supposed to do. I write a lot of pseudocode before I ever begin coding. This helps me work out the algorithms better before I get too deep into the weeds.

 

Something is happening to the pBullet1_y[] values that is resetting it to the bottom of the screen after it has been fired. It does start off in mostly the correct place (maybe a few too many pixels to the left of the ship) but something happens to those values after the shot is fired.

 

I think some of it may have to do with how you are naming the variables for the array that is used for the bullets.

 

Note how my code above has gotshard[] ? I defined the variable simply with:

dim gotshard=var60

and then make sure that it has enough "slots" (var61, var62, var63, etc.) after it to use as the array.

 

To do the same with your bullet variables you could do this:

dim pBulletx = var50 ; this allows us to have up to 10 X positions: var50-var59
dim pBullety = var60 ; this allows us to have up to 10 Y positions: var60-var69

; MORE GAME CODE GOES HERE

; Update an array using a for...next loop
for i=0 to 9
  pBulletx[i]=playerX+0
  pBullety[i]=playerY-8
next

Hopefully this helps. Arrays in 7800basic are a bit tricky at first because it's not the same syntax as most BASIC-like languages.

  • Thanks 1
Link to comment
Share on other sites

I've made adjustments to the for temp1 loop, changing it to = 0 to 3. Currently in the process of commenting on what needs to be commented on.

Vertical Shooter 4-20-2022.zip New_Vertical_Shooter_Rewrite5_saxmeister.78b.a78 New_Vertical_Shooter_Rewrite5_saxmeister.78b.bin New_Vertical_Shooter_Rewrite5_saxmeister.78b.list.txt

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
On 11/17/2021 at 3:00 PM, SlidellMan said:

Here's the latest source and ROMs with attempts at fixing the bullet bug. Edit: I just found out that I forgot to add the demo part to the filenames when adding them to the incgraphic section. Here are the updated ROMs and source.

Vertical Shooter 11-17-2021.zip 24.77 kB · 47 downloads New_Vertical_Shooter_Rewrite5.78b.a78 128.13 kB · 58 downloads New_Vertical_Shooter_Rewrite5.78b.bin 128 kB · 22 downloads

Do you have a .a78 file? (assembled)

I can't use the .bin file on real hardware since Concerto thinks .bin = 2600 game

Link to comment
Share on other sites

  • 2 months later...

I finally dealt with that bug involving the shots coming from the bottom of the screen, but now have to deal with the first three being static when fired.

 

Other things I need to do:

-Figure out background scrolling.

-How to code a menu screen.

-Coding enemy patterns.

-Coding a continue screen.

-Coding Bosses.

-How to program endings and credits.

Vertical Shooter 10-18-2022.zip New_Vertical_Shooter_Rewrite6.78b.a78 New_Vertical_Shooter_Rewrite6.78b.bin New_Vertical_Shooter_Rewrite6.78b.list.txt

  • Like 2
Link to comment
Share on other sites

I've had a quick look in your source and the problem with the 3 static shots is that their locations in memory aren't contiguous so that when you loop through them as an array it's actually writing to 1 bullet location and 3 unused spots in memory. I modified their locations quickly and it appears to fix that problem.

 

    dim pBullet1_x = $22A0
    dim pBullet2_x = $22A1
    dim pBullet3_x = $22A2
    dim pBullet4_x = $22A3
    dim pBullet1_y = $22E0
    dim pBullet2_y = $22E1
    dim pBullet3_y = $22E2
    dim pBullet4_y = $22E3

 

  • Like 2
Link to comment
Share on other sites

I'm not able to look at the code at the moment but that sort of thing is usually where you have whitespace in front of your label names so 7800basic thinks it's a command, or where you're using different casing when typing up the commands (I often mistakenly capitalise the first letter and have to go back and change it).

  • Like 2
Link to comment
Share on other sites

Skimming through the source with some attempts at compiling it:

 

The initial set commands at the beginning need to be indented.

 

On line 53:

    if joy0fire=0 then gosub option_select:firedebounce=60

 

You need to use !joy0fire0 or !joy0fire1 depending on the button you want to test for.  The =0 is unnecessary so the 0 is being taken as a keyword. (actually I guess joy0fire is fine? But otherwise needs to be changed regarding =0)

 

on line 55 you have the goto starting at the beginning of the line. It'll need to be indented.

 

In your plotchars for lines 59 and the like, you don't have capital letters defined in your alphachars. Either add them to the font and alphachars definition or you'll need to use lowercase.

 

Finally you didn't dim your mode_index variable.

 

After all these changes it appears to compile... however there are other bugs preventing it from displaying anything. Fire button does seem to work, but don't have time to help track down semantic bugs. Must sleep!

 

  • Like 3
Link to comment
Share on other sites

On 6/10/2020 at 11:49 PM, SlidellMan said:

Here. This includes all the graphics and a newer .bas file because the one I already uploaded was getting cluttered.

heofonfir.zip 58.46 kB · 100 downloads

Fun fact: Any Atari game under 8KB will make Concerto think it's a 2600 game (Lead to some funny stuff with my ICT 8K demo ;) )

Link to comment
Share on other sites

  • 4 weeks later...
On 11/24/2022 at 8:46 PM, SlidellMan said:

I'll send PM. I can't get it to work on A7800. Title looks nice though.

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...