flammingcowz Posted April 13, 2015 Share Posted April 13, 2015 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 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 13, 2015 Share Posted April 13, 2015 Have you checked out the example programs on the bB page? randomterrain.com/atari-2600-memories-batari-basic-commands.html#example_programs There are some examples that have a shooting missile that keeps moving even after you let go of the fire button. Here are a few: randomterrain.com/atari-2600-memories-batari-basic-commands.html#repetition_restrainer_for_fire_button randomterrain.com/atari-2600-memories-batari-basic-commands.html#sprite_missile_example randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_tinkernut_world_deluxe Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted April 15, 2015 Share Posted April 15, 2015 Does this work? if joy0fire && e=1 then missile0y = player0y - 7 : missile0x = player0x + 4 :e =2 if e>1 then missile0x=missile0x+1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 15, 2015 Share Posted April 15, 2015 Does this work? if joy0fire && e=1 then missile0y = player0y - 7 : missile0x = player0x + 4 :e =2 if e>1 then missile0x=missile0x+1 He probably doesn't want to waste an entire variable on missile movement. Quote Link to comment Share on other sites More sharing options...
flammingcowz Posted April 16, 2015 Author Share Posted April 16, 2015 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? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 16, 2015 Share Posted April 16, 2015 This whole programming thing is pretty overwhelming. Is there any specific language I should learn first and then come back to BB? Check this out: randomterrain.com/atari-2600-memories-batari-basic-commands.html#newtobasic 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.