Commit Graph

23 Commits (5de188c503c401f9d7774d51ebb919fb6fb04513)

Author SHA1 Message Date
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