Arc/Jump Movement

NMansellNMansell Member Posts: 143
edited November -1 in Working with GS (Mac)
I have an actor that moves 100 pixels to the left or right. But I want to make this a jump, so have got the actor jump images done and it animates all ok. But how do I make it look like the actor is jumping by means of a half circle/arc when he jumps?

Thanks.

Comments

  • NMansellNMansell Member Posts: 143
    anyone please?
  • NMansellNMansell Member Posts: 143
    I really need to get this sorted if possible. I have tried many options such as constraint attribute, etc but can't get it working. please help!!!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Perhaps you could use a parabola to describe the ark? As in:
    y=x^2
  • NMansellNMansell Member Posts: 143
    right i have managed to use an image that jumps the actor so all i have to do is move the actor on the screen and viola - it looks like an animated jump.

    I have one other problem though - i have a MOVE TO rule that moves the actor 190 pixels and -190 pixels (left and right). But the ANIMATE rule I have inside this only works when I press the cotrol on screen, I want to make the actor move the full Animated way left or right when the player hits the controller (L/R side of screen) - any suggestions to make the actor move after this key is pressed and ANIMATE. At the moment it moves but the animation only works if the player holds down the TOUCH control.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Perhaps you can check to the see what the linear velocity is.

    when self.Motion.Linear Velocity.X > 0
    animate right

    when self.Motion.Linear Velocity.X <0
    animate left
  • NMansellNMansell Member Posts: 143
    nope that didnt work - basically my RIGHT button has a rule that sets the playermotion to 2 for right. (1 for left, 0 for standing still, etc)

    Then under the Actor (Player) it looks for what the playermotion is set to and moves in the appropriate direction. It animates then moves to a position (+190 pixels).
    It moves fine but the animation ONLY works when I hold down the touch of the right button - how can I change this to move right (or left) a set way and animated regardless of holding the button down (clicking only once) - Am I ok in using TOUCH rather than MOUSE BUTTON?
  • NMansellNMansell Member Posts: 143
    bascially how do i set it so the playermotion is set to 2 and stays at 2 rather than just when the button is pressed DOWN.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    OK -- how are you setting the attribute "playermotion". Is it being constrained only when touched? Or is it done with a change attribute rule? Or what?

    And you might want to check to see if "playermotion" is getting set back to 0 somewhere. That might be the culprit.
  • NMansellNMansell Member Posts: 143
    it sets it to '2' upon touch rule. I assumed this would stay 2 until it changes though?

    How can I do it so it moves xxx pixels without stopping and also animated by pressing the touch button left/right, etc
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Is "playermotion" a global (game level) attribute?

    For debugging purposes, how about placing a display text behavior into the "player" actor. Then use the expression editor to show the value of "playermotion". That way, when you test things, you can see just when (and perhaps why) it is being set to something different than you expect.
  • NMansellNMansell Member Posts: 143
    good idea, and it shows that it auto switches back to '0' after i release the key/touch.

    it is a game attribute as well, should this be an actor attribute?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    playermotion should probably remain a game attribute. Are there any other rules (or anything in an 'otherwise' part of a rule) that could be setting it back to 0?

    How about setting playermotion to 2 when touch release?
Sign In or Register to comment.