Feature: Implement invincibility and combo systems
All checks were successful
Build and Publish Docker Image / Build and Validate (pull_request) Successful in 9s
All checks were successful
Build and Publish Docker Image / Build and Validate (pull_request) Successful in 9s
- 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.
This commit is contained in:
parent
e33f5a97a7
commit
54c2fa0380
6 changed files with 313 additions and 7 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue