mirror of
https://github.com/wassname/rl_2d_walker.js.git
synced 2026-09-09 11:33:20 +08:00
reset
This commit is contained in:
+7
-2
@@ -88,8 +88,7 @@ class Walker {
|
||||
this.renderer = new Renderer(this.config, this, this.floor)
|
||||
}
|
||||
|
||||
this.build()
|
||||
this.initGrip()
|
||||
this.reset()
|
||||
|
||||
}
|
||||
|
||||
@@ -175,6 +174,9 @@ class Walker {
|
||||
this.bodies.map(body => this.world.DestroyBody(body))
|
||||
this.joints.map(joint => this.world.DestroyJoint(joint))
|
||||
this.otherJoints.map(joint => this.world.DestroyJoint(joint))
|
||||
this.bodies = []
|
||||
this.joints = []
|
||||
this.otherJoints = []
|
||||
}
|
||||
|
||||
createTorso() {
|
||||
@@ -636,6 +638,9 @@ class Walker {
|
||||
reset() {
|
||||
/** Reset position to initial or random position TODO */
|
||||
// console.log('reset not implemented')
|
||||
if (this.bodies) this.destroy();
|
||||
this.build();
|
||||
this.initGrip()
|
||||
}
|
||||
shuffle() {
|
||||
/** Reset position to initial or random position TODO */
|
||||
|
||||
Reference in New Issue
Block a user