move to

He guys,

I'm making a game like subway surfers (when you swipe it go to the other row)

But if I use the move to attribute, it won't work.

Somebody knows how I can make the gameplay like that??

Thanks!

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2015

    @PRRP games said:
    But if I use the move to attribute, it won't work.

    Why not? What happens when you try it? What does your rule look like? What happens if you just have a MoveTo behavior by itself and not part of a rule? Does it do anything?

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

  • PRRP gamesPRRP games Member Posts: 27

    rules of my main character:

    Rule:

    key: if left is down

    do: move to: self.position.x-110 ; self.position.y

    Rule:

    key: if right is down

    do: move to: self.position.x+110 ; self.position.y

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @tatiang said:
    Why not? What happens when you try it?

    And does it make a difference if you hold down an arrow key for some time (e.g. 2 seconds) rather than just pressing and releasing it?

    What happens if you just have a MoveTo behavior by itself and not part of a rule? Does it do anything?

    Do you have the MoveTo behavior set to relative to actor or relative to scene? Make sure it's set to scene.

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

  • PRRP gamesPRRP games Member Posts: 27

    if I hold it for a longer time it works fine. So can I set a minimum, so my actor will move at least 110 and 110 at max?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @PRRP games said:
    if I hold it for a longer time it works fine. So can I set a minimum, so my actor will move at least 110 and 110 at max?

    At least 110 and 110 at max? Wouldn't that be exactly 110?

    We're six posts in and I still don't know any more than "it won't work." I'd need more details and I'd need to know the answers to the questions I asked above in order to help you out.

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

  • PRRP gamesPRRP games Member Posts: 27

    I don't think i worked it out on the right way, so i only want to know how i can make this:

    Picture:

    imagephoto plaatjevraag5_zpsed5f622e.png" alt="" title="" />

    When I press/swipe to the left, it wil move to that exact point (blue square on the left)
    When I press/swipe to the right, it wil move to that exact point (blue square on the right)

    I know you're asking me to show my rules, attributes etc. so you can solve it, but I think i can better start all over.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2015

    Start by Googling swipe gamesalad. There are many tutorials and videos available.

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

  • PRRP gamesPRRP games Member Posts: 27

    Ok, I did that

  • PRRP gamesPRRP games Member Posts: 27

    I used this tutorial and i worked everthing out as i wanted. how can i set a maximum per slide. so it wont go to far?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Upload a screenshot of your Move To rule or however you created the movement and then post the link here. It will depend on how you've set it up.

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

  • PRRP gamesPRRP games Member Posts: 27

    Photo 1:
    imagephoto vraag6_zps0a8acb3a.jpg" alt="" title="" />

    Photo 2:
    photo vraag7_zps4c45ca19.jpg

    Photo 3:
    imagephoto vraag8_zps5c105929.png" alt="" title="" />

    So my rules are (to make it more clear):

    Rule:

    Mouse is 'up'

    do:

    rule:

    if game.right > 50

    do:

    change velocity

    rule:

    if game.left > 50

    do:

    change velocity

    Rule

    mouse is 'down'

    do:

    change game.left to 0

    change game.right to 0

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Change Velocity is not the best choice of behaviors for moving a set distance. It may have been the way that the video suggested but you're going to have a very difficult time getting a freely-moving actor to stop at exactly a certain pixel. There are ways to "snap to grid" but I recommend instead that you review this thread which deals with the same question:

    http://forums.gamesalad.com/discussion/76369/stopping-an-actor/p1

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

  • PRRP gamesPRRP games Member Posts: 27

    I Read the treath but i can't get the good information out of it.
    I am trying to make a grid now for a couple of days, so can somebody say how to make a simple grid, just so i know how a grid works. I made a new project with just a player and a raster, the player can only move left en right when key left and key right are pressed.
    I want to make it stop at a certain postition and let it move further when you press the left/right button again.

    Hopeley somebody has some cleare and simple instructions :#

Sign In or Register to comment.