PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/CuiTetris/app.d

http://github.com/wilkie/djehuty
D | 39 lines | 26 code | 12 blank | 1 comment | 0 complexity | 88921df4e73f176ead6e90b6c14cc9da MD5 | raw file
 1import cui.application;
 2
 3import djehuty;
 4
 5import io.console;
 6
 7import gamewindow;
 8
 9import binding.c;
10
11class TermTetris : CuiApplication {
12
13	// Start an application instance
14	static this() { printf("HELLO!\n"); new TermTetris(); }
15
16	override void onApplicationStart() {
17		Console.putln("foo");
18		Console.hideCaret();
19
20		gameWindow = new GameWindow();
21
22		push(gameWindow);
23	}
24
25	override void onApplicationEnd() {
26		Console.clear();
27		Console.forecolor = Color.White;
28		Console.put("Your Score was: ");
29		Console.forecolor = Color.Yellow;
30		Console.putln(gameWindow.getScore());
31
32		Console.putln("");
33		Console.forecolor = Color.Gray;
34		Console.putln("Thank you for playing!");
35	}
36
37protected:
38	GameWindow gameWindow;
39}