Problem with animation changing

  • Hi guys!

    So, I'm having a problem with changing animations of 2 sprites in my project.

    I have this upgrades menu in my game:

    When an upgrade is bought, the idea is for the lines under the upgrade name to be filled, one each level. This is done by changing the sprite's animation. The thing is, only 2 of them are working, while the other 2 are not! And the events for them all are virtually the same!

    Here's the events for the upgrades:

    AS you can see, they are basically the same! Yet, one is working (the right one) and the other not (the left one).

    Any thoughts?

  • I think the problem comes from where you increase the level of upgrading.

    It is not increased so the action won't execute.

  • Hi Maverick1912, I already checked with the debug layout, and the variable is increasing. Also, if the variable didn't increase, the upgrade price wouldn't change either, and it is changing (starting price is 250, then 500, then 750 and only then 1000, as it is in the screenshot). Also, even with the animation doesn't changing, everything else works fine. The upgrades do take effect in the game. The only thing not working is the animation :(

  • Could you share your c3p file please?

  • Maverick1912 Sure. Here it is.

    https://drive.google.com/drive/folders/15RvNpeaZzh4AHsZvXB7Ix_fXKlCaLrDM

    P.S: btw, it is my first ever game project, on any engine. So don't mind anything dumb you see on the project xD

    andreluizgollo The Link you shared its Looked needs your permission, make sure that the folder its public so anyone can access to it

  • andreluizgollo

    Group "Slow Time Upgrade Levels" On Event 93 is the one causing the problem all your events inside this Group are referencing to "biggergaps_upgrades" for changing animation instead of referencing "slowtime_upgrades" Animation.

    Another thing is that these events runt every thick

    -Bigger Gaps Upgrade Levels

    -God Mode Upgrade Levels

    -Slow Time Upgrade Levels

    -Spawn Chance Upgrade Levels

    you should put them under the Triggers that you have on Group "Upgrades Menu Buttons"

    Example On Touch on "biggergaps_buy"

    Total coins is bigger than biggergap_Price

    Bigger_gaps upgrade < 7 >>>>>>>>>>>>>>>>>>>>>>>>>>>>All your Actions here that you already have plus the ones from goup "Bigger Gaps Upgrade Levels"

    And do the same for all the Group Upgrades

    ============================================

    And I would recomend you for the Next Time to not share your whole Project because it can get stolen mate, when they ask you for a Capx project try to remove everything that you can and just leave the code related to the problem just with minimum capx enough to replicate the problem.

    Another benefit of doing this is that while you deleting or recreating a minimum capx most of the Time you will find the error before you post it

    And finally, I would like to say for your first project you did a great job mate keep it up, the graphics look great too, one thing I see you can do quite a lot of optimisation Though, good luck with it

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tarek2 Jeeez, how didn't I see this! I must've copied the first code (biggergaps) to make the other 3, and then missed to change on the slowtime. Feeling dumb right now hahaha xD

    I will try that, to move those events to the triggers. And thanks for the tips regarding sharing the files, I'll remember that next time.

    I'm really happy with the results I'm getting, considering it is my first project. I'm really happy with the graphics, too! If you ever feel like chatting or giving some tips, we can do it on some other platform. ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)