Can you help me? Holding spacebar to shoot doesn't collide properly

rab127rab127 Member, PRO Posts: 47
edited November -1 in Working with GS (Mac)
Hi

A newbie question.

I am using the basic shoot em up and have a problem with the laser fire.

I've changed some enemy ships to have to have hit points.
the self.hitpoints-1 decreases them untill they die at 0.

The problem I have is if I tap the spacebar to send three shots at an enemy it dies.
If I hold the spacebar down and a stream of shots hit it it doesn't die.

What is the problem with holding down the laser?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you probably have your die rule when hit points=0

    you want it to be when hit points is less then or equal to 0

    It sounds like its getting hit so fast its hitpoints are dropping into the negatives before anythign has a chance to register the 0
  • rab127rab127 Member, PRO Posts: 47
    Thanks

    tried it and it didn't work but I think the issue is that I have multiple actors being spawned that share the same "hitpoints" attribute that are on the screen at the same time.

    I seem to get two extremes of behavior;
    1. Even though I have hitpoints at 3 they get destroyed on the first hit of the laser.
    2. or I can't destroy them
  • ShineyGamesShineyGames Member Posts: 157
    Try using self attribute instead of the globe ones(share the sme hit pionts)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yes the hitpoints attribute needs to be a self attribute
  • rab127rab127 Member, PRO Posts: 47
    Thanks

    Checked they are all actor, self, attributes
Sign In or Register to comment.