I'm having trouble making enemies that take more than 1 hit in a shmup
RushDawg
Member Posts: 86
Hey guys,
I'm making a shmup (and I'm pretty much done) but one thing has me stuck.
I have enemies that take more than 1 hit. The enemy actors have an attribute called hit points. When the enemy gets hit, the hit point attribute changes to hit points = hit points - 1. Also, a timer changes the actor colour after 0.02 seconds.
When I make an enemy that takes more than 1 hit, the player attacks (lasers that spawn every 0.3 seconds when the fire button is held down) can kill the enemy just fine.
However if the player rapidly taps the fire button, it can spawn lasers faster than when the fire button is held down. When the player does this, the first attack registers but subsequent attacks just pass through the enemy.
The shooter template included with GameSalad uses pretty much the same behaviour for its boss character but doesn't seem to have this problem. Of course the template is for a web game and not an iPhone game.
Is this the problem?
Any help is appreciated! I'm looking to wrap this game up and I'm completely stuck on this.
I'm making a shmup (and I'm pretty much done) but one thing has me stuck.
I have enemies that take more than 1 hit. The enemy actors have an attribute called hit points. When the enemy gets hit, the hit point attribute changes to hit points = hit points - 1. Also, a timer changes the actor colour after 0.02 seconds.
When I make an enemy that takes more than 1 hit, the player attacks (lasers that spawn every 0.3 seconds when the fire button is held down) can kill the enemy just fine.
However if the player rapidly taps the fire button, it can spawn lasers faster than when the fire button is held down. When the player does this, the first attack registers but subsequent attacks just pass through the enemy.
The shooter template included with GameSalad uses pretty much the same behaviour for its boss character but doesn't seem to have this problem. Of course the template is for a web game and not an iPhone game.
Is this the problem?
Any help is appreciated! I'm looking to wrap this game up and I'm completely stuck on this.
Comments
One way to test that would be to slow down the 'bullets' and see if they start registering the second hit. Failing that I think we would need to look at how your behaviours are set up.
I am having collision detection issues with my game.
I have a player who fires lasers at enemies that take 3 shots to kill.
When the player fires the laser slowly, all collisions register properly and the enemy actor dies after 3 hits.
When the player fires the laser rapidly, only the first laser to hit the enemy actor registers and all other lasers pass right through the enemy actor.
When this occurs it looks ridiculous and breaks my game and I am honestly stumped as to how to fix it.
Anyone have any ideas?
I think that may be the issue. When the player holds down the fire button, there is sufficient time between laser hits for the collision to "reset".
Is there a workaround for this issue?
This issue doesn't seem to be present in the "Shooter" template included with Game Salad
Sorry again and thanks for the great (and speedy) help
Has anyone else come up with a solution to this problem in the past? I am at a loss!
Thanks for the suggestions guys, Sorry again for the double post.