-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
137 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "TutorialScene.h" | ||
|
||
#include <ui/Label.h> | ||
#include <ui/Button.h> | ||
#include <ui/AnimatedSpriteImage.h> | ||
|
||
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); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include "Scene.h" | ||
|
||
class TutorialScene : public Scene { | ||
public: | ||
TutorialScene(); | ||
void update(Vector2f mousePosition) override; | ||
void loadScene() override; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include "UIComponent.h" | ||
#include <animation/Animation.h> | ||
|
||
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; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6ea9edd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also solved a bug that showed half a heart when player health was -1