playMaker

Author Topic: Play Maker / 2D Toolkit Sprite Action  (Read 2733 times)

Saputo

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Play Maker / 2D Toolkit Sprite Action
« on: February 01, 2013, 11:20:28 AM »
Hi I'm using 2D Toolkit to do all my animations, Iv come to a Point while coding with Play Maker I can't seem to figure out how to make an if or else statement(if I'm saying the right thing here) I have many images I'm using, and I have my Char, Idle which faced to the right, and another that is Idle but faces to the Left,along Movements right and left, but I cant seem to figure out how to make my char, turn to the left, when I hit the A Key(I have it set to) when I hit D he plays the animation to move Right then goes back to his facing Right Idle Stance,but I want to be able to hit the A Button and make him play the Walking Left animation,and then when I let go of the A Button go into the Idle facing left animation,but I cant seem to to find a way to do this.

If this Helps, I'm making a Fighting Game, so when ur on the right side of the screen ur char turns and faces left, and all the moves he had can be used but faceing the left now, is what i'm trying to do.

Thank You

                                            Saputo

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14035
  • Official Playmaker Support
    • View Profile
Re: Play Maker / 2D Toolkit Sprite Action
« Reply #1 on: February 08, 2013, 12:44:35 AM »
Hi,

 I think you need to start with watching as much videos and screencasts you can even if the actual game or topic is not directly of interest, you will learn the various design pattern you need to apply in your cases.

 and IF ELSE statement in fsm is achieved very easily:

Create two events "YES" and "NO"

in your start state, add them two events as transitions. Have them two transition go to other states.

in your start state, now you can add actions to will fire event based on their purpose ( for example comparing a float, or watching user inputs), if one of the action fires a "YES" event, then that state will transit ( as if the IF statement was resolved as true), another action could be sending the "NO" event.

now, if you have more subtle transition as "DO THIS", "DO THAT", "DO SOMETHING ELSE", and yet you want final else statement, you simply simple add a "FINISH" transition ( "FINISH" transitions event are built in, don't create a "FINISH" event yourself, it's already there).

does that make sense? basically, FSM is all purely about visual if and case statements...

bye,

 Jean

Saputo

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: Play Maker / 2D Toolkit Sprite Action(Solved)
« Reply #2 on: February 09, 2013, 09:03:29 AM »
Sorry, got so caught up with making my game, i forgot to say I figured it out, I didn't have the 2D toolkit custom actions dled I felt so dumb. Problem I'm having now is Moving the char, on a Zelda SNES Version style View, I set the Gravity to 0.0.1 but then he wont move at all, and if I take out the Gravity he just fall straight down. any ideas?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14035
  • Official Playmaker Support
    • View Profile
Re: Play Maker / 2D Toolkit Sprite Action
« Reply #3 on: February 09, 2013, 11:48:52 AM »
Hi,

 Make sure that in your scene ( when not running), your character is no overlapping with the ground, put him slightly higher so that its collider is definitly in contact, this is likely the reason. Else when you start the character is already in the ground and falls.

bye,

 Jean

Saputo

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: Play Maker / 2D Toolkit Sprite Action
« Reply #4 on: February 09, 2013, 12:39:34 PM »
He no longer falls down, he just wont move and idk y I followed the you tube tut the playmaker team made