Merge branch 'master' of github.com:matteodelabre/projet-cmi
This commit is contained in:
commit
c5a4402369
|
@ -2,10 +2,12 @@
|
|||
#define __PTF_ENGINE_HPP__
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include "object.hpp"
|
||||
#include "engine_state.hpp"
|
||||
#include "resource_manager.hpp"
|
||||
|
||||
|
||||
/**
|
||||
* La classe principale Engine coordonne les éléments
|
||||
* du jeu et organise le dessin des frames
|
||||
|
@ -15,6 +17,7 @@ private:
|
|||
sf::Clock clock;
|
||||
sf::RenderWindow window;
|
||||
sf::View view;
|
||||
sf::Music music;
|
||||
|
||||
EngineState state;
|
||||
ResourceManager resources;
|
||||
|
|
BIN
res/ball.bmp
BIN
res/ball.bmp
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
BIN
res/block.bmp
BIN
res/block.bmp
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
@ -16,7 +16,7 @@ void Block::draw(sf::RenderWindow& window, ResourceManager& resources) {
|
|||
Object::draw(window, resources);
|
||||
|
||||
// utilisation de la texture
|
||||
sprite.setTexture(resources.getTexture("block.bmp"));
|
||||
sprite.setTexture(resources.getTexture("block.png"));
|
||||
|
||||
// coloration du bloc en fonction de sa charge
|
||||
if (getCharge() > 0) {
|
||||
|
|
|
@ -16,6 +16,13 @@ Engine::Engine() : window(
|
|||
|
||||
void Engine::start() {
|
||||
float accumulator = 0;
|
||||
if (!music.openFromFile("./res/music_lvl1.wav"))
|
||||
{
|
||||
// erreur
|
||||
}
|
||||
music.play();
|
||||
music.setVolume(15);
|
||||
music.setLoop(true);
|
||||
|
||||
// boucle d'événements sur la fenêtre
|
||||
while (window.isOpen()) {
|
||||
|
|
|
@ -40,7 +40,7 @@ void Player::draw(sf::RenderWindow& window, ResourceManager& resources) {
|
|||
Object::draw(window, resources);
|
||||
|
||||
// utilisation de la texture
|
||||
sprite.setTexture(resources.getTexture("ball.bmp"));
|
||||
sprite.setTexture(resources.getTexture("ball.png"));
|
||||
|
||||
// déplacement du sprite à la position de la balle
|
||||
sprite.rotate(getVelocity().x * .1f);
|
||||
|
|
Loading…
Reference in New Issue