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! / RAPID fire Sprites, It works but summit aint right, please help!

Author
Message
synth002 Beyond Thunderdome
20
Years of Service
User Offline
Joined: 21st Dec 2003
Location: uk
Posted: 21st Dec 2003 18:24
hello all, this is my first post on these forums and like so many others I come here asking questions.

I am trying to make a scrolling space invaders game (still in basic stages) My rapid fire doesnt wana work, well take a look at the code, i think maybe its cus the screen isnt being updated until the bullet(s) have impacted, or maye there moving too fast.

I have tried to include notes so people can understand me code, I hope it isnt to messy.

thanx a load for any help, synth002

-=Synth002 - Difunctional.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Dec 2003 19:19
You need to have the bullet control happen without a halt in the gameplay. so keep calling this routine all the time. If you want more than 1 bullet you will have to store all the X/Y and Bullet numbers like this....Player_Blasty(N)..bullet(n) Player_blastx(n)


Rem If the bullet has not hit the boundries

If Player_Blasty <> 25
dec player_blasty
rem update the current bullet position
sprite bullet,player_blastx,player_blasty,3
endif

Pincho.
synth002 Beyond Thunderdome
20
Years of Service
User Offline
Joined: 21st Dec 2003
Location: uk
Posted: 21st Dec 2003 21:14
Thanx Pincho, looks like it will all be worked out soon .

cheers, synth002.

-=Synth002 - Difunctional.
synth002 Beyond Thunderdome
20
Years of Service
User Offline
Joined: 21st Dec 2003
Location: uk
Posted: 22nd Dec 2003 17:28
Hello agaian! I have bad news, after a day of trying to figure a way of tracking the position of all bullets fired using arrays I have come to the concusion that, i dont know how to do it .

I have checked out rapid fire code but its for 3d and although it made some sense i dont know how to adapt it to my code, and if I did manage to i wouldnt really understand it.

Could you explain (pincho) or anyone, just how i would store the positions, cus 1 bullet really aint enough. I just need to understand exactly what im trying to do b4 i can do it.

Anyway, I have updated my code for my 2d scrolling space shooter(to-be) it includes more realistic movement and gravity, all you need to do is make a ship and bullet image file.

Thanx a load to any1 who can help, synth002.

-=Synth002 - Difunctional.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 22nd Dec 2003 17:45 Edited at: 22nd Dec 2003 17:46
It's the same code, but used like this......

For n = 1 to 10
If Player_Blasty(n) <> 25
dec player_blasty(n)
rem update the current bullet position
sprite bullet(n),player_blastx(n),player_blasty(n),3
endif

Next n

Pincho.
Billj
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location:
Posted: 13th Jan 2004 04:18
This is my personal preference but i suggest not using sprites because then you dont have to worry about which sprites are which.

Also what i seggest it to create a type for bullets like the one i use in my game bellow



then you create an array of bullets and have it be the bullet type
like the one i use below



and it starts as 0 and whenever you want to add a bullet you

use the command "array insert at bottom Array(0)"

which adds one to the array and also add one to the "bulletnum"
variable and then finally set the properties for the last bullet.

hope this helps,

billj

The programmer is the ultimate being

Login to post a reply

Server time is: 2024-05-11 12:56:53
Your offset time is: 2024-05-11 12:56:53