-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameScript.cpp
More file actions
73 lines (49 loc) · 1.38 KB
/
GameScript.cpp
File metadata and controls
73 lines (49 loc) · 1.38 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#ifndef MCOM_GAMESCRIPT_CPP
#define MCOM_GAMESCRIPT_CPP
/* MCOM: GameScript
#include "GameScript.cpp"
Regulates the state of the game, plot, etc.
Uses IdleTickInterface to update.
*/
#include <Game/Terminal/Terminal.hpp>
#include "Terminal_Program_MissileCommand.cpp"
#include <Math/Random/RandomLehmer.hpp>
class GameScript: public IdleTickInterface, public LogicTickInterface
{
RandomLehmer rngLehmer;
public:
Terminal * terminal;
int mainSequence;
std::string strPlayerName;
Timer timerScriptUpdate;
Timer timerGameTime;
Terminal_Program_MissileCommand mcom;
GameScript(): mcom(&menuTitle.terminal)
{
mainSequence=0;
terminal = &menuTitle.terminal;
strPlayerName="";
timerScriptUpdate.init();
timerScriptUpdate.start();
timerGameTime.init();
timerGameTime.start();
terminal->cursorVisible=false;
terminal->amountStatic=0;
mcom.active=true;
terminal->addProgram(&mcom);
}
void idleTick() override
{
if (terminal==0) { return; }
//terminal->amountStatic=255;
// terminal->fill(rngLehmer.rand8(),rngLehmer.rand8(),rngLehmer.rand8(),255);
//std::cout<<(int)rngLehmer.rand8()<<"\n";
return;
}
void logicTick() override
{
mcom.cycle();
}
};
#endif