R0J0hound's Forum Posts

  • I'm probably just explaining it poorly. Here's an example of it if it helps.

    https://dl.dropboxusercontent.com/u/542 ... ottom.capx

  • A full rotation is 360 so you could just add 360 to degreesToMove multiple times.

  • The actions are a set position and set size action using the equations I linked to. I'll have to defer to someone else for further discussion or perhaps alternate solutions.

  • "within 60 of 30" would mean 330 to 90, or 60 degrees in each direction from 30. So it probably is easier for you to just use the "is between angles" condition instead.

    I don't understand your last question. The equation is:

    speed = sqrt(2*deceleration*degreesToMove)

    It calculates the speed needed so when using a certain deceleration it will stop after rotating degreesToMove degrees. The speed will be higher for higher values of deceleration and degreesToMove.

  • Only "scale" is used in the set height expression. It's actually the same as if you squished the height with it scaled around the origin. The only thing that changes when you scale from a different point is the object needs to be moved.

  • Off the top my head there is the audio analyzer example bundled with C2. It works with sounds you play from your game. To use it with you mic add the userMedia object to access it, and it then is tied in with the audio plugin. line out/line in aren't accessible as far as I know.

  • adcornaglia

    That bit is already implemented in C2.

  • A global variable would be the easiest. You can get the name from the player with a Textbox object, and then set the global from that. So say you call the global variable "hero", you can then build the text the npc says with an expression like:

    "hey " & hero & " how are you?"

    hero & " , can you get me this stuff?"

    The key thing is "&", which combines values together as text.

  • Using the expressions:

    Sprite.ImagePointX(point)

    Sprite.ImagePointY(point)

    Replace "point" with either the index of the of the image point like 0 for the origin, 1 for the first image point, 2 for the second,... and so on.

    ...or you can use the name of the image point.

  • It's true, events are run top to bottom. However triggers (they have a green arrow to the left) are only run when they are triggered, but if there is more than one of the same trigger they are run top to bottom. Basically you could move the triggers around and the game will run the same as long as they have the same order. "on collision" and the gampad triggers are the exceptions. They are not real triggers, and are run in order with everything else in the event sheet.

  • Braus

    Sure, why not? In the capx it calculates the initial speed so it rotates n degrees. It's done when the speed is >= to 0.

    So you'd either figure out the number of degrees from any position to any other, or find a formula that can do that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One way to do that path exactly could be:

    https://dl.dropboxusercontent.com/u/542 ... ollow.capx

    It could be made to move at a constant speed by splitting the curve up into lots of lines and make the time to move on each line proportionate to it's length.

    There are other solutions too:

    search.php?keywords=follow+path&terms=all&author=&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

  • Try it. The math will make it scale from (centerx, centery) regardless where the origin on the sprite is.

  • You probably just want the spinner to slow down and when it stops just check if the angle is close to one of those.

    For example here is an example if there are four values on the wheel:

    +-----------------+
    | mouse: on click | spinner: set speed to random(100, 400)
    +-----------------+
    
    +------------------+
    | spinner: speed>0 | spinner: subtract 100*dt from speed
    |                  | spinner: rotate self.speed*dt degrees clockwise
    +------------------+
    
    +------------------+
    | spinner: speed<0 | spinner: speed set speed to 0
    +------------------+
       +---------------------------------------+
       | spinner: angle is 45 degrees from 0   | add 10 to score
       +---------------------------------------+
       +---------------------------------------+
       | spinner: angle is 45 degrees from 90  | add 50 to score
       +---------------------------------------+
       +---------------------------------------+
       | spinner: angle is 45 degrees from 180 | add 1337 to score
       +---------------------------------------+
       +---------------------------------------+
       | spinner: angle is 45 degrees from 270 | add 123456789 to score
       +---------------------------------------+[/code:3y93chdi]
    
    So in other words it's not necessary to know where it will stop beforehand, you just check the angle when it stops.  There I checked the angle with the "is within angle" condition but the "is between angles" could be used too.
    
    And in relation to your questions about my capx above:
    To make it start with more speed just set the start speed higher in the click event.
    The spinner is stopped when the speed is less than or equal to 0.
    It's not zero because we can only calculate speed per frame, and seldom will the speed end on 0 at exactly the frame time, so it overshoots slightly.
  • #3

    This can already be done by making the object global.