-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
58 lines (46 loc) · 902 Bytes
/
player.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* player.h
* S_01
*
* Created by Magnus Selin on 12/27/12.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <SFML/Graphics.hpp>
#include <iostream>
#include "datatypes.h"
#include "objects.h"
#include "view.h"
#include "vec2f.h"
class Player{
private:
sf::RenderWindow * window;
Vec2f p, op;
Vec2f v;
bool in_air;
My_view * view;
sf::Sprite sprite;
sf::Image image;
void chk_col(Object obj);
public:
Player(sf::RenderWindow * w){
window = w;
p[0] = 75;
p[1] = 200;
op = p;
v[0] = v[1] = 0;
in_air = true;
view = new My_view(window);
if (!image.LoadFromFile("blooby.png"))
std::cerr << "Couldn't load sprite!\n";
else{
sprite.SetImage(image);
std::cerr << "Loading image complete...!\n";
}
}
void draw();
void update(player_input input, Object * obj);
};
#endif