ramones's Recent Forum Activity

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

  • With a function:

    minNonZero.capx (r212)

  • That's the problem with floating point numbers...

    https://www.youtube.com/watch?t=68&v=PZRI1IfStY0

  • Add the timer behavior to the resume button (or any object) and when you set the global time scale to 0 you can set the timer object's time scale to 1 so that the timer can still run. Then you can use that timer to resume after 5 seconds.

  • In event 9, when you pick the correct pelvis and set it's position you need to refer to either the object or the family in both the condition and action. You can't mix them.

    You can have pick pelvis -> set pelvis position or pick character -> set character position but you can't have pick character -> set pelvis position. In that case you're setting the position of all pelvis objects not just the ones picked by the family condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The debugger shows arrays like this:

    2x2x2 array:

    x    y, z, y, z
    x    y, z, y, z
    [/code:1p6bkfsw]
ramones's avatar

ramones

Member since 17 Apr, 2012

Twitter
ramones has 4 followers

Trophy Case

  • 12-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

15/44
How to earn trophies