Jump to content
IGNORED

Trying to fire a shot that keeps moving like in Centipede


flammingcowz

Recommended Posts

I'm new to programming and for the last few days have been studying the different example programs here on the forum while trying to figure some things out on my own along the way. One thing that I haven't seen done yet in an example that i'm trying to do is fire a missile that keeps moving even after you let go of the fire button, maybe even with rapid fire if you do hold it down. All I can get it to do is appear when the button is pressed and stop moving when you let go of the button. Is there something simple that i'm missing?

 

The relevant parts of the code are

	rem e will be timer for missile fire
 e = 1

 if joy0fire then gosub fire_missile

fire_missile
 missile0y = player0y - 7 : missile0x = player0x + 4 + e
 if e < 50 then e = e + 1
 if e = 50 then e = 0
 return

I know the way I have it done right now is kind of unnecessary, but it's just gotten more complex as I try more things.

 

default.bas

default.bas.bin

  • Like 1
Link to comment
Share on other sites

Link to comment
Share on other sites

I'm not really worried about wasting anything right now since i'm so new to programming in general, i'm more worried about just getting things working and learning along the way.

 

Thanks for the links RT, i've been going through it since then

 

Atari2600land, yeah that makes the missile keep moving even after the fire button has been released.

 

This whole programming thing is pretty overwhelming. Is there any specific language I should learn first and then come back to BB?

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