Jump to content

Recommended Posts

I decided to put a 2-player Indy 500-style mini-game into GoSub, but I need a little help. Here's the problems:

#1: m is not going past 1 (line 380)

#2: t is not going past 0 (line 381)

#3: for one drawscreen cycle once you start, the submarines are way out of where they're supposed to be, but by the next drawscreen, they're where they should be.

Help on #1 & #2 would be greatly appreciated, #3 is not that important, but should be worked on.

gosub122606a.bas

Link to comment
https://forums.atariage.com/topic/99338-minigame-help/
Share on other sites

I decided to put a 2-player Indy 500-style mini-game into GoSub, but I need a little help. Here's the problems:

#1: m is not going past 1 (line 380)

#2: t is not going past 0 (line 381)

#3: for one drawscreen cycle once you start, the submarines are way out of where they're supposed to be, but by the next drawscreen, they're where they should be.

Help on #1 & #2 would be greatly appreciated, #3 is not that important, but should be worked on.

It took me a while to figure out what you're doing, but I think I see the problems with #1 and #2.

 

As I understand it, the c{2} bit is flagging whether or not to increment the score when player0 hits the ball. That is, without the c{2} flag, the score increments 7 times, since the sub is 7 pixels wide and therefore collides with the ball for 7 frames as it's crossing the finish line. So you start out by setting the c{2} flag to true (or 1), and then when player0 collides with the ball, you increment the score and clear the c{2} flag. The problem is that the c{2} flag isn't getting set again. You're setting it in line 255 if x>105, so I presume that x isn't hitting >105 the next time around. I made a quick fix by changing the logic in line 255 so that the c{2} flag gets set whenever player0 is *not* colliding with the ball, as follows:

 

  rem 255 if x>105 then c{2}=1
255 if !collision(ball,player0) then c{2}=1

However, I don't know if that's going to do what you want, because as I understand it, you want to make sure that the sub goes all the way around the course each time. With the above change, the sub can just go back and forth over the finish line and run up the score! :) So you'll need to check what's happening with x that's keeping it from setting the c{2} flag each time around.

 

The problem with #2 is similar, but there's also another problem. It looks like you're using the c{5} bit for the flag for player1, but in line 256 you're setting c{4} instead of c{5}, so that's why t never gets past 0. I made the following quick fix, similar to the previous one:

 

  rem 256 if r>105 then c{4}=1
256 if !collision(ball,player1) then c{5}=1

But again, you'll probably want to see what's going on with r-- after you correct line 256 to set c{5} rather than c{4}-- in case r is having the same sort of problem as x.

 

I don't understand what you're saying in #3, but if you're having problems with x and r, then that might be related to any problems with the subs' positions.

 

Michael

Link to comment
https://forums.atariage.com/topic/99338-minigame-help/#findComment-1204011
Share on other sites

What the c{2} flag is doing is making sure the player goes around the bottom part of the screen. I've added "&& y>40" to the original line 255, but it never seems to get past 1 even though I reset c{2} in line 3000 in bank 2.

Link to comment
https://forums.atariage.com/topic/99338-minigame-help/#findComment-1204430
Share on other sites

What the c{2} flag is doing is making sure the player goes around the bottom part of the screen. I've added "&& y>40" to the original line 255, but it never seems to get past 1 even though I reset c{2} in line 3000 in bank 2.

You need to forget about line 3000, it's doing its job okay. It's line 255 that you need to focus on. For whatever reason (I didn't try to follow it all), the coordinate check(s) in the if statement are not occurring after the first time through, therefore c{2} is never getting set back to 1 after 3000 clears it, hence the routine at line 3000 is being performed only once, and that's why the sub's score never gets past 1.

 

Michael

Link to comment
https://forums.atariage.com/topic/99338-minigame-help/#findComment-1204502
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...