Scenes are now ready to be worked on.

This commit is contained in:
Zed A. Shaw 2026-04-01 13:07:48 -04:00
parent 2dec4ec993
commit e113c0bc97
10 changed files with 67 additions and 10 deletions

View file

@ -47,8 +47,23 @@
"frame_width": 900, "frame_width": 900,
"frame_height": 600 "frame_height": 600
}, },
"test_background": "death_scene":
{"path": "assets/scenes/test_background.png", {"path": "assets/scenes/death_scene.png",
"frame_width": 1920,
"frame_height": 1080
},
"next_level_scene":
{"path": "assets/scenes/next_level_scene.png",
"frame_width": 1920,
"frame_height": 1080
},
"starting_scene":
{"path": "assets/scenes/starting_scene.png",
"frame_width": 1920,
"frame_height": 1080
},
"win_scene":
{"path": "assets/scenes/win_scene.png",
"frame_width": 1920, "frame_width": 1920,
"frame_height": 1080 "frame_height": 1080
} }

View file

@ -1,11 +1,53 @@
{ {
"DEATH": {
"components": [
{"_type": "AnimatedScene",
"layout": [
"[=text]"
],
"background": "death_scene",
"actors": [
],
"fixtures": [
]
}
]
},
"NEXT_LEVEL": { "NEXT_LEVEL": {
"components": [ "components": [
{"_type": "AnimatedScene", {"_type": "AnimatedScene",
"layout": [ "layout": [
"[=text]" "[=text]"
], ],
"background": "test_background", "background": "next_level_scene",
"actors": [
],
"fixtures": [
]
}
]
},
"STARTING": {
"components": [
{"_type": "AnimatedScene",
"layout": [
"[=text]"
],
"background": "starting_scene",
"actors": [
],
"fixtures": [
]
}
]
},
"WIN": {
"components": [
{"_type": "AnimatedScene",
"layout": [
"[=text]"
],
"background": "win_scene",
"actors": [ "actors": [
], ],
"fixtures": [ "fixtures": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
assets/scenes/win_scene.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

View file

@ -21,10 +21,10 @@ constexpr int PLAYER_SPRITE_DIR_CORRECTION=270;
constexpr int RENDER_DISTANCE=500; constexpr int RENDER_DISTANCE=500;
constexpr int ROOM_SIZE=3; constexpr int ROOM_SIZE=3;
constexpr int BOSS_VIEW_WIDTH=1080; constexpr int SCENE_VIEW_WIDTH=SCREEN_WIDTH;
constexpr int BOSS_VIEW_HEIGHT=SCREEN_HEIGHT; constexpr int SCENE_VIEW_HEIGHT=SCREEN_HEIGHT;
constexpr int BOSS_VIEW_X=SCREEN_WIDTH - BOSS_VIEW_WIDTH; constexpr int SCENE_VIEW_X=0;
constexpr int BOSS_VIEW_Y=0; constexpr int SCENE_VIEW_Y=0;
constexpr bool VSYNC=true; constexpr bool VSYNC=true;
constexpr int FRAME_LIMIT=60; constexpr int FRAME_LIMIT=60;

View file

@ -55,7 +55,7 @@ namespace scene {
} }
void Engine::init() { void Engine::init() {
$ui.position(0,0, BOSS_VIEW_WIDTH, BOSS_VIEW_HEIGHT); $ui.position(SCENE_VIEW_X, SCENE_VIEW_Y, SCENE_VIEW_WIDTH, SCENE_VIEW_HEIGHT);
$ui.set<guecs::Background>($ui.MAIN, {$ui.$parser, guecs::THEME.TRANSPARENT}); $ui.set<guecs::Background>($ui.MAIN, {$ui.$parser, guecs::THEME.TRANSPARENT});
auto& background = $ui.get<guecs::Background>($ui.MAIN); auto& background = $ui.get<guecs::Background>($ui.MAIN);
background.set_sprite($scene.background, true); background.set_sprite($scene.background, true);

View file

@ -35,7 +35,7 @@ namespace scene {
std::unordered_map<std::string, int> $actor_name_ids; std::unordered_map<std::string, int> $actor_name_ids;
std::vector<Element> $fixtures; std::vector<Element> $fixtures;
std::vector<Element> $actors; std::vector<Element> $actors;
cinematic::Camera $camera{{BOSS_VIEW_WIDTH, BOSS_VIEW_HEIGHT}, "scene"}; cinematic::Camera $camera{{SCENE_VIEW_WIDTH, SCENE_VIEW_HEIGHT}, "scene"};
Engine(components::AnimatedScene& scene); Engine(components::AnimatedScene& scene);

View file

@ -29,7 +29,7 @@ namespace gui {
auto gui_id = $gui.entity(name); auto gui_id = $gui.entity(name);
$gui.set<Text>(gui_id, {guecs::to_wstring(name)}); $gui.set<Text>(gui_id, {guecs::to_wstring(name)});
$gui.set<Rectangle>(gui_id, {1, {255, 0, 0, 255}}); $gui.set<Rectangle>(gui_id, {1, THEME.TRANSPARENT});
$gui.set<Meter>(gui_id, {1.0f, THEME.DARK_MID, {}}); $gui.set<Meter>(gui_id, {1.0f, THEME.DARK_MID, {}});
} }