feat: Add player entity with WASD/space controls and spawn functionality
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Base entity system
|
||||
const ENTITY_TYPES = {
|
||||
RABBIT: 'rabbit'
|
||||
RABBIT: 'rabbit',
|
||||
PLAYER: 'player'
|
||||
};
|
||||
|
||||
// Store all entities
|
||||
@@ -141,6 +142,9 @@ function createEntity(type, x, y, options = {}) {
|
||||
case ENTITY_TYPES.RABBIT:
|
||||
entity = new Rabbit(x, y, options);
|
||||
break;
|
||||
case ENTITY_TYPES.PLAYER:
|
||||
entity = new Player(x, y, options);
|
||||
break;
|
||||
default:
|
||||
console.error(`Unknown entity type: ${type}`);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user