-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMove.cpp
More file actions
38 lines (34 loc) · 778 Bytes
/
Move.cpp
File metadata and controls
38 lines (34 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "Move.h"
Move::Move(SDL_Renderer* renderer,vector<Sprite*>sprites,vector<string>cancels,vector<Button*>buttons)
{
this->renderer=renderer;
for(int i=0;i<sprites.size();i++)
{
this->sprites.push_back(sprites[i]);
}
frame=0;
current_sprite_frame=0;
this->cancels = cancels;
this->buttons = buttons;
}
Move::~Move()
{
//dtor
}
void Move::draw(int current_sprite,int character_x, int character_y,bool flipped)
{
Sprite* sprite = sprites[current_sprite];
sprite->draw(character_x,character_y,flipped);
frame++;
}
bool Move::canCancel(string move_name)
{
for(int i=0;i<cancels.size();i++)
{
if(cancels[i]==move_name)
{
return true;
}
}
return false;
}