Help With Actor Movement

So I am working on a game where the actor needs to "jump" from square to square. When I have the arrow key pressed, it just moves continuously (how most actors move when using a change velocity/accelerate attribute). I need it to almost "Teleport" to the next square. The way I have it now is (When game.attribute.right is true, move self.x. to self.x.+10) but it still just moves continuously rather than "jumping". Is there any "change position" attribute? Any suggestions?
Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    "Almost" teleport or completely teleport? There's a difference in terms of how you code it. To make it switch places, use Change Attribute self.Position.X to self.Position.X+10.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • slowcutslowcut Member, PRO Posts: 164
    You can to interpolate the positions with the 'interpolate' behavior. And you have to make sure, that your action will only be triggered once. In your logic, the position will change as long as the game.attribute.right is true.
  • elementappdevelementappdev Member, PRO Posts: 55
    Thanks! It worked. Thats what I was looking for!
Sign In or Register to comment.