Jump to content

Recommended Posts

I didn't think anybody would need to look at the code, especially since it won't work correctly as-is, but I just added the .bas code to the bB page in case it might be helpful:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_8_8_speed_change

  • Thanks 1
9 hours ago, Random Terrain said:

I didn't think anybody would need to look at the code, especially since it won't work correctly as-is, but I just added the .bas code to the bB page in case it might be helpful:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_8_8_speed_change

To be honest, I don't know if I would fully understand it but I was trying to come up with some kind of speed change.  The code I posted previously was kind of a start where I was at but was curious what other ways were out there.  I am not the best with math so I came up with my code of using the counter to then change the velocity and while it seems to work okay, I was wondering what other methods were out there.  

 

This was what I eventually settled on last night:

 if !joy0fire && f>0 then g=g+1: goto SPEEDDOWN   
 if joy0fire then g=g+1: goto SPEEDUP
 goto AFTERSPEEDUP
SPEEDUP
 if g=30 && velocity<2 then velocity=velocity+0.30:g=0
 if velocity>2 then velocity=2
 p0x=p0x-velocity
 if velocity<1 then m0x=m0x-velocity else m0x=m0x-1
 if w{2} then player6x=player6x+1
 goto AFTERSPEEDUP

SPEEDDOWN
 if g=30 then velocity=velocity-0.30:g=0
 if e=0 && joy0left then velocity=0
AFTERSPEEDUP
 p0x=p0x-velocity
 m0x=m0x-velocity

To give a kind of parallax scrolling effect, I limit the speed at which the missile (m0x) moves since in my program that is located farther in the background and I max out the speed change. To have it slow down I check the individual variables that make up "velocity."

  • Like 1

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