Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PSHPlayerStateMachine
- {
- global _char = "images/player_char";
- function _stand2run(c){ return abs( c.velocityX ) > 4; }
- function init(c)
- {
- return "stand";
- }
- function stand(c)
- {
- c.PlayAnim( "stand", true );
- if( this._stand2run(c) ) return "run";
- }
- function run(c)
- {
- c.PlayAnim( "run", true, 0, abs( c.velocityX ) / 200 );
- if( !this._stand2run(c) ) return "stand";
- }
- }
- class PSHPlayerCharacter : PSHCharacter
- {
- global CharInfoAndStates = PSHPlayerStateMachine;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement