Problem with effects when enemies are hit by a bullet

Shishkov

  • Posts: 169
Dear colleagues,

I have a problem which is related with strange game behaviour. When bullet is released by actor and it reaches enemy, bullet must reduce enemy life by 1 and enemy must produce a negative effect. It works but not with all enemies and there is no sequences in actions. In other words, 2 till 5 enemies of 6 can act normally as it was described above. The rest of enemies don't produce any effects and their lives are cut down by 2 ponits rather than be cut down by 1 point or they can act normally but not always.

Please help me to solve that problem.
P.S. here is a code in a file.

dtrungle

  • Posts: 1938
I had this problem when I converted my 2.2 game to 3.0.

I didn't spend any time fixing it though, instead I removed this feature.

The issue is most likely due to recycled actor or how the engine was changed so it'll take a lot of debugging on your part.

Try killing the actor bullet where you deal damage to yourself.

Silux

  • Posts: 438
spawn the bullet
when the bullet hits the enemy
  the enemy loses health
  makes what it has to do(like whining "why me!")
  kills or recycles the bullet

It's important that is the enemy to kill the bullet and not the bullet itself.
The bullet could kill itself before the enemy even realizes it is touched:/
Yes i had the same issue time ago

« Last Edit: February 17, 2013, 03:00:44 pm by Silux »
Currently working at:
Starwarrior 2097(my main project)
How to make successful games in Kongregate and the world(article)

Shishkov

  • Posts: 169
thank you very much for your answers.

Actually I kill a bullet when it hits a target and I recycle it when it doesn't hit a target(exit the screen). So I should try killing bullets in any case?

Shishkov

  • Posts: 169
The problem is solved. I had tryed recycling in any case and I was rewarded, so now it works.
Thanks a lot.
Now I'm adding options like music muting and sounds muting, after that I'm on my way to FGL server.

Silux

  • Posts: 438
Currently working at:
Starwarrior 2097(my main project)
How to make successful games in Kongregate and the world(article)