Commit Graph

33 Commits (04d928c97f3f6298cf64b6bb8a1aee5bbadcace1)

Author SHA1 Message Date
En Yi 04d928c97f Add a rendering queue for sprite
Only applies for editor scene as a test
2024-12-21 14:37:18 +08:00
En Yi add592afd2 Refactor out entity removal function
This allows a singular entity removal method for the game
2024-08-24 12:43:49 +08:00
En Yi 03a4240c6d Simplify and unify level restarting
Changelog:
- Add function to clear all game entities
- This functions is called in both editor and main game
2024-08-24 00:25:33 +08:00
En Yi e37e89505a Experiment with timer-based transition 2024-08-19 14:24:22 +08:00
En Yi 019f39f84c Implement basic level state management
Internal Changelog:
- Remove spawn position for entity
    - Not used. If spawning is needed, use a spawning entity
- Put in state machine callback function
    - Player spawning system is part of callback function
    - Remove player spawning system
- Incorporate state transition in systems
2024-08-19 11:55:48 +08:00
En Yi 90bbad09ae Add free-movement to camera in editor scene 2024-08-17 14:49:51 +08:00
En Yi 98b957a8ff Encapsulate scroll area as UI component 2024-07-08 18:02:56 +08:00
En Yi 0c461d3167 Integrate level select screen to main
Not complete tho
2024-07-07 15:45:17 +08:00
En Yi 893fc1c73f Add level select scene
Just a render texture with simple scroll
2024-07-02 21:54:54 +08:00
En Yi 8765500606 Add button to toggle solid tilemap 2024-05-11 15:53:39 +08:00
En Yi 7b4af0b513 Add tilemap rendering from sprite
Internal Changelog:
- Add a mapping from connectivity to tile to render
- Add new field for static tilemap sprite
2024-05-09 21:07:15 +08:00
En Yi 75d019aa34 Rework rendering to allow multi-layer render
Internal Changelog:
- A scene now has a maximum amount of render texture. It is to be
  rendered in order of the array by the engine.
- A scene now needs an explicit render system to draw onto the render
  textures. The scene will also init the number of render layers
  needed.
- The change is to allow more separate of concerns when it comes to
  rendering. A scene can also now compartmentalise the rendered items,
  which hopefully make understanding the code easier.
- Update all exisiting code to use the new render system.
2024-05-04 17:57:07 +08:00
En Yi 7dd4c8413b Add action to toggle grid for sandbox 2023-11-15 23:30:13 +08:00
En Yi 97714eccf6 Use unsigned int for UI component count 2023-11-11 12:30:42 +08:00
En Yi ae730ce029 Finish initial camera behaviour
x follows a mass-spring-damper system
y is simple lerp. Doesnt follow player when jumping
2023-10-08 12:13:03 +08:00
En Yi 064341e2eb Initial implementation of camera system
Changelog:
- Implement effectively a PI controller
2023-10-08 12:13:03 +08:00
En Yi e1a0c6e4e0 Implement Chest Entity
Internal Changelog:
- chest entity: Basically crates, but high def, and fragile
- Add new spawn type for chest
- Add atk modifier for player->chest
- Make crate non-fragile
- Ignore chest for collision check and move with player
2023-09-21 21:48:32 +08:00
En Yi d3029316b7 Add spikes sprite support
Add tile rotation. This is kind of a temp solution, since any sprite
could use rotation. So, may need to extend this for general sprite
2023-08-16 21:21:55 +08:00
En Yi bba12b9b39 Add Sandbox button in main program
Changelog:
- First button now loads the levelpack
2023-08-14 21:54:25 +08:00
En Yi e670af2519 Fix camera for levels smaller that viewport 2023-08-14 21:22:03 +08:00
En Yi 70d7fda22c Add game scene
This is slightly different from the sandbox
- No editting tiles and spawnning
- Can switch levels
2023-08-14 18:37:29 +08:00
En Yi e0ea01a4de Add level switching
Changelog:
- Water is now on a separate layer in LDtk
- Update water loading in assets functions
- Add actions to switch levels
2023-08-14 17:05:43 +08:00
En Yi 8e9efc622d Refactor out level tilemap initialisation
- Rename sandbox scene initialisation, which is just a convenience
  function
- Also refactor out tilemap related functions to a new file
2023-08-14 13:51:20 +08:00
En Yi 5de188c503 Implement level pack loading and testing 2023-08-14 12:16:15 +08:00
En Yi 5dbe2cc4d0 Add struct for loading in a level pack 2023-08-13 15:02:20 +08:00
En Yi aae61edda9 Refactor out broad phase grid collision functions 2023-07-17 21:14:02 +08:00
En Yi e74f523b7f Handle arrow collision with tilemap
Changelog:
- Refactor function to change a tile type
- Destroy entities without bbox when OOB
- Add hitbox collision checking with tiles
- Add defense point on tiles
2023-06-28 22:19:20 +08:00
En Yi c7ef3f473f Add spike destruction
Changelog:
- Spike collision is now checked against all bboxes
    - Non player will destroy it
- Add moveable flag for each tile to determine whether a boulder can
  move into it
2023-06-22 23:14:07 +08:00
En Yi c27fa632a2 Add spikes spawning
Changelog:
- Add new tile: spikes
- Change bbox of tile of spikes depending on solid tiles position
2023-06-19 22:32:18 +08:00
En Yi 81da536e8e Add bounding box info in tiles
Changelog:
- Use more memory, but should help out in implementing spikes
2023-06-19 21:08:42 +08:00
En Yi 023536f7c0 Update collision system
Changelog:
- Update collision functions to omit entity_manager
    - Change tile entity set to use map 64v to store entity pointer
- For complete overlap, return the smaller magnitude
    - Still incorrect though
- Add a check for empty space before moving the entity during collision
  check
2023-06-05 17:40:56 +08:00
En Yi 98450d0bba Rework Entity Sprite Component & Add Tile Sprite
Changelog:
- Add tile sprites as part of Level Data
- Render tile sprite if loaded in
- CSprite now stores array of sprite rendering info
    - use current idx to keep track
2023-05-20 18:23:26 +08:00
En Yi 7b3685b792 Refactor for better separation of concern
Changelog:
- Separate out engine-specific stuff vs game-specific stuff
2023-05-16 21:09:38 +08:00