Hi everyone, I recently joined the Construct family and I'm quite new to coding and gamedev, but super motivated. I'm currently trying to hone my skills by trying to recreate the logic of the mobile game Ball Blast. I have two questions and was hoping someone from the community could help me:
1. In my code I have the following:
The first part of the code works fine, but the the three last lines that make the balls shake every time a bullet hits only work when there's one instance of a ball live on the screen. If there are two or more, it stops working. The damage and health display work perfectly fine. I tried a lot of different ways but can't seem to make it work.
2. Do you have any tips regarding how to store the value of the initial health for each ball? For example, the first ball spawns with 20 health, then when it's destroyed it splits into 2 different balls, each with half the previous health value (two medium balls with 10 health) and so on.
Currently, I store the health of my test instance in a static group variable called patentHealth, then when the health is less than 1, I spawn two balls at the destroyed position and assign parentHealth / 2 to each ball, and so on until the smallest ball is destroyed. It works for testing purpose, but when there will be many instances of the balls this isn't going to work. Should I use arrays?
I hope my explanations are clear, I'm not used to ask gamedev/coding question so please let me know if you need more info. Thank you!