Tightening collision detection
zombieninjas
Member Posts: 10
I'm working on an R-type...type... shooter, so it is going to be very fast paced. what i have so far is good, but the bullets shot from my player dont all register as a hit, it seems to be every third of fourth bullet shot detected as a hit. Does anyone have any tips on how to make this a bit tighter?
Comments
As to your question, how rapidly is your ship shooting?
Also, if may be worth changing the collision shape to square (you can change it from square to circle in an actor's attributes - it's where you define the size, change position, disable/enable moveable etc).
If you're shooting too fast for the shots to all register (look, I don't know, I'm making this up as I go along) then try reducing the shot rate till you get a nice solid hit every time.
Hope that helps
QS.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Say the actor you're shooting is 50 x 50 pixels. If the bullet hits at:
X is equal or greater than 25 or X is equal or less than 25
OR
Y is equal or greater than 25 or y is equal or less than 25
Subtract 25 from health.
I'm sorry if what I'm saying isn't too clear. If someone could maybe iterate what I was saying if they get it...
On the off-chance that I'm totally wrong about this (and try this before going crazy with what I just typed), up the density for the what you're shooting. Just a hunch.
If that is even true, you have to deal with the items bouncing when they hit...
Also, I noticed the sin and cos tutorial for getting the enemies to move in waves, which was a tremendous help, but I'm curious if anyone knows how to get other types of movements, Z formations and the like. It's been a while since I took a math class so I might just have to brush up a little to figure that one out.
So basically the bullet collides, bullets spawns trigger, trigger kills enemy, trigger destroys itself so it doesnt get more enemies
often actors did collide but some of the rules just didnt trigger
Timers invloved can mess up even more
for example if your enemy is hit with a bullet and you have the often needed "destroy after .02 seconds" so that your enemy can trigger a rule before dying.
sometimes the timer rule wont trigger but i know they connected for a micro second because other rules triggered
From what you said in another thread, it seems you're trying out the free version of GS - which is all good - it lets you build games after all!
What I'd be careful of is making a game that will not fit on an iPhone.
What I mean is, that your rate of fire may cripple your game on earlier machines (as in 1st gen ipod touch, iphone 3G).
My two upcoming shooters will be 3GS only. There's so many bullets and enemies on-screen that the earlier models just can't handle it.
There are ways of optimising for earlier models, but I really didn't want to compromise on the action
Of course, if your target device is an iPad, then go for it - I've heard it can handle pretty much anything!
One other thing I thought of that might help. People making tower defence games often ask how they can move actors along a path. One solution is to have invisible 'walls' that when hit, make an actor walk in another direction.
With a little planning and imagination, i reckon you could incorporate something like that in a shooter for more varied movement.
Or just use the 'interpolate' behaviour lots!
Best of luck!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io