-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangeSide.ts
30 lines (27 loc) · 1.03 KB
/
changeSide.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { IPerson, Person } from "./class"
export class ChangeSide {
positionBody:IPerson
constructor(Position:IPerson) {
this.positionBody = Position
// this.positionBody.stateDoubleJump = 0
}
changeSide() {
const position = this.positionBody.positionBody
if (this.positionBody.side == "left") {
;(this.positionBody.positionHead.x = position.x + 18.5),
(this.positionBody.positionLegLeft.x = position.x + 35),
(this.positionBody.positionLegRight.x = position.x + 3),
(this.positionBody.positionHandLeft.x = position.x),
(this.positionBody.positionHandRight.x = position.x)
this.positionBody.side = "right"
return this.positionBody
}
;(this.positionBody.positionHead.x = position.x + 15.5),
(this.positionBody.positionLegLeft.x = position.x + 28),
(this.positionBody.positionLegRight.x = position.x - 5),
(this.positionBody.positionHandLeft.x = position.x - 40),
(this.positionBody.positionHandRight.x = position.x - 10)
this.positionBody.side = "left"
return this.positionBody
}
}