Feature/Implement invincibility and combo systems (#16)
All checks were successful
Build and Publish Docker Image / Publish to Registry (push) Successful in 8s
Build and Publish Docker Image / Deploy to Portainer (push) Successful in 2s

- Added Invincibility component to manage invincibility state and duration.
- Introduced InvincibilitySystem to handle visual effects during invincibility.
- Updated Game class to integrate combo multiplier mechanics and high score tracking.
- Enhanced UI to display current combo status and high score.
- Configured GameConfig for centralized game settings, including obstacle damage and invincibility duration.
- Updated game logic to reset combo on damage and manage health regeneration.

This update enhances gameplay dynamics by introducing invincibility frames and a scoring combo system.

Reviewed-on: #16
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
This commit is contained in:
Juan Sebastián Montoya 2025-11-26 16:49:25 -05:00 committed by Juan Sebastián Montoya
parent e33f5a97a7
commit 112aa68a83
6 changed files with 313 additions and 7 deletions

View file

@ -3,7 +3,9 @@ import { Velocity } from '../components/Velocity.js';
import { MeshComponent } from '../components/MeshComponent.js';
import { Collidable } from '../components/Collidable.js';
import { Health } from '../components/Health.js';
import { Invincibility } from '../components/Invincibility.js';
import { PlayerTag, CoinTag, ObstacleTag, BoundaryConstrained } from '../components/Tags.js';
import { GameConfig } from './GameConfig.js';
/**
* EntityFactory - creates pre-configured game entities with appropriate components.
@ -52,6 +54,8 @@ export class EntityFactory {
this.world.addComponent(entity, new MeshComponent(mesh));
this.world.addComponent(entity, new Collidable(0, 'player')); // Player center point (original behavior)
this.world.addComponent(entity, new Health(100));
// Invincibility starts inactive until first damage
this.world.addComponent(entity, new Invincibility(GameConfig.INVINCIBILITY_DURATION, false));
this.world.addComponent(entity, new PlayerTag());
this.world.addComponent(entity, new BoundaryConstrained(this.groundSize));