Skip to content

Commit

Permalink
fixing wallz
Browse files Browse the repository at this point in the history
  • Loading branch information
a-boring-man committed Apr 3, 2023
1 parent dabcd76 commit a124754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions back/nest_project/src/game_engine/Wall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export class Wall {
end: Vec2;
x_position;
y_position;
length;

constructor(v1: Vec2, v2: Vec2) {
this.start = v1;
this.x_position = this.start.x;
this.y_position = this.start.y
this.end = v2;
this.x_position = this.start.x;
this.length = this.end.sub(this.start).mag();
this.y_position = this.start.y + (this.length / 2);
}

wallUnit() {
Expand Down
6 changes: 3 additions & 3 deletions back/nest_project/src/game_engine/game_engine.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export class GameEngineService {
this.cooldown_start = 0;
this.gs = { ballPosition: [ {x: this.ballz[0].position.x, y: this.ballz[0].position.y, r: this.ballz[0].r},
{x: this.ballz[1].position.x, y: this.ballz[1].position.y, r: this.ballz[1].r}],
paddleOne: { x: this.wallz[0]., y: 0.5 },
paddleTwo: { x: this.aspect_ratio, y: 0.5 } };
console.log(this.wallz);
paddleOne: { x: this.wallz[0].x_position, y: this.wallz[0].y_position },
paddleTwo: { x: this.wallz[1].x_position, y: this.wallz[1].y_position } };
console.log("from game engine service player are :" + this.pl1 + "and" + this.pl2);

}

Expand Down

0 comments on commit a124754

Please sign in to comment.