10 Commits

Author SHA1 Message Date
Kacper Kostka (aider)
20f5036848 feat: Add physics objects with square, circle, and triangle tools 2025-04-05 17:15:40 +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)
bb45c9fba8 refactor: Optimize rendering with chunk canvas caching and performance improvements 2025-04-05 15:49:13 +02:00
Kacper Kostka (aider)
d87105baad feat: Ensure stone layer chunks always render and remain visible 2025-04-05 15:45:13 +02:00
Kacper Kostka (aider)
883c3d9a08 feat: Improve stone layer visibility and rendering 2025-04-05 15:40:27 +02:00
Kacper Kostka (aider)
15fb106246 fix: Add missing dirtyChunks variable and update rendering logic 2025-04-05 15:37:55 +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