Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
GameTime.cpp
Go to the documentation of this file.
1
2/*
3 ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
4 ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
5 █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
6 ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
7 ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
8 ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
9 /vvvvvvvvvvvvvvvvvvv \=========================================,
10 `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
11 Katana Engine \/ © 2012 - Shuriken Studios LLC
12 http://www.shurikenstudios.com
13*/
14
15#include "KatanaEngine.h"
16
17namespace KatanaEngine
18{
19
21 {
22 m_previousTotalTime = al_get_time();
23 m_currentTotalTime = al_get_time();
24 m_elapsedTime = 0.0;
25 }
26
27 // Updates the timing values
28 void GameTime::Update()
29 {
30 m_previousTotalTime = m_currentTotalTime;
31 m_currentTotalTime = al_get_time();
32
33 if (m_currentTotalTime - m_previousTotalTime <= 0.2)
34 {
35 m_elapsedTime = (m_currentTotalTime - m_previousTotalTime);
36 }
37 else
38 {
39 std::cout << "Hopefully you were debugging!" << std::endl;
40 }
41 }
42}
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition Animation.cpp:18