This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Tortuga/client/player.h
T
2013-04-29 17:25:56 +10:00

37 lines
818 B
C++

#ifndef PLAYER_H_
#define PLAYER_H_
#include "defines.h"
#include "vector2.h"
#include "sprite_sheet.h"
#include "SDL/SDL.h"
class Player {
public:
Player(SDL_Surface*, int w, int h);
void Update(int delta);
void WalkInDirection(Direction);
Vector2 SetPosition(Vector2 v) { return position = v; }
Vector2 ShiftPosition(Vector2 v) { return position += v; }
Vector2 GetPosition() const { return position; };
Vector2 SetMotion(Vector2 v) { return motion = v; }
Vector2 ShiftMotion(Vector2 v) { return motion += v; }
Vector2 GetMotion() const { return motion; }
void DrawTo(SDL_Surface* const s) { sprite.DrawTo(s, position.x, position.y); }
void FaceDirection(Direction);
SpriteSheet* GetSpriteSheet() { return &sprite; };
private:
Vector2 position;
Vector2 motion;
SpriteSheet sprite;
};
#endif