playMaker

Author Topic: Character Grid Movement [solved]  (Read 2909 times)

acott

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Character Grid Movement [solved]
« on: February 05, 2013, 11:42:13 AM »
Hey, I'm new to the forums and PlayMaker. I've started a puzzler but I'm having trouble
with the movement, The game is based on a grid system (see attached, its in early stages) and I would like the
character to move from square to square with one touch of the key. Presently the w,a,s,d keys
have to be held down while the character moves slowly. I have attached a picture of my setup for this.

As far as I'm aware the iTween Move by function would be suitable as used by Marcos in tumble the turtle, but how would I achieve this?

Any help would be greatly appreciated  :)


« Last Edit: February 07, 2013, 03:55:03 PM by acott »

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • View Profile
    • Rage Quit Games - Coming Soon
Re: Character Grid Movement
« Reply #1 on: February 06, 2013, 02:36:06 PM »
Try having a trigger over each square, when a trigger is entered it sends an event to a 'movement' FSM which only allows for certain movements. Each time a different trigger is entered, different movements are available.

So you would have two FSM, one that handles the triggers and one that handles what movment is available dependent on the position.

I hope that makes some sense.
« Last Edit: February 06, 2013, 02:46:57 PM by MrMitch »

acott

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Character Grid Movement
« Reply #2 on: February 07, 2013, 09:14:53 AM »
Hey MrMitch, Thanks very much for your reply. I get what you're saying but its not quite what I'm after. I need the user to press the left arrow and instead of the character moving slowly left, I need it to say shift 50 pixels / units to the left and if the up key was pressed then for it to shift 50 pixels / units forward and so on, really like multiplying the movement so its not slow.

I hope this makes more sense, thanks again for your help

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • my twitter @andrewlukasik
Re: Character Grid Movement _ exampl FSM boxxy moving by steps.unitypackage
« Reply #3 on: February 07, 2013, 10:18:53 AM »
Quote
I need the user to press the left arrow and instead of the character moving slowly left, I need it to say shift 50 pixels / units to the left and if the up key was pressed then for it to shift 50 pixels / units forward and so on
Like this?
(attachment)

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Character Grid Movement
« Reply #4 on: February 07, 2013, 10:27:09 AM »
http://www.hutonggames.com/tutorials_ios_fundamentals.php

one of the later ones should tell you exactly what you need, all you would have to do is substitute touch control with button input, think around vid 11 will get you going, I strongly suggest watching all videos, as you can see even though this is an iOS tutorial they can be useful for multiple different scenarios.

acott

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Character Grid Movement _ exampl FSM boxxy moving by steps.unitypackage
« Reply #5 on: February 07, 2013, 03:54:25 PM »
Quote
I need the user to press the left arrow and instead of the character moving slowly left, I need it to say shift 50 pixels / units to the left and if the up key was pressed then for it to shift 50 pixels / units forward and so on
Like this?
(attachment)

You sir are a saviour! Thank you, this is exactly what I needed!

Thank you Sjones, i'm going to need these tuts when it comes to getting the game working on a phone

acott

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Character Grid Movement [solved]
« Reply #6 on: February 07, 2013, 04:26:40 PM »
Just a quick question, any reason why a collider wouldn't work on the example you put together?

acott

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Character Grid Movement [solved]
« Reply #7 on: February 07, 2013, 04:32:31 PM »
Sorry I fixed it! Thanks again  ;D