guannstar's Forum Posts

  • Thanks LittleStain, I'll try that and see if it works.

  • Bump.

  • Hello all! Okay, so I tried something different with my code and I made it so that LifeHearts (my "lives left" tiled object) is controlled by a global var instead of an instance var. This time, the adding and subtracting of the width works fine, when you beat a level it perfectly adds 24 pixels (adds a heart) and it shows up on the next level/layout as it should. The problem is that when I lose the level and restart it, my LifeHearts (the hearts/lives left) object will not show up again on level. It seems like my LifeHearts object is being told to disappear somehow even though I made it so that, every tick, LifeHearts will remain visible. Why is this happening... I mean, why does my LifeHeart tiled object just disappear, but only when I lose/have to restart a level?

    Here's my code:

    Thanks,

    guannstar

  • So, how would I make it so that when all of level 2's enemies are killed --> add 1? My enemies are grouped in families, but the problem was/is, instead of adding 1 heart when all of the level's enemies have been destroyed, it would add 1 heart every time I destroyed a single enemy on the level. So, if I changed the "enemy2health<0 event" with "familyEnemies2<0", how would I make it so that only when it destroy all enemies on the level will it add 1 heart, rather than adding 1 every time a single enemy is destroyed?

  • OK, I did what you said, but it's still not working. This time, it works fine on level one, but on level two and on all of the other nine levels, the hearts just ignore their commands and displays way more hearts than it's supposed to. For example, on level two, it should show only two hearts, but instead, it shows this:

    Do I have to use a global variable or something?

  • Sorry, I just want to make it clear, I should completely delete those lines of code? Not just replace "Set width to..." with "Set width to lifeHeartTiled.varlifeHearts*24", like I did below?

  • Regarding the highlighted lines of code directly above, should I replace, "Set width to ..." with "Set width to lifeHeartTiled.varlifeHearts*24"? Or, just delete them entirely?

  • Hey LittleStain, lol yeah, now I get it. So, I'll delete the "set width to 0, etc." pieces of code, but should I also delete these pieces of code as well (are they also redundant)?

  • Hey LittleStain, I did what you said, but should I also delete the highlighted part below (lifeHeartTiled - varlifeHearts = 1 ---> Set width to 24, etc.)? Should I delete all of those lines of code as well?

  • Bump. Please, I really need some help.

  • Bump.

  • Can somebody please show me a little tutorial/capx which shows exactly how to do this (I'm seriously going crazy over here trying to figure this thing out lol)? It seems like this problem should be soo easy to fix, I don't get it.

  • Hey LittleStain, I'll add the "trigger once while true" conditions, but I don't get why I have to delete everything involving all other enemies and levels, and just leave the code involving the the first enemy and level one? Why would I do that (I don't get it)? Could you please explain what you mean?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bump.

  • Hey OddConfection, I tried what you said, but it's still not working for some crazy reason:( What did I do it wrong?