()
| 7 | } |
| 8 | |
| 9 | update() |
| 10 | { |
| 11 | // apply movement controls |
| 12 | const moveInput = keyDirection(); |
| 13 | this.velocity.x += moveInput.x * (this.groundObject ? .1: .01); |
| 14 | if (this.groundObject && moveInput.y > 0) |
| 15 | this.velocity.y = .9; // jump |
| 16 | |
| 17 | // move camera with player |
| 18 | cameraPos = vec2(this.pos.x, 9); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | function gameInit() |
nothing calls this directly
no test coverage detected