SlidellMan Posted November 17, 2021 Author Share Posted November 17, 2021 (edited) 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 November 17, 2021 by SlidellMan Bug just fixed. 1 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted February 17, 2022 Author Share Posted February 17, 2022 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. Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted February 27, 2022 Author Share Posted February 27, 2022 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 1 Quote Link to comment Share on other sites More sharing options...
saxmeister Posted April 19, 2022 Share Posted April 19, 2022 (edited) @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 April 19, 2022 by saxmeister 1 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted April 19, 2022 Author Share Posted April 19, 2022 So, I add another for/next loop in the subroutine? I'll try it. Vertical Shooter 4-18-2022.zip New_Vertical_Shooter_Rewrite5.78b.a78 New_Vertical_Shooter_Rewrite5.78b.bin New_Vertical_Shooter_Rewrite5.78b.list.txt 1 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted April 19, 2022 Author Share Posted April 19, 2022 (edited) Here's the current build with Sax's suggestions. By the way, the ROMs are included in the .zip. Vertical Shooter 4-19-2022.zip Edited April 19, 2022 by SlidellMan 1 Quote Link to comment Share on other sites More sharing options...
saxmeister Posted April 20, 2022 Share Posted April 20, 2022 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. 1 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted April 20, 2022 Author Share Posted April 20, 2022 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 1 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted June 8, 2022 Author Share Posted June 8, 2022 Time for an update, and just when I needed the inspiration. Vertical Shooter 6-8_2022.zip New_Vertical_Shooter_Rewrite5.78b.a78 New_Vertical_Shooter_Rewrite5.78b.bin New_Vertical_Shooter_Rewrite5.78b.list.txt 2 Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 13, 2022 Share Posted August 13, 2022 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 Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 13, 2022 Share Posted August 13, 2022 Dude, your projects are great! Me and Traxx and this pixel-art dude are (going to ) be working on a new game. Unsure if it will be related to It's Conner Time! or not. If the project goes well, want to join? Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted August 13, 2022 Author Share Posted August 13, 2022 There's an .a78 file in the post above you. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 13, 2022 Share Posted August 13, 2022 LOL, was cutoff by the big name. 7 minutes ago, SlidellMan said: There's an .a78 file in the post above you. Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 18, 2022 Author Share Posted October 18, 2022 @Ecernosoft I might, but this game needs to be finished. To be honest, trying to get a scrolling background to work has been baffling to me to say the least. Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 18, 2022 Author Share Posted October 18, 2022 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 2 Quote Link to comment Share on other sites More sharing options...
+SmittyB Posted October 18, 2022 Share Posted October 18, 2022 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 2 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 18, 2022 Author Share Posted October 18, 2022 (edited) @SmittyB Thank you, and I made the necessary changes. New_Vertical_Shooter_Rewrite6.78b.a78 New_Vertical_Shooter_Rewrite6.78b.bin New_Vertical_Shooter_Rewrite6.78b.list.txt Edited October 18, 2022 by SlidellMan Now with proper attachments. 2 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 20, 2022 Author Share Posted October 20, 2022 Well, I decided to get to work on the menu for this game. Unfortunately, I'm running into unknown keyword bugs. Menu Demo 10-20-2022.zip Quote Link to comment Share on other sites More sharing options...
+SmittyB Posted October 20, 2022 Share Posted October 20, 2022 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). 2 Quote Link to comment Share on other sites More sharing options...
Mord Posted October 21, 2022 Share Posted October 21, 2022 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! 3 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 21, 2022 Author Share Posted October 21, 2022 I fixed most of the bugs that you pointed out Mord. Menu Demo 10-21-2022.zip Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted October 27, 2022 Author Share Posted October 27, 2022 I can't believe that I forgot to post my source code for anyone who wants to take a look under the hood. Vertical Shooter 10-19-2022.zip Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted October 27, 2022 Share Posted October 27, 2022 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 ) Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted November 25, 2022 Author Share Posted November 25, 2022 I decided to update my menu demo with separate debounce variables for all four directions. Menu Demo 11-24-2022.zip Menu_Demo_v1.78b.a78 Menu_Demo_v1.78b.bin Quote Link to comment Share on other sites More sharing options...
+darryl1970 Posted November 28, 2022 Share Posted November 28, 2022 On 11/24/2022 at 8:46 PM, SlidellMan said: I decided to update my menu demo with separate debounce variables for all four directions. Menu Demo 11-24-2022.zip 167.78 kB · 1 download Menu_Demo_v1.78b.a78 128.13 kB · 3 downloads Menu_Demo_v1.78b.bin 128 kB · 0 downloads I'll send PM. I can't get it to work on A7800. Title looks nice though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.