Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Help with my game

Author
Message
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 30th Dec 2003 00:41
I'm making a Space Invader game.I'm stuck in how to make the bullet move.
Any help will be welcome.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
justinHeintz
20
Years of Service
User Offline
Joined: 5th Dec 2003
Location: my house
Posted: 30th Dec 2003 00:43
i can help becuase iv done it befor but i dont no how you want it to move

Justin Heintz
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Dec 2003 01:53
Up/Down is the Y position of the bullet. If you decrease the Y position, the bullet goes up.
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 30th Dec 2003 17:34
I know.But I want to shoot in the spacakey and when I prees the space bar the bullet show up but I have to hold the spacebar to the bullet go up.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 1st Jan 2004 18:41
code would be helpful

I was going to put some kind of geek joke, but i can't remember how it goes...

...something about a 12ft butch lesbian.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 1st Jan 2004 23:26
What you're doing is placing the movement code inside of the space bar detection code.

What you need to do is start the bullet then the space bar is pressed and set a variable like... bullet = 1

Then, in your main loop have an if statement that says if bullet = 1 them move the bullet. When the bullet hits the top or an invader, set the bullet variable back to 0.
--
TAZ
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 2nd Jan 2004 00:37
You should post this on the newcomers forums. They won't flame you.

Dual AMD Athlon MP 2x1GHZ | IBM 15000Rpm SCSI 73.4 Gb X 2 | e-GeForce Ti4400 | Audigy 2 + 7.1 Surround sound | 17' Monitor | Ugly mouse
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 4th Jan 2004 10:34
And post code, it's a lot easy to see exactly whats wrong when you see the code instead of trying to guess.

dbpro : 2ghz p4m : 512mb : geforce 4 4200 go
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 6th Jan 2004 01:49
ok
All I want to do is when the bullet is shoot and the player press again the trigger the bullet shoot from the ship.

Here is the code and test it and you can see what I'm talking about.


Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Kwiki Mart
20
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 6th Jan 2004 10:52 Edited at: 6th Jan 2004 10:56
I bet that when you shoot everything stops but the bullet right? Don't use a subroutine, keep using if statments. Like:

shot=0
do
if spacekey()=1 and shot=0 then shoot the bullet : shot=1
if shot=1 then bullety#=bullety#-5
if bullety#<0 then shot=0
if sprite collision(#,#)=1 then shot=0
loop

This should keep the bullet from coming back when the spacekey is pressed again.


also, if you put "bulletx#=playerx#+19" in your main loop then you can get rid of the bulletx# movements from the arrows. It will follow the players movements automaticly.

I hope this helps out.

On target, On time!
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 7th Jan 2004 01:48
Yeah,but I have to hold the spacekey to make the bullet go up.That's what I don't want.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Jan 2004 04:35
Naval Gun's code should fix that!
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 8th Jan 2004 01:49
I erase my part and put Naval Gunz's code and it didn't fix it.It do the same thing.And no,the part of my code don't freeze the game.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!

Login to post a reply

Server time is: 2024-05-12 06:10:17
Your offset time is: 2024-05-12 06:10:17