You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
335 B

import { Walk } from './walk.js'
import { Airborne } from './airborne.js'
export const Idle = {
enter(p) {
p.vx = 0;
},
update(p) {
if (p.keys.a || p.keys.d) {
p.statemachine.set(Walk);
if (!p.onground) {
p.statemachine.set(Airborne);
}
}
}
}