Scenes are now ready to be worked on.
This commit is contained in:
parent
2dec4ec993
commit
e113c0bc97
10 changed files with 67 additions and 10 deletions
|
|
@ -47,8 +47,23 @@
|
|||
"frame_width": 900,
|
||||
"frame_height": 600
|
||||
},
|
||||
"test_background":
|
||||
{"path": "assets/scenes/test_background.png",
|
||||
"death_scene":
|
||||
{"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_height": 1080
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,53 @@
|
|||
{
|
||||
"DEATH": {
|
||||
"components": [
|
||||
{"_type": "AnimatedScene",
|
||||
"layout": [
|
||||
"[=text]"
|
||||
],
|
||||
"background": "death_scene",
|
||||
"actors": [
|
||||
],
|
||||
"fixtures": [
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"NEXT_LEVEL": {
|
||||
"components": [
|
||||
{"_type": "AnimatedScene",
|
||||
"layout": [
|
||||
"[=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": [
|
||||
],
|
||||
"fixtures": [
|
||||
|
|
|
|||
BIN
assets/scenes/death_scene.png
Normal file
BIN
assets/scenes/death_scene.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 252 KiB |
BIN
assets/scenes/next_level_scene.png
Normal file
BIN
assets/scenes/next_level_scene.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 203 KiB |
BIN
assets/scenes/starting_scene.png
Normal file
BIN
assets/scenes/starting_scene.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
assets/scenes/win_scene.png
Normal file
BIN
assets/scenes/win_scene.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 194 KiB |
|
|
@ -21,10 +21,10 @@ constexpr int PLAYER_SPRITE_DIR_CORRECTION=270;
|
|||
constexpr int RENDER_DISTANCE=500;
|
||||
constexpr int ROOM_SIZE=3;
|
||||
|
||||
constexpr int BOSS_VIEW_WIDTH=1080;
|
||||
constexpr int BOSS_VIEW_HEIGHT=SCREEN_HEIGHT;
|
||||
constexpr int BOSS_VIEW_X=SCREEN_WIDTH - BOSS_VIEW_WIDTH;
|
||||
constexpr int BOSS_VIEW_Y=0;
|
||||
constexpr int SCENE_VIEW_WIDTH=SCREEN_WIDTH;
|
||||
constexpr int SCENE_VIEW_HEIGHT=SCREEN_HEIGHT;
|
||||
constexpr int SCENE_VIEW_X=0;
|
||||
constexpr int SCENE_VIEW_Y=0;
|
||||
|
||||
constexpr bool VSYNC=true;
|
||||
constexpr int FRAME_LIMIT=60;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace scene {
|
|||
}
|
||||
|
||||
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});
|
||||
auto& background = $ui.get<guecs::Background>($ui.MAIN);
|
||||
background.set_sprite($scene.background, true);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace scene {
|
|||
std::unordered_map<std::string, int> $actor_name_ids;
|
||||
std::vector<Element> $fixtures;
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace gui {
|
|||
auto gui_id = $gui.entity(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, {}});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue