-
Notifications
You must be signed in to change notification settings - Fork 2
/
sprite.cpp
70 lines (54 loc) · 1.96 KB
/
sprite.cpp
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
59
60
61
62
63
64
65
66
67
68
69
70
#include "sprite.h"
Sprite::Sprite(void){
load = { false };
if (!airTx.loadFromFile("data/blocks/airTx.png")) return;
if (!brickTx.loadFromFile("data/blocks/brickTx.gif")) return;
if (!stoneTx.loadFromFile("data/blocks/stoneTx.gif")) return;
if (!stoneBigTx.loadFromFile("data/blocks/stoneBigTx.gif")) return;
if (!greenTx.loadFromFile("data/blocks/greenTx.png")) return;
if (!waterTx.loadFromFile("data/blocks/waterTx.gif")) return;
//if (!roadTx.loadFromFile("data/roadTx_beta.jpg")) return;
// things from the menu
if (!backGroundTx.loadFromFile("data/battle-city_title.png")) return;
if (!controlTx.loadFromFile("data/control.png")) return;
// tank images
if (!tankGreenTx.loadFromFile("data/tanks/tankGreenTx.png")) return;
if (!tankYellowTx.loadFromFile("data/tanks/tankYellowTx.png")) return;
if (!tankRedTx.loadFromFile("data/tanks/tankRedTx.png")) return;
if (!tankGreyTx.loadFromFile("data/tanks/tankGreyTx.png")) return;
// bullet
if (!bulletTx.loadFromFile("data/bulletTx.png")) return;
// eagle
if (!EagleTx.loadFromFile("data/kurak/kurakTx.png")) return;
if (!EagleDeadTx.loadFromFile("data/kurak/kurakDeadTx.png")) return;
// explosion
if (!wybuchTx.loadFromFile("data/wybuchTx.gif")) return;
load = { true };
// load textures for sprites
// blocks
air.setTexture(airTx);
brick.setTexture(brickTx);
stone.setTexture(stoneTx);
stoneBig.setTexture(stoneBigTx);
green.setTexture(greenTx);
water.setTexture(waterTx);
//road.setTexture(roadTx);
//manu
backGround.setTexture(backGroundTx);
control.setTexture(controlTx);
tankIco.setTexture(tankYellowTx);
tankIco.setTextureRect(sf::IntRect(200, 0, 100, 100));
tankIco.rotate(90);
// tanks
tankGreen.setTexture(tankGreenTx);
tankYellow.setTexture(tankYellowTx);
tankRed.setTexture(tankRedTx);
tankGrey.setTexture(tankGreyTx);
// bullet
bullet.setTexture(bulletTx);
// eagle
Eagle.setTexture(EagleTx);
EagleDead.setTexture(EagleDeadTx);
// explosion
wybuch.setTexture(wybuchTx);
}