-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathLion.cpp
More file actions
45 lines (35 loc) · 671 Bytes
/
Lion.cpp
File metadata and controls
45 lines (35 loc) · 671 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
39
40
41
42
43
44
45
#include "Lion.h"
#include <iostream>
using namespace std;
#include <SFML/Graphics.hpp>
sf::Texture* Lion::texture = NULL;
Lion::Lion()
{
}
Lion::Lion(double m, double b) : Animal(m, b)
{
}
Lion::Lion(double m, double b, int _x, int _y) : Animal(m, b, _x, _y)
{
}
Lion::~Lion()
{
}
void Lion::talk()
{
cout <<"Arrrrrr!" <<endl;
}
// Lion have a lot in common with cats.
// But cats are smarter.
// Better ask cats.
void Lion::setSprite()
{
if (!texture)
{
texture = new sf::Texture;
if (!texture->loadFromFile("res/lion.png"))
cout <<"Lion went wrong" <<endl;
}
s = new sf::Sprite;
s->setTexture(*texture);
}