GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 Posts: 11,766Member, Sous Chef, PRO, Senior Sous-Chef
    "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 Posts: 164Member, PRO
    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 Posts: 55Member, PRO
    Thanks! It worked. Thats what I was looking for!
Sign In or Register to comment.