playMaker

Author Topic: 2d platformer controller questions  (Read 1469 times)

frogstar

  • Playmaker Newbie
  • *
  • Posts: 1
2d platformer controller questions
« on: September 29, 2015, 05:24:34 PM »
Im an artist.. and code scares me.... just to get that out of the way...

Im looking to make a controller for a cricket...... but not sure how to handle things like ability to walk upside down onto branches for example...  Also things like swimming and diving underwater... and being able to stick..

I suppose what Im wondering is would this all happen in one big FSM?....





Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: 2d platformer controller questions
« Reply #1 on: September 30, 2015, 07:20:37 AM »
Yes you can do it in one FSM if necessary, but example the jump is much better if separated.

Example for the jump:
state 1
- If key down or any other user or ai input

state 2
- jump with physics based object you need to add force, or if not you can use transform translate up for x time
- if detect if the object touch the ground again (to avoid jump again in the air)
it can be raycast, if hit something under the object or collision enter with ground

For the walk, also can use physics (add force) or non physics (translate)

and the swimming can still use these just not need to hit the ground before move up (swim up) and maybe move up with less power than jump