CodePudding user response:
With a switch variables, such as this. The openLoosen the turn it off, the code in the update
CodePudding user response:
update (dt: number) {
//get the velocity vector dir. The normalize (). The mul (your movement speed)
//then setPosition
}