game: add: use straight line colision (Not finished)
This commit is contained in:
@ -57,12 +57,8 @@ class Ball
|
||||
{
|
||||
let distance = this.speed * (this.game.time.deltaTime() / 1000)
|
||||
|
||||
let angle_radian = this.angle * Math.PI / 180
|
||||
|
||||
console.log(angle_radian)
|
||||
|
||||
this.position.x = this.position.x + distance * Math.cos(angle_radian);
|
||||
this.position.y = this.position.y + distance * Math.sin(angle_radian);
|
||||
this.position.x = this.position.x + distance * Math.cos(this.angle);
|
||||
this.position.y = this.position.y + distance * Math.sin(this.angle);
|
||||
|
||||
this.draw(ctx);
|
||||
}
|
||||
|
Reference in New Issue
Block a user