Commit Graph

45 Commits (979533092ef2edd949675db16eb8a4ae5cf5a361)

Author SHA1 Message Date
En Yi bef2ee2813 Expose initial window size to scene
This is so that each scene does not need to hardcode render layer size
2024-05-04 18:28:53 +08:00
En Yi 0a6e7b4ddc Add delta time handling
Internal Changelog:
- Major change: all engine that does counting uses delta time instead of
  frame counting
- Animation runs at 24 FPS
- Water fill is at a constant rate as well
- Particle update will need to be given delta time as well.
- Particle system is not updated to use float, so no delta time handling
  for the system in this commit
2024-04-23 22:44:52 +08:00
En Yi 09da7e8700 Add sprite to tile and entity spawn in editor 2023-11-23 22:26:44 +08:00
En Yi 26eeec5638 Hack a method to lock key in game 2023-11-22 22:52:21 +08:00
En Yi 9a9f77c7b2 Fix issue with web build
Changelog:
- Update SFX
- Draw air meter
2023-11-22 00:13:05 +08:00
En Yi 72c27ed92e Add more SFX
Also, revert crate ground state behaviour
2023-11-13 14:23:31 +08:00
En Yi d660b4e5a5 Add sound loading from rres file
Also, fixes mistake in raw data size when loading from RRES file
2023-11-07 21:49:15 +08:00
En Yi 26cc567b7f Add emitter config to asset file loading 2023-11-06 21:36:23 +08:00
En Yi e39e549cd0 Add sound in asset info 2023-11-06 20:49:30 +08:00
En Yi ebecc68941 Add better support for particle system
Changelog:
- Move sprite to emitter itself to allow better reusing emitter config
- Dedicate a function for destroying entity. This is helpful for dealing
  with events that only occurs during entity destruction
2023-11-04 14:36:59 +08:00
En Yi a8b62f5aec Integrate particle system into scenes
Changelog:
- Each scene will have its own particle system to maintain
- Crate destruction now emits particles
- Draw particles during screen renders
    - May want to make this configurable
    - Should be in general scene render
2023-11-02 22:44:52 +08:00
En Yi 7dc66945da Add in engine configuration
All engine constants now sits in a single header file for easy tweaking
Also, SFX list fields is now an array rather than a pointer instead.
2023-10-13 21:55:30 +08:00
En Yi 92555708d7 Put more boilerplate inits into engine init 2023-10-13 21:08:48 +08:00
En Yi e318c65135 Add some more sfx 2023-10-10 21:57:45 +08:00
En Yi 2b79b5e6bc implement simple sfx playback for jumping 2023-10-09 21:28:30 +08:00
En Yi e6784a4d71 Fix crates hitbox collision with player 2023-09-23 13:39:18 +08:00
En Yi 20d5bd4ac7 Integrate loading RRES data pack
Changelog:
- Add in rres
    - Split rres header only into two files. Easier to deal with. Sorry
      Raysan...
- Add function to load assets from rres chunk
- Add function to load player sprite info from rres chunk
- Test loading rres in scene test
2023-09-01 20:50:45 +08:00
En Yi e2bce62a9d Update editor scene to be larger
also prevent last row to be modified
2023-08-19 20:33:31 +08:00
En Yi fae37eeecd Test out compilation for the web 2023-08-19 18:21:27 +08:00
En Yi d2a19c5405 Refactor out engine init, deinit, and key handling
To avoid repeated code
2023-08-19 12:20:16 +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 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 7929178411 Add sprite loading from empty crates
Also adjust the gravity delay, bomb timing + size to allow
vertical chain explosion
2023-08-08 23:55:46 +08:00
En Yi b0e1d33ad6 Implement player sprite info loading from file 2023-05-22 20:33:48 +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 0f485d89f2 Add assets loading from a file
Changelog:
- Add assets_loader functions from a file
- Update scene_test to use loader function
2023-05-20 16:14:39 +08:00
En Yi ee4313adbb Add a sprite for player 2023-05-15 20:48:56 +08:00
En Yi d4dfe01182 Slightly rework scene rendering
Changelog:
- Draw calls are now in rendering function of a scene
    - This is to allow flexibility on how a scene is rendered
- Modify level scene to render level using RenderTexture
    - This is to prepare for camera implementation later
- CloseWindow is called after all de-init functions is called
2023-05-07 16:25:03 +08:00
En Yi dc760bf8db Attempt to apply code style consitency
Squashed commit of the following:

commit 249fb96c63f68913ef632b8d1006e8a2d1c1b6d3
Author: En Yi <en.yi@tutanota.com>
Date:   Sat Apr 15 22:51:08 2023 +0800

    Ensure 120 column width limit

    Changelog:
    - this is just to avoid overly long line of code

commit 4b1ffa8fc89f17418de15f5fc3f0e73040f1d40c
Author: En Yi <en.yi@tutanota.com>
Date:   Sat Apr 15 20:05:07 2023 +0800

    Ensure style consistency in For loop

commit dcb41960407224592f78278313e97c2cc4bf66a5
Author: En Yi <en.yi@tutanota.com>
Date:   Sat Apr 15 17:26:20 2023 +0800

    Ensure consistency in code style

    Internal Changelog:
    - Use char* var instead of char *var. Preference
2023-04-15 22:52:38 +08:00
En Yi ac6d93565b Add Sprite Component
Changelog:
- Move Sprite struct into components
- Add asset field in engine
- Update scene test code to add engine for assets
    - This fixes the crash when q is pressed
- Add sprite component to player
- Update render function to draw the sprite
2023-03-13 21:12:37 +08:00
En Yi 0b342bb9be Implement Crates
Changelog:
- Add new component: container
- Add function to spawn a crate
- Refactor player spawning into level scene init
- Modify tile collision to work on bbox components
- Add actions to switch entity to spawn
- Update spawn system to spawn a crate
2023-01-10 21:24:50 +08:00
En Yi 85915d363c Refactor movement states
Changelog:
- Refactor ground and water state as a separate component
- Refactor upthrust and gravity calc. as a separate system targetting
  the new component
- General modification to use the new component
2023-01-09 21:00:30 +08:00
En Yi 1ba786a91e Re-add back TileComponent
Changelog:
- Remember the purpose of this component, which is to assist
  updating which tiles is containing the entity
2023-01-03 19:41:07 +08:00
En Yi b5da3f216c Implement anchoring for bbox shifting
Changelog:
- Add function to calculate offset needed to maintain anchor when
  changing bbox size
- Simplify down bbox changing for player
- Some minor fix from last commit
2022-12-28 17:36:07 +08:00
En Yi 64466128bc Implement water tiles and movement
Changelog:
- Adjust Gravity and movement accelaration
- Replace friction with acceleration instead of fractions of velocity
- Add upthrust in water
- Cut movement acceleration in water
2022-12-27 13:16:05 +08:00
En Yi 68586cd1d2 Add crouching to player
Changelog:
- Add player state component to keep track of crouching
- Add crouch key handling
- Crouch mechanics:
  - Reduce vertical bbox, slightly stretch horizontally
  - Offset position to be on ground
  - Reverse for un-crouching
  - Can jump out of a crouch, reverting the bbox
  - Dont allow un-crouch if there is something overhead (maybe should
    check directly overhead, instead of a full overhead?)
  - Above also apply for jump out of crouch
2022-12-21 23:40:10 +08:00
En Yi a4f4e2b170 Properly implement jump system
Changelog:
- Add Jump component
- Implement single jump and short hop
2022-12-17 15:45:41 +08:00
En Yi aa2125c8f6 Improve board-phase collision
Changelog:
- Rework tile movement update logic to be general
- Increase tilemap and player size for testing
2022-12-15 22:46:25 +08:00
En Yi 03b602de40 Implement broad-phase collision system
Changelog:
- Implement grid system
- Update screen bounce scene test
- Add grid movement update system
- Add component to track occupied grid tiles
2022-12-15 16:24:13 +08:00
En Yi 905f0d70a6 Small optimisation for key handling
Changelog:
- Use a single queue to handle pressed keys
- Remove unused printf for key presses
2022-12-13 00:10:40 +08:00
En Yi 3e6a53b097 Fix incorrect player input processing
Changelog:
- Store player dir input in LevelScene Data instead of pointer,
  to avoid use-after-free (non-fatal as mempool is used, but can cause
  unintended behaviour)
- Only process player movement in system update. This is done in the
  movement update system
- Normalise before apply acceleration, duh
2022-12-12 20:29:51 +08:00
En Yi 3a99dafcd4 Implement key controls to scene
Changelog:
- Add double buffer to handle key presses and release
- Add more actions
- Update action mapping of level scene
- Implement action function for level scene
- Remove action queue for Scene struct. This is handled by raylib
  and the game engine
- Update scene struct with action function field
2022-12-11 14:32:26 +08:00
En Yi b05dfe6fde Improve scene testing
Internal Changelog:
- Implement scene boundary bounce system (subject to change)
- Add tilemap in preparation for collision system
- Allow early exit of scene testing
2022-12-11 10:34:06 +08:00
En Yi b392e462b7 Implement test scene
Internal Changelog:
- Update BBox component to use Vector2
- Add new CTransform component
- Implement level scene movement system and render system
- Implement scene test procedure
2022-12-05 12:20:00 +08:00
En Yi 6c03078db9 Implement Scene and Level Scene
Changelog:
- Add actions and assets headers, not implemented and not used
- move original main to entManager_test
- Add proper main to create window and display nothing
- Implement scene base class and level scene
- Add a simple level scene test
- Update CMakeLists to compile main and tests
2022-12-03 13:46:24 +08:00