dankhan's Forum Posts

  • Thanks for that, I did figure out how to rotate the object finally but now need to figure out how to rotate back to default position (facing up) when not going left or right.

    How would you add "if X didn't change"?

    Thanks,

    Dan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's ok I figured it out. I tried "Every tick set lastx to Enemy.X" but that wasn't allowing the object to rotate so instead I set "Every tick" to "Every 0.5 secs" and the object is rotating as it should. Now the challenge is to get it to rotate back to default position when not moving left or right.

    Thanks for your help guys.

    Dan

  • Thanks for the response guys, Oosyrag, I tried your method, how would I store last x position in the instance variable "LastX"?

    I've tried Enemy X=0      set LastX to Enemy.X

    It rotates right but then it doesn't rotate back or left when moving left.

    I setup the rotation as follows:

    Every tick                     Rotate 1 degrees towards 20

    Enemy LastX < Enemy.X

    Every tick                     Rotate 1 degrees towards -20

    Enemy - LastX > Enemy.X

    Thanks,

    Dan

  • Hi Matt, it's a non player sprite, basically a sprite following a path.

    Thanks,

    Dan

  • Hey guys, love Construct 2, hats of to the creators for doing an absolutely amazing job, making it easier for us to make games.

    I need slight help with pathfinding. Here's what I'm trying to do.

    When following a path, when moving left the object should rotate left 20 degrees and and moving right the object should rotate right 20 degrees.

    It should not rotate fully and should face upwards when moving up or moving down.

    Does that make sense?

    Would love some help on this.

    Thanks,

    Dan