TheDoctor's Recent Forum Activity

  • Give the sprite the "rotate" behavior(Disable at initial, set the speed you want)

    and a instance variable(let's call it 'anglePrev')

    Your condition > anglePrev = sprite.angle / Enable rotate

    Sprite.angle=anglePrev+90, Trigger Once > Disable rotate

    I don't see where you disable the rotation behavior.

  • Yeah you can run a loop if conditions are made, but what you are trying to do, is not possible the way you want to do it. Because a loop is not based on the time scale you are aiming for. To make what you are trying to do work, you would need to know how fast the loop is executed, as I understand you. Which would be near impossible to figure out as I see it.

    According to the manual,

    Wait

    Wait a number of seconds before continuing on to the next action or sub-events.

    So, my thinking is that when it reaches my "Wait" it will "Wait a number of seconds before continuing on to the next action or sub-events." This is what it does outside of a condition, but inside not so.

  • Uhm, that works, but it doesn't answer my question...unless you are trying to say "NO, you can not use a loop inside of a condition being met."

    Thanks though for giving me a way to do it, but I am really trying to understand using loops like REPEAT. Like I said, I can get them to work PERFECTLY outside of a condition being met, but once I put it inside a condition being met it does not work.

    Can anyone answer my question?????

  • And remove the wait and move the rotate up, and type 90/60 as how much it should rotate, it will make it rotate 90 degree every 1 sec.

    "Every tick"

    Rotate object 90/60 degree.

    That's wonderful if I want to do something "Every Tick". I don't want to do it every tick, I want to do it only 90 times and USING A LOOP INSIDE OF A CONDITION BEING MET. That is the topic of my entire post. I want to know how to structure it.

    I am basically asking everyone "Can a loop be executed inside of a condition being met?"

    I don't want to use a behavior, I don't want to call a function (tried both of those still couldn't). I simply want to know how to structure a loop that fires off only once a condition is met.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It will use the ticks iteration of 60 automatically.

    What you can do is add a Boolean variable to the objects that you need to rotate, called "Rotating"

    In the event that rotate.

    Object.Rotating true

    Object.rotate clockwise = 90 / 60

    And then you set it to false again when its done rotating.

    Oh boy, do you have an example of that? What you say works fine outside of a condition being met, but not inside. I simple want to see one loop that works inside a condition being met.

    For example, see my code picture above? Can you make that work by making a simple change?

  • You have two actions for rotating objects.

    Rotate Clockwise

    Rotate Counter-clockwise

    They are under the Angle section in the action menu.

    And neither one of them has a number of iterations. That code will only move once. Only move a fraction of the full 90 degrees.

  • This works while the condition (Mouse On any Click) is Toggled to Disabled.

    Once I Toggle the condition to Enabled (not crossed through) it only moves 1 time not 90.

    What am I doing wrong here?

  • Since C2 runs 60 ticks every second. You have to divide the amount of degree you want to rotate every second with that. You don't need a loop you can just do it every tick.

    Action:

    Rotate <Something> clockwise = 90 / 60

    Will rotate it 90 degree every 1 second.

    Rotate <Something> clockwise = 180 / 60

    Will rotate it 180 degree every 1 second etc.

    I fail to see how you implement on the event sheet....I do not see a corresponding action for that.

  • I am trying to rotate my player 1 degree counterclockwise 90 times with a fraction of a second inbetween rotations when a condition is met. I want the user to see the player on the screen actually rotate not just jump to 90 degrees.

    I've read the manual about loops, I just can't get it to loop 90 times inside when a condition is met. Outside of a condition, no problem. I can't find a tutorial either.

    This is becoming a real headache.

  • Anyone know what the "OPT-OUT" when putting games on Google Playstore is all about?

  • I tried it on my Galaxy tablet and it worked fine.

    My tablet for some reason has given me an error message when the background was bigger than 2024x2024, so you might want to keep that in mind.

    Thanks for the info!

  • Are you using a Behavior to accomplish this? If so, set the object's Rotation to "no". Sorry that's all I can say without seeing code.

TheDoctor's avatar

TheDoctor

Member since 21 Feb, 2014

None one is following TheDoctor yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies