diff --git a/assets/animations.json b/assets/animations.json index 1cf57af..233bf87 100644 --- a/assets/animations.json +++ b/assets/animations.json @@ -141,5 +141,16 @@ "frames": 2, "speed": 0.02, "stationary": true + }, + "torch_crappy": { + "_type": "Animation", + "easing": 0, + "ease_rate": 0.5, + "scale": 0.4, + "max_scale": 0.4, + "simple": true, + "frames": 1, + "speed": 0.02, + "stationary": true } } diff --git a/boss/ui.cpp b/boss/ui.cpp index 36cc22d..c924101 100644 --- a/boss/ui.cpp +++ b/boss/ui.cpp @@ -27,6 +27,12 @@ namespace boss { dbc::check(animation::has(sprite.name), "add boss animation to animations.json"); $boss_anim = animation::load(sprite.name); + + $torch_left = textures::get_sprite("torch_crappy"); + $torch_left_anim = animation::load("torch_crappy"); + $torch_right.texture = $torch_left.texture; + $torch_right.sprite = std::make_shared(*$torch_right.texture); + $torch_right_anim = animation::load("torch_crappy"); } void UI::init() { @@ -37,7 +43,7 @@ namespace boss { $arena.layout( "[status|boss1 |boss2 |boss3 |boss4 |_]" - "[_ |boss5 |boss6 |boss7 |boss8 |_]" + "[torch1|boss5 |boss6 |boss7 |boss8 |torch2]" "[floor1|boss9 |boss10|boss11|boss12|_]" "[floor2|boss13|boss14|boss15|boss16|_]" "[floor3|player1|player2|player3|player4|_]" @@ -51,6 +57,9 @@ namespace boss { position_sprite($floor_sprite, $scene.floor_pos, 1.0, false); } + position_sprite($torch_left, "torch1", 1.0, false); + position_sprite($torch_right, "torch2", 1.0, false); + $arena.init(); $actions.position(0,0, SCREEN_WIDTH-BOSS_VIEW_WIDTH, SCREEN_HEIGHT); @@ -94,6 +103,9 @@ namespace boss { window.draw(*$boss_sprite.sprite); window.draw(*$player_sprite.sprite); + window.draw(*$torch_left.sprite); + window.draw(*$torch_right.sprite); + // $arena.debug_layout(window); } diff --git a/boss/ui.hpp b/boss/ui.hpp index 5423329..3aef996 100644 --- a/boss/ui.hpp +++ b/boss/ui.hpp @@ -25,6 +25,11 @@ namespace boss { components::Animation $boss_anim; sf::Vector2f $boss_pos; + SpriteTexture $torch_left; + SpriteTexture $torch_right; + components::Animation $torch_left_anim; + components::Animation $torch_right_anim; + UI(shared_ptr world, Entity boss_id); void init(); diff --git a/gui/fsm.cpp b/gui/fsm.cpp index ca0076e..07c5186 100644 --- a/gui/fsm.cpp +++ b/gui/fsm.cpp @@ -25,6 +25,8 @@ namespace gui { $font{FONT_FILE_NAME}, $dnd_loot($status_ui, $loot_ui, $window, $router) { + $window.setVerticalSyncEnabled(VSYNC); + if(FRAME_LIMIT) $window.setFramerateLimit(FRAME_LIMIT); $window.setPosition({0,0}); } diff --git a/tools/arena.cpp b/tools/arena.cpp index 4d876b9..7bdb451 100644 --- a/tools/arena.cpp +++ b/tools/arena.cpp @@ -30,6 +30,10 @@ int main(int, char*[]) { GameDB::init(); sf::RenderWindow window(sf::VideoMode({SCREEN_WIDTH, SCREEN_HEIGHT}), "Bossfight Testing Arena"); + window.setVerticalSyncEnabled(VSYNC); + if(FRAME_LIMIT) window.setFramerateLimit(FRAME_LIMIT); + window.setPosition({0,0}); + gui::routing::Router router; sound::mute(true); @@ -41,7 +45,6 @@ int main(int, char*[]) { auto main = boss::System::create_bossfight(); auto world = GameDB::current_world(); - while(!main->in_state(boss::State::END)) { main->mouse_pos = window.mapPixelToCoords(router.position);