angrybagel's Recent Forum Activity

  • 1. Thank you, you were right indeed! I had a set size for the ball objects that was interfering, reworked it and now the shake works perfectly.

    2. Great, I will use that for now and see if I need to make changes later when I'll randomly spawn multiple instances of ball objects of the same size.

    Back to work, have a great day dop2000

  • Wishlisted, looks like a great game!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi dop2000, thanks a lot for your reply.

    1. I will remember to avoid trigger once from now on, thanks for the tip. I thought it was safe to use it as a sub-event while the main event was true. Anyways, I switched to on collision and set it as follows but the issue remains exactly the same, the last three lines of code that create a short shake effect on the Ball only work when there's one instance of Ball on the screen, but if there are two or more it stops working until all instances are destroyed and only one instance remains:

    2. All my objects already have an instance variable for their health and it works, but what I was asking is about storing the initial value of each instance, sorry it wasn't very clear. I did a little diagram of how I would like it to work:

    Currently since I'm testing, I assign the initial health to a static local variable (set parentHealth to Ball.health) that I can reuse when a new ball spawns. This works now but when there will be multiple instances of the Ball object it will be tricky so I was wondering what would be the best option to store and access this data dynamically.

    Maybe I can share the project if you want to take a look?

  • 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!

angrybagel's avatar

angrybagel

Member since 17 Jan, 2023

None one is following angrybagel yet!

Trophy Case

  • 1-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • RTFM Read the fabulous manual
  • Email Verified

Progress

4/44
How to earn trophies