Link to .capx file (required!):
Bugged Version
dropbox.com/s/rnu6ndgsoq3hfgu/Space%20Vikingz%20-%20Function%20Bug.capx
It works this way
dropbox.com/s/o9qo3h3vsdlp5l8/Space%20Vikingz%20-%20Working.capx
Steps to reproduce:
1. Run the project
2. Click Button in top left to spawn your ships
3. The enemy bomber must have more than one bomb on screen(fires every 1.5 seconds when one of your ships is in the line of fire)
4. When any bomb should spawn an explosion animation, it spawns an explosion animation on every instance of the bomb.
#4 occurs only when the action to spawn the explosion animation is within the same function that checks AoE damage. When placed individually in both the conditions that should produce it, it works fine. I assume the function is receiving all instances of the bomb instead of just the one affected in the calling event.
I have not tested the rest of my AoE function enough, it could be checking for damage around every instance of the bomb as well.
Observed result:
When any bomb either collides or reaches the maximum distance, an explosion animation is spawned on all instances of the bomb.
Expected result:
When a bomb either collides with one of your ships or reaches its maximum distance it should spawn an explosion animation on itself.
Browsers affected:
Only tested with Chrome.
Operating system & service pack:
Windows 7, SP1
Construct 2 version:
120.2(64 bit)