Diary of a Game: Day 9
Got debug drawing working today for physics bodies, and then started working on a multi-camera system. I added a new Viewport
component in Flecs that encapsulated a Raylib Camera2D
and a RenderTexture
, as well as other data needed to specify where the viewport should appear on the primary display, which I call the playfield. The playfield itself is of a fixed resolution, and is displayed within the game window. It may be letterboxed or pillarboxed if the window is of different dimensions.
The screenshot above shows three viewports, with red, green and blue backgrounds, each displaying a different view of the same physics scene in world space. The viewports are of different resolutions; the chunky one in the bottom-right corner is just 50x50, while the red one is 800x600, but being downscaled to be displayed within the 640x480 playfield.
The next step will be to display textures and have them driven by the physics engine, instead of just relying on debug drawing (which can be toggled off, and which is completely disabled in release builds). I also want to add controls to allow the camera within each viewport to be moved, rotated and zoomed in and out.
A good day today after some back-and-forth yesterday. Physics is working well, and Chipmunk is completely hidden behind a few Flecs components and systems. And I’m glad that Raylib supports drawing to a virtual camera, properly clipping the results. Bodes well for the work that lays ahead!
Get Gravitas
Gravitas
Cave flyer party game.
Status | Released |
Author | the punk collective |
Genre | Shooter |
Tags | Flying, Gravity, Local multiplayer, party-game, Physics, Retro |
More posts
- Gravitas Trailer UnleashedDec 31, 2021
- Diary of a Game: Day 111Dec 24, 2021
- Diary of a Game: Day 61Nov 02, 2021
- Diary of a Game: Day 54Oct 25, 2021
- Diary of a Game: Day 51Oct 22, 2021
- Diary of a Game: Day 21Sep 21, 2021
- Diary of a Game: Day 13Sep 13, 2021
- Diary of a Game: Day 10Sep 10, 2021
- Diary of a Game: Day 8Sep 08, 2021
Leave a comment
Log in with itch.io to leave a comment.