Commit Graph

111 Commits (65b04523ce796b05f2bc478e89d7111d0d1d40f1)

Author SHA1 Message Date
En Yi 65b04523ce Update game rendering
Internal Changelog:
- Port editor scene rendering improvements
- Make game scene ~640x480 for testing
2024-08-12 16:06:36 +08:00
En Yi 5d1784dad8 Attempt to fix BG scrolling 2024-08-10 17:45:09 +08:00
En Yi 2c908ffd46 Update rendering for editor scene
Internal Changelog:
- Add background
- Update grid and bbox drawing
2024-08-10 17:21:10 +08:00
En Yi 4a54bfe84f Incorporate anchor point in player sprite info
Changelog:
- src anchorpoint is also an enum. The offset needs to be computed
  dynamically due to flip_x
- Re-add back the offset field.
- Add symbol parsing for anchor point.
2024-08-06 21:36:17 +08:00
En Yi 1215746e05 Add x-flipping for anchoring 2024-08-06 20:36:23 +08:00
En Yi 657110a66d Implement sprite rendering anchor 2024-08-05 21:50:01 +08:00
En Yi b158bee1e8 Remove unused ActionResult
There is only one focused scene at a time as part of the design
limitation. Thus, it is no longer needed
2024-07-01 20:48:48 +08:00
En Yi 0653cbd0a2 Continue plan data struct for scene management 2024-06-20 21:41:14 +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 d7113d42fe Add neighbour solid counts
This is preparing for the tile sprites rework
2024-05-06 22:04:53 +08:00
En Yi 0f09a7b2bd Remove obsolete render function field 2024-05-04 20:40:15 +08:00
En Yi 251360ca3e Fix instructions not rendering correctly 2024-05-04 19:29:43 +08:00
En Yi 21e37a328e Update editor rendering to use texture dimensions 2024-05-04 19:25:47 +08:00
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 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 0d4089d9ce Tweak scene render function
Delegate BeginDrawing and EndDrawing to individual scenes
2024-05-01 19:56:10 +08:00
En Yi 754d380221 Integrate mouse action into input process 2024-04-25 21:46:53 +08:00
En Yi 0fb1fe27de Display time scaling in sandbox 2024-04-24 22:15:52 +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 a2c061c5e8 Place position field into Entity
Position is so commonly used that placing it into Entity from the
CTransform components reduces the reference to CTransform.

Void Particle proved that it made development much easier.
2024-04-22 22:15:21 +08:00
En Yi 09da7e8700 Add sprite to tile and entity spawn in editor 2023-11-23 22:26:44 +08:00
En Yi 8a39f85c45 Change key to toggle grid 2023-11-23 21:53:36 +08:00
En Yi d5c6d05558 Add action to set spawn point 2023-11-23 20:52:51 +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 799941ed80 Draw particles before water 2023-11-21 21:01:47 +08:00
En Yi b18e072d51 Print free emitters in editor scene 2023-11-20 22:08:05 +08:00
En Yi 8ae999ccc8 Tweak water rendering
make water rendering in front of all entities
2023-11-18 20:13:02 +08:00
En Yi 85e731392a Remove drawing of moveable grid 2023-11-15 23:35:38 +08:00
En Yi 7dd4c8413b Add action to toggle grid for sandbox 2023-11-15 23:30:13 +08:00
En Yi d947d95247 Fix signed int comparison 2023-11-11 12:44:37 +08:00
En Yi ffc890240b Remove asset argument from entity creation 2023-11-11 12:18:45 +08:00
En Yi b150b3ad38 Change to manual init for entity tag map
The entity tag mapping is not that used often enough.

So, change it to manual init.
2023-11-11 11:14:22 +08:00
En Yi 0c540d5053 Move frame counter out of sprite component
This allows individual animation
2023-11-04 20:32:29 +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 ad421d724a Add sprite rotation 2023-11-02 21:18:47 +08:00
En Yi 290dafdf86 Rework scene rendering function
Split off- and on-screen rendering. Off-screen rendering would be a
system now
2023-10-21 10:48:21 +08:00
En Yi b7a6c11b77 Improve scene drawing
Changelog:
- Add entity draw culling
- Tweak culling range
- Remove unnecessary draws for game scene, those are debug anyways
- Reorder draw in game scene for entity
2023-10-18 21:44:23 +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 9f3061bae3 Implement coyote time 2023-09-29 21:18:08 +08:00
En Yi c2c00cfa51 Add quake-style jump buffering 2023-09-28 21:31:52 +08:00
En Yi 359ac0a0ae Implement air meter
Changelog:
- Add air timer component
- Update movement component to keep track of x direction
    - This indicate the facing direction
- Implement air timer update system
- Add air timer component to player
- Render player's air timer
2023-09-27 22:08:16 +08:00
En Yi ce8284ab39 Implement level ending
Internal Changelog:
- Activate on collected chest == all chest
- Add spawning level end entity
- Level ending in sandbox will just reset the scene
2023-09-25 22:04:13 +08:00
En Yi d54fee8935 Fix main game collision issue
Changelog:
- Add the refactored system to main game
- Reset coin counter to zero on (re-)start
2023-09-23 14:16:57 +08:00
En Yi e8ebe0f89c Improve player collision to chests vs crates
Internal Changelog:
- Delay zeroing velocity on edge check to after hitbox update
- Update player velocity on hitting a crate explicitly
    - This is due to the zeroing velocity changes above
    - This essentially allow 'phasing' through chest but not wooden
      crates
- Render crates using material instead of fragile flag
2023-09-23 00:28:03 +08:00
En Yi a8e0d99870 Implement collecting chests
Internal Changelog:
- Set chest limit to 65535
- Handle (de-)spawning chest on coin counter
- Add coin increment to chest collision with player
2023-09-21 22:08:02 +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 5cbacf8516 Change keybinds to be more convenient
Also, remove asan compile flag for web build
2023-08-20 11:47:51 +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 567b7ab173 Update instruction on metal toggling 2023-08-19 19:34:36 +08:00