Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Noctis.cpp
- #include "Noctis.h"
- #include "SDL.h"
- #include "SDL_image.h"
- #include "ImageLoader.h"
- #include "Characters.h"
- #include <iostream>
- Noctis::Noctis(std::string path, SDL_Rect characterClip, SDL_Rect characterViewport,SDL_Renderer *mainRenderer):
- Characters(path, characterClip, characterViewport, mainRenderer)
- {
- Noctis::setImages(characterMove);
- this->load = new ImageLoader(path, characterClip, characterViewport, mainRenderer);
- this->hp = 25;
- this->att = 3;
- }
- void attack()
- {
- }
- void setImages(SDL_Rect images[])
- {
- images[0].x = 311;
- images[0].y = 107;
- images[0].h = 75;
- images[0].w = 75;
- images[1].x = 406;
- images[1].y = 108;
- images[1].h = 75;
- images[1].w = 75;
- }
- //NOctis.h
- #ifndef NOCTIS_H
- #define NOCTIS_H
- #include "Characters.h"
- class Noctis : public Characters
- {
- public:
- Noctis(std::string path, SDL_Rect characterClip, SDL_Rect characterViewport,SDL_Renderer *mainRenderer);
- void attack();
- void setImages(SDL_Rect images[]);
- };
- #endif // NOCTIS_H
- //Characters.h
- #ifndef CHARACTERS_H
- #define CHARACTERS_H
- #include "SDL.h"
- #include "ImageLoader.h"
- #include "HealthBar.h"
- class Characters
- {
- public:
- Characters(std::string path, SDL_Rect characterClip, SDL_Rect characterViewport,SDL_Renderer *mainRenderer);
- SDL_Rect characterViewport;
- SDL_Rect characterClip;
- HealthBar *hpBar;
- void attack();
- void movement(std::string moves);
- void setImages(SDL_Rect images[]);
- ImageLoader *load;
- int maxHp;
- int hp;
- int att;
- int frame;
- SDL_Rect characterMove[2];
- };
- #endif // CHARACTERS_H
- //Characters.cpp
- #include "Characters.h"
- #include <iostream>
- #include "SDL.h"
- Characters::Characters(std::string path, SDL_Rect characterClip, SDL_Rect characterViewport,SDL_Renderer *mainRenderer)
- {
- }
- void movement(std::string moves)
- {
- }
- void setImages(SDL_Rect test)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement