ramones's Forum Posts

  • Check your other events that change the animation to make sure they aren't running when the Cowbad is dead. Event 9 or 10 could be setting the animation back to default. You could add a condition there to check that health > 0.

  • When the health gets to 0 or less then that event will be running every tick and it keeps restarting the animation. You should add a 'System: Trigger once' condition to that event so that it only runs one time.

  • You have two JSON objects. You're loading the data into one of them but trying to read it from another

  • Did you install the JSON plugin that CrazyVulcan linked to? You can use the LoadJSON action of the JSON plugin to load in AJAX.LastData. Then the expression JSON.Value(0, "19141338") will return "vagrant8".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's my attempt: fallingLeaf.capx (r216)

  • Maybe the window is opening off screen. Try Preferences > Reset dialogs.

  • It looks okay to me in Firefox. I know you said you cleared the cache but make sure you clear 'Offline Website Data' as well. Or just check in private browsing mode to see if caching is the problem.

  • You can also use Array.CurValue instead of Array.At(Array.CurX).

  • Breadth-first search. Starting at some cell like (6,4) you mark it as checked* and add it's neighbours to a queue. While the queue is not empty you take the first cell from the front of the queue and check if it's 0. If it is you are done. If not you mark it as checked and add it's unchecked neighbours to the end of the queue. Repeat until you find a 0 or the queue is empty.

    * using a second array or the z-axis

  • Are you using floor() or int() on the random number to round it down? Because random() on it's own could give you a value like 2.235324636456.

    Another way is to put all the enemies into a family and then "System: Create FamilyName" will create a random one.

  • How about setting the body font-size?

  • You don't want to use trigger once in a loop or function. Trigger once makes the event only run if it didn't run last tick. If you use it in an event that runs more than once in the same tick then it has weird results.

    Say you start pressing D and right together on tick count 10. The function is called for the first player. It checks if that last tick that the trigger once ran was tick count 9 and if not then the event runs and it updates the last tick count to the current tick count (= 10).

    Then the function is called again for the next player. Again it checks if this event last ran on tick count 9 which it didn't because it last ran on tick count 10 and so it runs for the second player as well. So on tick count 10 you press D and right and both players move to the right.

    On the next tick (tick count 11), the function is called for the first player and it checks if the last tick count was 10, which it was, so it doesn't run again for player 1 and player 1 doesn't move. The last tick count is updated to 11. Then the function is called for player 2 and it checks if the last tick count was 10, which it isn't any more so the event runs and player 2 moves to the right.

    And so on. Player 1 moves to the right only on the first tick and player 2 keeps moving every tick which is the behaviour that you see.

  • If x is less than the lower bound it returns the lower bound, if it's higher than the upper bound then it returns the upper bound and if x is between lower and upper it returns x.

    Say you wanted to keep the player health between 0 and 100. You could set

    playerHealth = clamp(playerHealth + x, 0, 100)[/code:32whohz9]
    where x is could be +50 for a health kit or -25 for an enemy attack and the result will always be between 0 and 100. If playerHealth + x goes above 100 then playerHealth gets set to 100. If it goes below 0 then playerHealth gets set to 0.
  • Make the boxes visible so you can see what's happening with them. It looks like maybe the blue PlayerBox has the platform and scrollTo behaviors on it so it could be moving along in front of the raptor and then falling down.

  • You can disable the default controls on 8direction and set up your own in events.

    Right arrow key is down -> Simulate pressing right etc...

    Then you can add whatever conditions you want. For example: give the player an AllowedToMoveRight boolean and you can have the conditions:

    Keyboard: Right arrow key is down

    Player: Is AllowedToMoveRight -> Player: Simulate pressing right

    Then you can toggle that boolean to prevent walking in that direction.