16 Commits

Author SHA1 Message Date
Kacper Kostka (aider)
80c243ebf8 feat: Implement player block breaking with 10-pixel range and inventory collection 2025-04-05 19:12:11 +02:00
Kacper Kostka (aider)
d765defa9d feat: Add block breaking, HUD, and inventory system for player 2025-04-05 19:08:28 +02:00
Kacper Kostka (aider)
583544840b feat: Add F3 debug mode with collision boxes and FPS display 2025-04-05 18:39:47 +02:00
Kacper Kostka (aider)
db5b49ee7f feat: Add player entity with WASD/space controls and spawn functionality 2025-04-05 18:03:10 +02:00
Kacper Kostka (aider)
61ee259f6b feat: Add rabbit button to HUD and implement tool selection 2025-04-05 17:24:10 +02:00
Kacper Kostka (aider)
5ac6d205ad feat: Add rabbit spawning logic to input handling 2025-04-05 17:23:35 +02:00
Kacper Kostka (aider)
20f5036848 feat: Add physics objects with square, circle, and triangle tools 2025-04-05 17:15:40 +02:00
Kacper Kostka
7cabd79d5f Revert "feat: Add rabbit spawning button to HUD and implement rabbit tool"
This reverts commit 032793292fb25507110fa341de71b5c3bca57aa8.
2025-04-05 17:04:16 +02:00
Kacper Kostka
349d38c04c Revert "feat: Add rabbit tool and event listener for rabbit button"
This reverts commit bdab2974c6bdffacb653ffce4e6bc72ca9dc1628.
2025-04-05 17:04:05 +02:00
Kacper Kostka
b5d1a643bd Revert "fix: Remove duplicate RABBIT declaration and move toggleDebug function"
This reverts commit bcd61b7433a9cd9420b236f50ab4cc54084bab6d.
2025-04-05 17:03:55 +02:00
Kacper Kostka
b7d12114d3 Revert "fix: Resolve canvas reference and duplicate currentTool declaration"
This reverts commit a948fab6194aa2f7bfd1039cba4d44191d1844fe.
2025-04-05 16:28:42 +02:00
Kacper Kostka (aider)
a948fab619 fix: Resolve canvas reference and duplicate currentTool declaration 2025-04-05 16:27:42 +02:00
Kacper Kostka (aider)
bcd61b7433 fix: Remove duplicate RABBIT declaration and move toggleDebug function 2025-04-05 16:26:18 +02:00
Kacper Kostka (aider)
bdab2974c6 feat: Add rabbit tool and event listener for rabbit button 2025-04-05 16:24:29 +02:00
Kacper Kostka (aider)
032793292f feat: Add rabbit spawning button to HUD and implement rabbit tool 2025-04-05 16:24:16 +02:00
Kacper Kostka (aider)
a86acfff3a refactor: Spread game code into modular files for better maintainability
This commit reorganizes the game's source code into multiple files within a `js/` directory, creating a more modular and maintainable structure. The changes include:

- Created separate files for different game components:
  - `constants.js`: Game constants and element types
  - `world.js`: World management functions
  - `terrain.js`: Terrain generation logic
  - `physics.js`: Physics simulation
  - `render.js`: Rendering functions
  - `input.js`: Input handling
  - `main.js`: Main game initialization and loop
  - Element-specific files in `js/elements/`:
    - `basic.js`: Sand, water, dirt behaviors
    - `plants.js`: Grass, seeds, flowers
    - `trees.js`: Tree growth and leaf generation
    - `fire.js`: Fire and lava behaviors

- Updated `index.html` to load modules in the correct order
- Removed the monolithic `script.js`

The modular approach improves code readability, makes future extensions easier, and separates concerns more effectively.
2025-04-04 12:15:30 +02:00