Commit f5976903 authored by pa's avatar pa

Changed textures

parent 0d6fb841
_build/
sfml-app
lsv-fighters
.*
......@@ -9,7 +9,7 @@ PARAMS= -lsfml-graphics
PARAMS+= -lsfml-window
PARAMS+= -lsfml-system
all : sfml-app dir
all : dir lsv-fighters
dir :
mkdir -p $(BUILD_DIR)$(SOURCE_DIR)
......@@ -17,7 +17,7 @@ dir :
$(BUILD_DIR)%.o : %.cpp $(HEADERS)
g++ -c $< -o $@
sfml-app : $(TARGETS)
lsv-fighters : $(TARGETS)
g++ $(TARGETS) -o $@ $(PARAMS)
clean :
......
......@@ -20,6 +20,7 @@ class HUD{
void draw();
void update(sf::Time dt);
void updateHUDlocator(HUD_data* data){mData = data;}
private :
void loadTextures();
......
......@@ -16,6 +16,8 @@ public :
Carte(TextureHolder &textures, sf::IntRect& bounds, float r, float alpha, float inDepth, int n,
World* world=nullptr);
~Carte();
void move(Door::Dir dir){
mX += xOfDir(dir); mY += yOfDir(dir);
}
......
......@@ -14,7 +14,7 @@ public :
private :
sf::RenderWindow mWindow;
World mWorld;
World *mWorld;
HUD mHUD;
sf::Time TimePerFrame;
};
......
......@@ -23,6 +23,7 @@
class World : private sf::NonCopyable{
public:
explicit World(sf::RenderWindow& window);
~World();
void update(sf::Time dt);
void draw();
......
res/coin.png

1.44 KB | W: | H:

res/coin.png

554 Bytes | W: | H:

res/coin.png
res/coin.png
res/coin.png
res/coin.png
  • 2-up
  • Swipe
  • Onion skin
res/floor.png

717 KB | W: | H:

res/floor.png

954 Bytes | W: | H:

res/floor.png
res/floor.png
res/floor.png
res/floor.png
  • 2-up
  • Swipe
  • Onion skin
res/hp_down.png

290 Bytes | W: | H:

res/hp_down.png

316 Bytes | W: | H:

res/hp_down.png
res/hp_down.png
res/hp_down.png
res/hp_down.png
  • 2-up
  • Swipe
  • Onion skin
res/hp_full.png

302 Bytes | W: | H:

res/hp_full.png

363 Bytes | W: | H:

res/hp_full.png
res/hp_full.png
res/hp_full.png
res/hp_full.png
  • 2-up
  • Swipe
  • Onion skin
res/key.png

244 Bytes | W: | H:

res/key.png

581 Bytes | W: | H:

res/key.png
res/key.png
res/key.png
res/key.png
  • 2-up
  • Swipe
  • Onion skin
res/poison.png

246 Bytes | W: | H:

res/poison.png

484 Bytes | W: | H:

res/poison.png
res/poison.png
res/poison.png
res/poison.png
  • 2-up
  • Swipe
  • Onion skin
res/qProjectile.png

307 Bytes | W: | H:

res/qProjectile.png

882 Bytes | W: | H:

res/qProjectile.png
res/qProjectile.png
res/qProjectile.png
res/qProjectile.png
  • 2-up
  • Swipe
  • Onion skin
res/tProjectile.png

298 Bytes | W: | H:

res/tProjectile.png

877 Bytes | W: | H:

res/tProjectile.png
res/tProjectile.png
res/tProjectile.png
res/tProjectile.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -12,6 +12,13 @@ Carte::Carte(TextureHolder& textures, sf::IntRect& bounds, float r, float alpha,
firstPass(textures, bounds, r, alpha, inDepth);
}
Carte::~Carte(){
for(int i = 0 ; i < mWidth ; ++i)
for(int j = 0 ; j < mWidth ; ++j)
if (i!= mX && j != mY) delete mCarte[i*mWidth + j];
}
int Carte::xOfDir(Door::Dir dir){
switch(dir){
case Door::UP: case Door::DOWN: return 0;
......
#include "../headers/game.hpp"
#include "../headers/HUD.hpp"
Game::Game() : mWindow(sf::VideoMode(1920, 1080), "LSV Fighters"), mWorld(mWindow), mHUD(mWindow,mWorld.getHUDLocator()){
Game::Game() : mWindow(sf::VideoMode(1920, 1080), "LSV Fighters"), mWorld(new World(mWindow)),
mHUD(mWindow,mWorld->getHUDLocator()){
TimePerFrame = sf::seconds(1.f/60.f);
}
......@@ -27,17 +29,21 @@ void Game::processEvents(){
}
}
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl)
&& sf::Keyboard::isKeyPressed(sf::Keyboard::Q)) mWindow.close();
&& sf::Keyboard::isKeyPressed(sf::Keyboard::Q)) mWindow.close();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl)
&& sf::Keyboard::isKeyPressed(sf::Keyboard::R)){
delete mWorld; mWorld = new World(mWindow); mHUD.updateHUDlocator(mWorld->getHUDLocator());
}
}
void Game::update(sf::Time deltaTime){
mWorld.update(deltaTime);
mWorld->update(deltaTime);
mHUD.update(deltaTime);
}
void Game::render(){
mWindow.clear();
mWorld.draw();
mWorld->draw();
mHUD.draw();
mWindow.display();
}
......
......@@ -112,9 +112,9 @@ float Room::getDoorPlacement_X(Door::Dir dir){
case Door::UP : case Door::DOWN :
return 0.5f;
case Door::LEFT :
return 0.05f;
return 0.01f;
case Door::RIGHT :
return 0.95f;
return 0.99f;
}
}
......@@ -123,9 +123,9 @@ float Room::getDoorPlacement_Y(Door::Dir dir){
case Door::LEFT : case Door::RIGHT :
return 0.5f;
case Door::UP :
return 0.05f;
return 0.02f;
case Door::DOWN :
return 0.95f;
return 0.98f;
}
}
......
......@@ -24,6 +24,10 @@ World::World(sf::RenderWindow& window)
mData->meters[4].upType = Agent::Dagger; mData->meters[4].downType = Agent::Void;
}
World::~World(){
delete mData;
}
void World::fillData(){
mData->meters[0].cv = getPlayerHP();
mData->meters[1].cv = mPlayer->getPoisonStack();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment