abbastoof / transcendence

2 stars 4 forks source link

server-side pong: develop server-side pong game logic #6

Closed trsctr closed 3 months ago

trsctr commented 4 months ago

Branch Name: feature/006-server-side-game-logic

Description:

Develop the backend business logic to manage game mechanics for a Pong game, including ball movement, paddle interactions, scoring mechanisms, and real-time synchronization of game state between players. Refer to game design doc in wiki for more information.

Tasks:

  1. Implement Methods Defined in Previous Issue:

  2. Calculate Ball Movements:

    • [x] Implement algorithms to calculate the trajectory and movement of the ball based on game rules (e.g., bouncing off paddles, walls).
  3. Receive and Validate Paddle Positions:

    • [x] Develop server-side logic to receive updated paddle positions from clients.
    • [x] Validate incoming paddle positions to ensure they conform to game rules and prevent malicious inputs.
  4. Manage Game State:

    • [x] Design and implement mechanisms to manage and update the game state (e.g., ball position, scores) on the server.
    • [x] Ensure consistency and synchronization of game state updates between players in real-time.
  5. Scoring Mechanisms:

    • [x] Implement logic to update scores based on game events (e.g., scoring goals).
    • [x] Ensure accurate scoring updates for player actions during gameplay.

Definition of Done:

Acceptance Criteria:

trsctr commented 4 months ago

at the moment: ball movement exists, although bounces from collision detection with paddles is missing, as well as bouncing from paddles. collision and bounce with wall exists.

trsctr commented 3 months ago

Game now runs in the server and is already somewhat integrated with channels, but can only run a single game session for now. Ditching django for this and configuring the game server in socket.io, that's a separate task