collision algo with Hugo
+ ball.dir added to EventGameUpdate
This commit is contained in:
@@ -97,9 +97,19 @@ class GameSession {
|
||||
const gc = s.components;
|
||||
const update: ev.EventGameUpdate = {
|
||||
type: en.EventTypes.gameUpdate,
|
||||
playerLeft: {y: gc.playerLeft.pos.y},
|
||||
playerRight: {y: gc.playerRight.pos.y},
|
||||
ball: {x: gc.ball.pos.x, y: gc.ball.pos.y, speed: gc.ball.speed},
|
||||
playerLeft: {
|
||||
y: gc.playerLeft.pos.y
|
||||
},
|
||||
playerRight: {
|
||||
y: gc.playerRight.pos.y
|
||||
},
|
||||
ball:{
|
||||
x: gc.ball.pos.x,
|
||||
y: gc.ball.pos.y,
|
||||
dirX: gc.ball.dir.x,
|
||||
dirY: gc.ball.dir.y,
|
||||
speed: gc.ball.speed
|
||||
},
|
||||
lastInputId: 0
|
||||
};
|
||||
s.playersMap.forEach( (client) => {
|
||||
|
||||
Reference in New Issue
Block a user