I'm having trouble making enemies that take more than 1 hit in a shmup

RushDawgRushDawg Member Posts: 86
edited November -1 in Working with GS (Mac)
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.

Comments

  • RushDawgRushDawg Member Posts: 86
    Anyone? I'm desperate. I can share my actor info if it would help.
  • RattleheadRattlehead Member Posts: 485
    What behaviour are you using to move the lasers toward the enemies? It could be a collision glitch that is known to happen when the speed of the two objects are set fairly high.

    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.
  • JGary321JGary321 Member Posts: 1,246
    Rattlehead is right. If the 2 lasers hit at basically the same time it won't register both. Basically it needs time to reset the 'collision'.
  • RushDawgRushDawg Member Posts: 86
    Hey guys,

    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?
  • RushDawgRushDawg Member Posts: 86
    The lasers are moving directly to the right at a speed of 500.

    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
  • JGary321JGary321 Member Posts: 1,246
    Rushdawg I moved your DOUBLE post into this post. Please refrain from creating duplicate posts on the same issue. This post is already open, use this one for this issue.
  • RushDawgRushDawg Member Posts: 86
    Sorry Jgary. I didn't mean to spam the boards. I was trying to rephrase my original question in a more understandable manner and delete my original post. By the time I had finished the second post, you guys had already responded to my first.

    Sorry again and thanks for the great (and speedy) help
  • RushDawgRushDawg Member Posts: 86
    So it looks like the problem is that the lasers are colliding too fast with my enemy before they can reset.

    Has anyone else come up with a solution to this problem in the past? I am at a loss!
  • RushDawgRushDawg Member Posts: 86
    So I figured out a way to fix it. Basically, I created a rule to destroy the laser when it collides with the enemy and this seems to have solved the problem.

    Thanks for the suggestions guys, Sorry again for the double post.
Sign In or Register to comment.