From 6ea9eddca29bd99e03d7221a4329c8c8c70dcf0c Mon Sep 17 00:00:00 2001 From: Fabricio Date: Tue, 19 Dec 2023 17:50:13 -0300 Subject: [PATCH] Tutorial scene --- .../data/assets/textures/gui/keyboard/A.png | Bin 559 -> 0 bytes .../data/assets/textures/gui/keyboard/D.png | Bin 508 -> 0 bytes .../data/assets/textures/gui/keyboard/ESC.png | Bin 0 -> 665 bytes .../data/assets/textures/gui/keyboard/H.png | Bin 0 -> 504 bytes .../data/assets/textures/gui/keyboard/S.png | Bin 593 -> 0 bytes .../data/assets/textures/gui/keyboard/TAB.png | Bin 0 -> 655 bytes .../data/assets/textures/gui/keyboard/W.png | Bin 512 -> 0 bytes .../assets/textures/gui/keyboard/WASD.png | Bin 0 -> 1230 bytes CRogue/data/lvds/ld1.lvd | 4 +- CRogue/data/lvds/ld3.lvd | 2 +- CRogue/src/Scene/LevelScene.cpp | 2 +- CRogue/src/Scene/SceneManager.cpp | 15 ++++++- CRogue/src/Scene/SceneManager.h | 1 + CRogue/src/Scene/TutorialScene.cpp | 39 ++++++++++++++++++ CRogue/src/Scene/TutorialScene.h | 11 +++++ CRogue/src/UI/AnimatedSpriteImage.cpp | 29 +++++++++++++ CRogue/src/UI/AnimatedSpriteImage.h | 18 ++++++++ CRogue/src/UI/RWindow.cpp | 2 +- CRogue/src/assets/Assets.cpp | 12 +++++- CRogue/src/assets/Assets.h | 6 ++- CRogue/src/scene/MenuScene.cpp | 6 ++- 21 files changed, 137 insertions(+), 10 deletions(-) delete mode 100644 CRogue/data/assets/textures/gui/keyboard/A.png delete mode 100644 CRogue/data/assets/textures/gui/keyboard/D.png create mode 100644 CRogue/data/assets/textures/gui/keyboard/ESC.png create mode 100644 CRogue/data/assets/textures/gui/keyboard/H.png delete mode 100644 CRogue/data/assets/textures/gui/keyboard/S.png create mode 100644 CRogue/data/assets/textures/gui/keyboard/TAB.png delete mode 100644 CRogue/data/assets/textures/gui/keyboard/W.png create mode 100644 CRogue/data/assets/textures/gui/keyboard/WASD.png create mode 100644 CRogue/src/Scene/TutorialScene.cpp create mode 100644 CRogue/src/Scene/TutorialScene.h create mode 100644 CRogue/src/UI/AnimatedSpriteImage.cpp create mode 100644 CRogue/src/UI/AnimatedSpriteImage.h diff --git a/CRogue/data/assets/textures/gui/keyboard/A.png b/CRogue/data/assets/textures/gui/keyboard/A.png deleted file mode 100644 index 573d08c15adf5cf165e3a71d4a313d3668c528d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 559 zcmV+~0?_@5P)Px$=}AOER9J=0m$6U6KorKm5*DMb9c>UNa9|V@1`q}k5>|I$aWnoM#?7UgFuIbM zIDj~qsG|cqQAinC)iBn<^m1IU*Sq!re+db9y!Y(BU0ft(&>9KoZ^anjd)^?LD zC8<)N&$6DVkH$n6=i&Jenvhjs1zu& zZ?`(i1+soAQ6RRkutHh?ILfQ~sfcgXs!h+bOaK5quC(*z)%DVzzXtxsmGG@Uqz;daG$;^qg<2_u~@xbvRMegrqF_}3i zmx|KPlbJ*OR!LIv1LLYI;aq+fpC4aJ_O81K?CTIeO$UmDAMg=FvS(Q)Tz8IK-jt5x zx^vk xBa_L-dMy%>2zWMfQ~|^Q|I5t`UM}j^~(kMPs9KK002ovPDHLkV1kY73Ecny diff --git a/CRogue/data/assets/textures/gui/keyboard/D.png b/CRogue/data/assets/textures/gui/keyboard/D.png deleted file mode 100644 index 7980bdc02eb3940a351d9a06a7aa96a04a9d3458..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 508 zcmVPx$wn;=mR9J=0m%mTKKorNnZCG6yZ4f7La1;{;5C#(yR(D`wBm5o4&83Cnr2@80+OF8yI)jb@|eudj)Ce7du!vD;*& z$ut5vn-Z#HesI%icYVf|sW*3=Jg#rtSfR&9=j6s--*1Ix>6)Jt1r7SW$lAr_6?v01 z0(pF#P*w9g?XJ(wxA{U+0v8u2JT70wd1~IE--}!_Y-&R?q0L6i7u7mDJ&asQ@LDF! zZ#G)Kow%C#n2?hR+>!y(jHH|&>CZs^_l<46z^(LU!l3}_QX_7L5 z+l11a@D-A!Abw2wu~mg?zEEUV=n7OZe??@iTEX+n8#%dFtzfqBq;a|v(Cmsn5AE766zKI-h(0w$?ApGVxFVSIEQw0000TG2)~1{ zxuA)os|g8%f`f@TGB8pMjLZaVIsELw`ex%Xg2DeSQg_h4n8J` zD09qeNvl;y88@m;qbJdF_>YTzq%1+kFD$8+S@d1&_C~@Oc0cGnq8LAphLHnR)68ZI zxi%g|$W6>|J?#xon26op2$ordWfncLEXG|Nd`z12IZo3^&up2Oi-?6)oJ#NliaLXg ztN#iWrqL(%7=}@eoj6|zd{y%8$PW{H3;;MP982@zUF>$V-})wC9HZnhZPQHb@n&tD zk&~%N_Y6v+&C57a#H;1i@W^~Xs zkG=gbkF&$__?O+d%iDjO=xED8msY#QB7kP;ZtJ_f%W zW0~p``T8~tbTCEJ=*S=_v`7)Cn`Q?9Iu9L^$#e6fG6zNO&fEr#9dWkUtT@^6i=t_? ze7@jhC7DtFGEEEYjGYB&06Px$vPnciR9J=8S20h*Kp1@`U0oTyAWq=mC?*V`4kjk9?!e+^{2j*4rJ69hnvgIk zbudv!26XB{j*->D5vRM9(rd4GSHPE$&@bQj-Fxr8YpxC=I5|F_M`JQPzdSjrx$DFN z$t(gnRwdNLeDTn3b>@uCGA~X@5%&*XtkA=Q3uR*OpN~?rOwBLIlCG~V#V;CDK^B2Y z`R!IGv%qLw!K9Ilh>r8Bbvov|x`bo|W>Av{i>kk)V{5h@{Aw?rj{0O=#$*Lm? z=-~jTa2)2mr8K-b>62k8WD8G+rv^2XrKVyXJ*n ze;9iX^MrIkxk=D5e?erUUc>9#hw_4rdJW?#P0foN&sC1B5V^Bm#&}B6 zsMnN>$5Sfm@`S1ROXF&baHYD1@2{Us`HcN8#ci1Hh8yXCHypqhF+z%9Y=%lz{l>!B zOw`HN(M7H=9-Xh6Fl?D$006J+8IcLsC+$WW_-@*U*vWzKC*`dLUf07>Q~x%`&38(r uvh@pb+SM)z{7PpN4glB?I+@Uo?ez!bJlT^_mlx3h0000 literal 0 HcmV?d00001 diff --git a/CRogue/data/assets/textures/gui/keyboard/S.png b/CRogue/data/assets/textures/gui/keyboard/S.png deleted file mode 100644 index d7969cd9b7821388f61ff40bdc6221847b8dcb50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 593 zcmV-X0Px%3rR#lR9J=0S20h*Koou@U5vUi+8|Egz$hjRAPgiVuI|9XM))0sjis6}x|)zM zC^(p?BLg~7NEunxFyi!@>-Fw>cP-+VkZ|q$-o5X8ujMd+LZy7YrLXbu`1D}N#_kio zB2@$;{z_;R^Swo*-rTzGT6uHJO2X}(%@lfhaU)&W>-#;|tf=OjqQFkOFe>HiEjku9`zVr3%H#fg zA9&wcB3U>*+W6MI+$^(cp(NLwJ2SAXQh>yICPkP#GXMZMOP>es4M$T?sElCD#j1-{ zk7#7)&W!(d#d*ghybWYQ3#wIfP^;#Ion=9%7U55bt{@t+<0=Ck^MxYgg6g=2LDhVp z$YLQ6&o6J%kKyy< zODW!UH-YPMm~WDabbtxRF!8QgRuWuy4Vi54#KME?u00-aA6@M9#iMhuCJ~qU2><|l zU`Hy3efjzL{s>D9^$npUIj8rPE^|wd_*3nKDc%+LH1^_@D fLYGVD-{$%Sl*A?Z^B8bi00000NkvXXu0mjf&H@ww diff --git a/CRogue/data/assets/textures/gui/keyboard/TAB.png b/CRogue/data/assets/textures/gui/keyboard/TAB.png new file mode 100644 index 0000000000000000000000000000000000000000..a52eec6f7ced28943f0c8ab770bba1614b7b3e0d GIT binary patch literal 655 zcmV;A0&x9_P)Px%Nl8RORA_y5t|ktmtA@7U0st%&mJ;U>2X~c;Iq1|uSCnnP zr9T;QjG_o#RQm-mGda4V1Y)i!u6U{irSeM)ZXaZck*+CI$=D?Bnu^1eCGwhOda zoWaZUn~^v{@Hu3+Dau?l0h3T7H)w`7*UcjcdRQ#x6`tcE2zp^WE#B5(iz literal 0 HcmV?d00001 diff --git a/CRogue/data/assets/textures/gui/keyboard/W.png b/CRogue/data/assets/textures/gui/keyboard/W.png deleted file mode 100644 index 9c6fcee9ed0e3210cdccdc66fe8e8dbdbd91fbb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmV+b0{{JqP)Px$x=BPqR9J=0S20h*KotJku(~qZAWq=mC?*V`4kjk9?#RMM_#MX0rJ69hnvgIk zIGCs-13Gb#V`O!3#Oaz+dcD`XEBI}FdGEXTeebTlI*8!x^l}-E$?*L0ynsRt10w8-v0{0fmcd{)COylN16eLRAn`v^7m? zPq{P%HiY*2BP$}q=BuVD6`2LZo76<8j`=GhYt;%~-#*9-)~Xdu=S-Ow_nC-`WraZG z-fj`oIYX^lAs0{QEU3#8rsl70S6dC2$~*Y}`bm|~`R`iXhWWWLkq!jm0K*{Wd3kWY zK&ec>v2eZ!>SXKaBGVU-&RI?K z8`T4VQz#UTF4S?@FCJ*u+PWHs;Q)XQp|ctLw_JZ9h3rcWp>c!&0000X&f^Ay zzIpv-+EeT_k#KAFCeL#&e4FDq$Hn=Xxi~+weimYI!cN}sO?Eh+aawq}3tb2c9(U|X z+l@XMkIZB|vVJDH@edDg}C5Lz@BtXKy16bOW`#%M83n|_o9clL`_o;JfaXK3L=#BPi+FJ8WivhEzPcecalyL+s=Jf!d;7vo|X20t*4f*l($s^L|6}zw_ zeJrB?^7XsZ^Yg__Jno&Xp_wmcPC}k9X6tc^U2wzi?%gwge&0AfpJo44^Z`UDI6}cr z-tdD#-(=a+?C$l!W3p_y9;bzuyU;b|YG-R`F3pu%l|F|jw*dmVPpTqfmT2qCxbN@sa|RlX`Bq510OR{m-8$XGWH8@r7Q3@&Z_ za^eyLyRY7x^4KMpi7jbaq&9N%JkUuNbK3G@6uxR+wz=jeo3?Abl-Qy9AhjufhOy8? z=33;Df=d_dn0mKq)ODe^VK4It<#J<(ZzGBV$Jmu!3-7v$Rypi8U4^N!V}`5nZCn(2 z%dbL*O|e7fY@2IQh>)WwHFiwBL*|<2 zf}EBpHQ)OG(o?T?w!&lV_8hTO;r4k=vhC`=r=>QqQ@kE^87Z{bw$FTywb;Z`M_(m5*BV6o#8zxuoV* z0+$qdIdhp-O|&UtWgj+5UpI=vV;XKs;*x?_&Rn*|DMv0veQDR0=+$r&k5}cA7nisG zwHDiePm-A-w&A97$(Kt>oMLmivBP8guwmwtW(>)hOKH4PVaLwPol9|lho>yO8g43= sp>uibf;_eXANPEUJ#Oq6d8J|h55Of@PtY3yegFUf07*qoM6N<$f^U^?hyVZp literal 0 HcmV?d00001 diff --git a/CRogue/data/lvds/ld1.lvd b/CRogue/data/lvds/ld1.lvd index 442ce8f..5804d13 100644 --- a/CRogue/data/lvds/ld1.lvd +++ b/CRogue/data/lvds/ld1.lvd @@ -18,8 +18,8 @@ #2 #0 #0 &7 #0 #0 #0 #0 #0 #3 00 #2 O1 O5 O5 O5 O5 O5 O5 O3 #3 00 #2 #0 #0 #0 #0 #0 #0 #3 #2 O7 O0 O0 O0 O0 O0 O0 &A #3 00 #2 O1 O5 O5 O5 O5 O3 #3 -#2 O7 O0 O0 O0 O0 O0 O0 O8 #0 #0 #0 O7 O0 O0 O0 O0 O8 #3 -#2 O7 O0 O0 &0 O0 O0 O0 O0 O5 O5 O5 O0 O0 O0 O0 O0 O8 #3 +#2 O7 O0 O0 O0 O0 &0 O0 O8 #0 #0 #0 O7 O0 O0 O0 O0 O8 #3 +#2 O7 O0 O0 O0 O0 O0 O0 O0 O5 O5 O5 O0 O0 O0 O0 O0 O8 #3 #2 &9 O0 O0 O0 O0 O0 O0 O0 O6 O6 O6 O0 O0 O0 &1 O0 O8 #3 #2 O7 O0 O0 O0 O0 O0 O0 O8 #6 #1 #7 O7 O0 O0 O0 O0 O8 #3 #2 O7 O0 O0 O0 O0 O0 O0 &A #3 00 #2 O2 O6 O0 O0 O6 O4 #3 diff --git a/CRogue/data/lvds/ld3.lvd b/CRogue/data/lvds/ld3.lvd index a22a184..cde9d47 100644 --- a/CRogue/data/lvds/ld3.lvd +++ b/CRogue/data/lvds/ld3.lvd @@ -46,7 +46,7 @@ #2 O2 O6 O6 O6 O6 O6 O6 O6 O6 O6 O6 O4 #6 #1 #7 O7 O0 O0 &3 O0 O8 #6 #1 #7 O2 O6 O6 O6 O6 O6 O6 O6 O6 O6 O6 O4 #3 #4 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #5 00 #2 O2 O6 O0 O0 O6 O4 #3 00 #4 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #1 #5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #4 #1 #7 O7 O8 #6 #1 #5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #2 O7 O8 #3 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #2 &6 O8 #3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #2 #0 #0 O7 O8 &8 #0 #3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #2 O1 O5 O0 O0 O5 O3 #3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 #2 O7 O0 O0 O0 O0 O8 #3 diff --git a/CRogue/src/Scene/LevelScene.cpp b/CRogue/src/Scene/LevelScene.cpp index 9c60178..a7fcd14 100644 --- a/CRogue/src/Scene/LevelScene.cpp +++ b/CRogue/src/Scene/LevelScene.cpp @@ -211,7 +211,7 @@ void LevelScene::updateGUIHealth(int health) { GUIHealth[i]->setTexture(Assets::heart_empty); int half = health % 2; - if (half != 0 && health > 0) + if (half > 0) GUIHealth[whole]->setTexture(Assets::heart_half); playerHealth = health; diff --git a/CRogue/src/Scene/SceneManager.cpp b/CRogue/src/Scene/SceneManager.cpp index 75f1162..73b8c00 100644 --- a/CRogue/src/Scene/SceneManager.cpp +++ b/CRogue/src/Scene/SceneManager.cpp @@ -4,6 +4,7 @@ #include "MenuScene.h" #include "PauseMenu.h" #include "StatsScene.h" +#include "TutorialScene.h" #include Scene* SceneManager::mainScene = nullptr; @@ -15,7 +16,7 @@ bool SceneManager::gamePaused = true; void SceneManager::init() { currentLevel = 1; - auxScene = new LevelScene(currentLevel, 0.15f, 0, 0, 0, 0, 0); + auxScene = new LevelScene(currentLevel, 0.15f, 0, 0, 0, 1, 0); loadScene(auxScene); mainScene = new MenuScene(); loadScene(mainScene); @@ -94,6 +95,18 @@ void SceneManager::showStats() { } +void SceneManager::showTutorial() { + + if (gamePaused) + mainScene = new TutorialScene(); + else + mainScene = new MenuScene(); + + loadScene(mainScene); + gamePaused = !gamePaused; + +} + void SceneManager::update(Vector2f mousePosition) { if (loadingNextLevel) { loadNextLevel(); diff --git a/CRogue/src/Scene/SceneManager.h b/CRogue/src/Scene/SceneManager.h index 3b20c65..45df50b 100644 --- a/CRogue/src/Scene/SceneManager.h +++ b/CRogue/src/Scene/SceneManager.h @@ -23,6 +23,7 @@ class SceneManager { static void quitGame(); static void pauseGame(); static void showStats(); + static void showTutorial(); static void update(Vector2f mousePosition); static void draw(RWindow* render); static Scene* getCurrentScene(); diff --git a/CRogue/src/Scene/TutorialScene.cpp b/CRogue/src/Scene/TutorialScene.cpp new file mode 100644 index 0000000..35719f6 --- /dev/null +++ b/CRogue/src/Scene/TutorialScene.cpp @@ -0,0 +1,39 @@ +#include "TutorialScene.h" + +#include +#include +#include + +TutorialScene::TutorialScene() : Scene() { + + GUIPanel = Panel(Vector2f(0, 0), Color(200, 180, 190, 50)); + +} + +void TutorialScene::update(Vector2f mousePosition) { + GUIPanel.update(mousePosition); +} + +void TutorialScene::loadScene() { + + GUIPanel.addComponent(new Label(Vector2f(400, 80), "CONTROLES", 30, false, true)); + + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::WASD), Vector2f(100, 200), Vector2f(2, 2), Vector2f(31.5f, 21))); + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::playerRun), Vector2f(100, 320), Vector2f(4, 4), Vector2f(12, 12))); + + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::H), Vector2f(300, 200), Vector2f(2, 2), Vector2f(9.5f, 0))); + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::playerHeal), Vector2f(300, 320), Vector2f(4, 4), Vector2f(12, 12))); + + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::TAB), Vector2f(500, 200), Vector2f(2, 2), Vector2f(16.5f, 0))); + GUIPanel.addComponent(new Label(Vector2f(500, 320), "Inventario", 16, false, true, true)); + + GUIPanel.addComponent(new AnimatedSpriteImage(Animation(0.6f, Assets::ESC), Vector2f(700, 200), Vector2f(2, 2), Vector2f(20.5f, 0))); + GUIPanel.addComponent(new Label(Vector2f(700, 320), "Pausa", 16, false, true, true)); + + GUIPanel.addComponent(new Label(Vector2f(400, 430), "Click izquierdo para atacar", 16, false, true, true)); + + Button* backButton = new Button(Vector2f(400, 520), "Volver", 20); + backButton->setCallback(&SceneManager::showTutorial); + GUIPanel.addComponent(backButton); + +} diff --git a/CRogue/src/Scene/TutorialScene.h b/CRogue/src/Scene/TutorialScene.h new file mode 100644 index 0000000..a3979e7 --- /dev/null +++ b/CRogue/src/Scene/TutorialScene.h @@ -0,0 +1,11 @@ +#pragma once + +#include "Scene.h" + +class TutorialScene : public Scene { +public: + TutorialScene(); + void update(Vector2f mousePosition) override; + void loadScene() override; +}; + diff --git a/CRogue/src/UI/AnimatedSpriteImage.cpp b/CRogue/src/UI/AnimatedSpriteImage.cpp new file mode 100644 index 0000000..299d48a --- /dev/null +++ b/CRogue/src/UI/AnimatedSpriteImage.cpp @@ -0,0 +1,29 @@ +#include "AnimatedSpriteImage.h" + +AnimatedSpriteImage::AnimatedSpriteImage(Animation anim, Vector2f pos, Vector2f scale, Vector2f origin) { + animation = anim; + sprite.setPosition(pos); + sprite.setScale(scale); + sprite.setOrigin(origin); +} + +void AnimatedSpriteImage::update(Vector2f mousePosition, Vector2f panelPosition) { + animation.play(); + sprite.setTexture(*animation.getFrame()); +} + +void AnimatedSpriteImage::draw(RWindow* render) { + render->draw(sprite); +} + +void AnimatedSpriteImage::setPosition(Vector2f position) { + sprite.setPosition(position); +} + +Vector2f AnimatedSpriteImage::getPosition() { + return sprite.getPosition(); +} + +void AnimatedSpriteImage::move(Vector2f delta) { + sprite.move(delta); +} diff --git a/CRogue/src/UI/AnimatedSpriteImage.h b/CRogue/src/UI/AnimatedSpriteImage.h new file mode 100644 index 0000000..d705235 --- /dev/null +++ b/CRogue/src/UI/AnimatedSpriteImage.h @@ -0,0 +1,18 @@ +#pragma once + +#include "UIComponent.h" +#include + +class AnimatedSpriteImage : public UIComponent { +public: + AnimatedSpriteImage(Animation anim, Vector2f pos, Vector2f scale, Vector2f origin); + void update(Vector2f mousePosition, Vector2f panelPosition); + void draw(RWindow* render); + void setPosition(Vector2f position); + Vector2f getPosition(); + void move(Vector2f delta); +private: + Sprite sprite; + Animation animation; +}; + diff --git a/CRogue/src/UI/RWindow.cpp b/CRogue/src/UI/RWindow.cpp index b2396c3..6ff7d49 100644 --- a/CRogue/src/UI/RWindow.cpp +++ b/CRogue/src/UI/RWindow.cpp @@ -28,7 +28,7 @@ void RWindow::setMousePosition(Vector2f pos) { void RWindow::setSwordCursor() { Cursor cursor; - if (cursor.loadFromPixels(Assets::mouse.getPixelsPtr(), { 20,20 }, { 0,0 })) + if (cursor.loadFromPixels(Assets::mouse->copyToImage().getPixelsPtr(), { 20,20 }, { 0,0 })) setMouseCursor(cursor); } diff --git a/CRogue/src/assets/Assets.cpp b/CRogue/src/assets/Assets.cpp index 2dbb080..e5e545a 100644 --- a/CRogue/src/assets/Assets.cpp +++ b/CRogue/src/assets/Assets.cpp @@ -48,7 +48,11 @@ Texture* Assets::key = nullptr; Texture* Assets::healthPotion = nullptr; Texture* Assets::healthPotion_small = nullptr; -Image Assets::mouse; +vector Assets::WASD; +vector Assets::H; +vector Assets::ESC; +vector Assets::TAB; +Texture* Assets::mouse = nullptr; Font Assets::defaultFont; Font Assets::titleFont; @@ -114,7 +118,11 @@ void Assets::load() { healthPotion_small = Loader::loadTexture("data/assets/textures/items/health_small.png"); //GUI - mouse = Loader::loadTexture("data/assets/textures/gui/mouse.png")->copyToImage(); + WASD = Loader::loadSpriteSheet("data/assets/textures/gui/keyboard/WASD.png", 63, 42); + H = Loader::loadSpriteSheet("data/assets/textures/gui/keyboard/H.png", 19, 21); + ESC = Loader::loadSpriteSheet("data/assets/textures/gui/keyboard/ESC.png", 41, 21); + TAB = Loader::loadSpriteSheet("data/assets/textures/gui/keyboard/TAB.png", 33, 21); + mouse = Loader::loadTexture("data/assets/textures/gui/mouse.png"); heart = Loader::loadTexture("data/assets/textures/gui/heart2.png"); heart_half = Loader::loadTexture("data/assets/textures/gui/heart1.png"); heart_empty = Loader::loadTexture("data/assets/textures/gui/heart0.png"); diff --git a/CRogue/src/assets/Assets.h b/CRogue/src/assets/Assets.h index 433c65c..71be9b6 100644 --- a/CRogue/src/assets/Assets.h +++ b/CRogue/src/assets/Assets.h @@ -55,7 +55,11 @@ class Assets { static Texture* healthPotion; static Texture* healthPotion_small; - static Image mouse; + static vector WASD; + static vector H; + static vector ESC; + static vector TAB; + static Texture* mouse; static Font defaultFont; static Font titleFont; diff --git a/CRogue/src/scene/MenuScene.cpp b/CRogue/src/scene/MenuScene.cpp index ed1ce5f..9fe41f0 100644 --- a/CRogue/src/scene/MenuScene.cpp +++ b/CRogue/src/scene/MenuScene.cpp @@ -23,7 +23,11 @@ void MenuScene::loadScene() { statsButton->setCallback(&SceneManager::showStats); GUIPanel.addComponent(statsButton); - Button* quitButton = new Button(Vector2f(400, 500), "Salir", 16); + Button* tutorialButton = new Button(Vector2f(400, 500), "Controles", 16); + tutorialButton->setCallback(&SceneManager::showTutorial); + GUIPanel.addComponent(tutorialButton); + + Button* quitButton = new Button(Vector2f(400, 550), "Salir", 16); quitButton->setCallback(&SceneManager::quitGame); GUIPanel.addComponent(quitButton);