Commit 07567b8c authored by Sabrina Katharina Kotzem's avatar Sabrina Katharina Kotzem
Browse files

Merge branch 'feature/gameplay/commons' into feature/gameplay/tractorbeam

parents 913a1f5a 32feaaa7
......@@ -9,4 +9,5 @@ debug_render : false
shadow_resolution : 256
camX : 0
camY : -20
camZ : 60
\ No newline at end of file
camZ : 32
camAngle : 50
\ No newline at end of file
......@@ -4,6 +4,7 @@
#include <game_state_machine/game_state.h>
#include <gameplay/tractor_beam.h>
#include <memory>
#include <gameplay/gamemanager.h>
namespace gdw {
......
//
// Created by platon on 22.09.15.
//
#ifndef GDW_SS15_CPP_GAMEMANAGER_H
#define GDW_SS15_CPP_GAMEMANAGER_H
#include <gameplay/timer.h>
#include <core/engine.hpp>
namespace gdw {
class gamemanager {
public:
gamemanager(engine &engine);
int points();
int stage();
void add_points(int p);
void reset_points();
void next_stage();
void reset_stage();
timer get_timer();
private:
timer timer_;
int points_;
int stage_;
};
} //namespace gdw
#endif //GDW_SS15_CPP_GAMEMANAGER_H
#ifndef GDW_SS15_CPP_TIMER_H
#define GDW_SS15_CPP_TIMER_H
namespace gdw {
class timer {
public:
timer();
float time();
void start();
void stop();
void reset();
void update(float dt);
private:
float time_;
bool running;
};
} //namespace gdw
#endif //GDW_SS15_CPP_TIMER_H
......@@ -64,6 +64,8 @@ void play_state::update(float dt) {
void play_state::on_exit() {
// wcube_move_->set_angular_speed(3.f,5.f,1.f);
// //wcube2_move_->set_angular_speed(-3.f,-5.f,-1.f);
}
void play_state::handle_player_input() {
......
//
// Created by platon on 22.09.15.
//
#include <gameplay/gamemanager.h>
namespace gdw {
int gamemanager::points() {
return points_;
}
int gamemanager::stage() {
return stage_;
}
void gamemanager::add_points(int p) {
points_ += p;
}
void gamemanager::reset_points() {
points_ = 0;
}
timer gamemanager::get_timer() {
return timer_;
}
void gamemanager::next_stage() {
stage_++;
}
void gamemanager::reset_stage() {
stage_ = 0;
}
}
//
// Created by platon on 22.09.15.
//
#include <gameplay/timer.h>
#include <iostream>
namespace gdw {
timer::timer() {
time_ = 0.f;
}
float timer::time() {
return time_;
}
void timer::start() {
if (!running) running = true;
}
void timer::stop() {
if (running) running = false;
}
void timer::reset() {
stop();
time_ = 0.f;
}
void timer::update(float dt) {
time_ += dt;
std::cout<<time_<< "\n";
}
} //namespace gdw
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