-
Notifications
You must be signed in to change notification settings - Fork 8
/
EndGame.cpp
80 lines (68 loc) · 1.48 KB
/
EndGame.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
71
72
73
74
75
76
77
78
79
80
#include "all.hpp"
#include <iomanip>
#include <SFML/Audio.hpp>
#include "MyGame.hpp"
#include "TextMap.hpp"
#include "EndGame.hpp"
#include "Music.hpp"
EndGame::EndGame()
{
music_ = new Music;
}
EndGame::~EndGame(void)
{
delete music_;
}
void EndGame::endMusic()
{
music_->stopSong();
}
void EndGame::startMusic()
{
mu = false;
}
void EndGame::initialize_()
{
this->textureP1w_ = gdl::Image::load("Textures/bombermanp1w.png");
this->textureP2w_ = gdl::Image::load("Textures/bombermanp2w.png");
this->textureIaa_ = gdl::Image::load("Textures/bomberman_ia.png");
}
void EndGame::initialize(void)
{
this->pos_.setPos(0.0, 0.0, 1.0);
this->initialize_();
}
void EndGame::initialize(float x, float y, float z)
{
this->pos_.setPos(x, y, z);
this->initialize_();
}
void EndGame::update()
{
camera_.initializeN();
}
void EndGame::draw(WhoWin who)
{
if(mu == false)
{
music_->playSong("endS");
mu = true;
}
this->update();
if(who == P1)
textureP1w_.bind();
else if (who == P2)
textureP2w_.bind();
else
textureIaa_.bind();
glClearColor(0.55f ,0.0f, 0.55f, 1.0f);
glClearDepth(1.0f);
glPushMatrix();
glBegin(GL_QUADS);
glTexCoord2d(0,0); glVertex3f(-BACKGROUND, BACKGROUND, BACKGROUND);
glTexCoord2d(0,1); glVertex3f(-BACKGROUND, -BACKGROUND, BACKGROUND);
glTexCoord2d(1,1); glVertex3f(BACKGROUND, -BACKGROUND, BACKGROUND);
glTexCoord2d(1,0); glVertex3f(BACKGROUND, BACKGROUND, BACKGROUND);
glEnd();
glPopMatrix();
}