1#include "../Header files/Precompile.h"
2#include "../Header files/El Octavo-Functions.h"
3#include "../Header files/GameClass.h"
4#include "../Header files/Additional Functions.h"
5#include "../Header files/Menu.h"
9 this->imageCount = imageCount;
10 this->switchTime = switchTime;
12 this->totalTime = 0.0f;
13 this->currentImage.
x = 0;
48 if (totalTime >= switchTime)
50 totalTime -= switchTime;
53 if (currentImage.
x >= imageCount.
x)
276 for (
int i = 0; i < 12; i++) {
281 for (
int i = 0; i < 12; i++) {
334 if (
ev.
type == Event::Closed)
358 if (Keyboard::isKeyPressed(Keyboard::Q))
373 if (Keyboard::isKeyPressed(Keyboard::Enter) && !
enterPressed)
385 dialogScript =
"Yes we are. Anyway, your task is to find Nestashev and get netractor certificate.";
390 dialogScript =
"Certificate for netractors? Are you OK!";
395 dialogScript =
"Yes this is the order. Now go this way and you will reach nestashev.";
400 dialogScript =
"All right, I'll go. See you later. I have to beat nestashev for money!";
433 window.
clear(Color::Green);
442 for (
int i = 0; i < 2; i++) {
469 for (
int i = 0; i < 11; i++) {
507 for (
int i = 0; i < 12; i++) {
522 if (Keyboard::isKeyPressed(Keyboard::D))
531 for (
int i = 0; i < 2; i++) {
535 for (
int i = 0; i < 11; i++) {
bool checkCollideWithRamp(RectangleShape &body)
void moveStaticImages(RectangleShape &body, RenderWindow &window, Npc &test)
bool checkCollideWithGround(RectangleShape &body)
void setup(RenderWindow &window)
void drawHitbox(RenderWindow &window)
CollisionBlock(Vector2f pos, Vector2f size)
bool checkForCollision(RectangleShape &body)
void draw(RenderWindow &window)
void update(int row, float deltaTime, bool delay)
Npc(Texture *texture, Vector2u imageCount, float switchTime, float speed, string name)
void moveTo(float pos[], float deltaTime, bool &done, bool &faceLeft)
void updateMovement(float deltaTime, RenderWindow &window, Sprite &adventureBgImage, Sound &soundWalk, Sound &soundJump, bool &toggle, CollisionBlock blocks[], int blocksSize)
void draw(RenderWindow &window)
Utility class that measures the elapsed time.
Time restart()
Restart the clock.
Time getElapsedTime() const
Get the elapsed time.
Utility class for manipulating RGBA colors.
Defines a system event and its parameters.
KeyEvent key
Key event parameters (Event::KeyPressed, Event::KeyReleased)
EventType type
Type of the event.
Class for loading and manipulating character fonts.
bool loadFromFile(const std::string &filename)
Load the font from a file.
T width
Width of the rectangle.
T height
Height of the rectangle.
T left
Left coordinate of the rectangle.
T top
Top coordinate of the rectangle.
bool intersects(const Rect< T > &rectangle) const
Check the intersection between two rectangles.
Specialized shape representing a rectangle.
void setSize(const Vector2f &size)
Set the size of the rectangle.
void draw(const Drawable &drawable, const RenderStates &states=RenderStates::Default)
Draw a drawable object to the render target.
void clear(const Color &color=Color(0, 0, 0, 255))
Clear the entire target with a single color.
Window that can serve as a target for 2D drawing.
virtual Vector2u getSize() const
Get the size of the rendering region of the window.
void setTextureRect(const IntRect &rect)
Set the sub-rectangle of the texture that the shape will display.
void setFillColor(const Color &color)
Set the fill color of the shape.
FloatRect getGlobalBounds() const
Get the global (non-minimal) bounding rectangle of the entity.
void setTexture(const Texture *texture, bool resetRect=false)
Change the source texture of the shape.
Storage for audio samples defining a sound.
bool loadFromFile(const std::string &filename)
Load the sound buffer from a file.
Regular sound that can be played in the audio environment.
void setBuffer(const SoundBuffer &buffer)
Set the source buffer containing the audio data to play.
void setVolume(float volume)
Set the volume of the sound.
Drawable representation of a texture, with its own transformations, color, etc.
void setTexture(const Texture &texture, bool resetRect=false)
Change the source texture of the sprite.
Graphical text that can be drawn to a render target.
void setFont(const Font &font)
Set the text's font.
void setString(const String &string)
Set the text's string.
void setFillColor(const Color &color)
Set the fill color of the text.
void setCharacterSize(unsigned int size)
Set the character size.
Image living on the graphics card that can be used for drawing.
bool loadFromFile(const std::string &filename, const IntRect &area=IntRect())
Load the texture from a file on disk.
Vector2u getSize() const
Return the size of the texture.
void setRepeated(bool repeated)
Enable or disable repeating.
float asSeconds() const
Return the time value as a number of seconds.
T x
X coordinate of the vector.
T y
Y coordinate of the vector.
bool pollEvent(Event &event)
Pop the event on top of the event queue, if any, and return it.
void close()
Close the window and destroy all the attached resources.
void display()
Display on screen what has been rendered to the window so far.
bool isOpen() const
Tell whether or not the window is open.
void setKeyRepeatEnabled(bool enabled)
Enable or disable automatic key-repeat.
void setFramerateLimit(unsigned int limit)
Limit the framerate to a maximum fixed frequency.
Vector2< unsigned int > Vector2u
Vector2< float > Vector2f
RectangleShape points[12]
Texture adventureBgTexture
Keyboard::Key code
Code of the key that has been pressed.