-
Notifications
You must be signed in to change notification settings - Fork 2
/
roguelike.cpp
46 lines (40 loc) · 1.78 KB
/
roguelike.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
#include<iostream>
#include<SFML/Graphics.hpp>
#include"Enemy.h"
#include<SFML/Window.hpp>
#include<SFML/Graphics/Texture.hpp>
using namespace std;
using namespace sf;
const int WindowHeight = 720;
const int WindowWidth = 1280;
int main()
{
RenderWindow window(VideoMode(WindowWidth, WindowHeight), "First Window");
window.setFramerateLimit(60);
Axe axe1("./picture/enemy/axe/axebanditrun.png",
"./picture/enemy/axe/AxeBanditAttack.png",
"./picture/enemy/axe/AxeBandit.png");
while (window.isOpen())
{
Event event;
window.clear();
axe1.run();
window.draw(axe1);
window.display();
while (window.pollEvent(event))
{
switch (event.type)
{
case Event::Closed:
window.close();
break;
case Event::KeyPressed:
if (event.key.code == Keyboard::Escape)
window.close();
break;
default:
break;
}
}
}
}