summary refs log tree commit diff stats
path: root/chlstate.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2009-06-22 10:02:20 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2009-06-22 10:02:20 -0400
commit49900856bece81481a56888b7bbce45bf746c422 (patch)
tree90920e11d68e5baed4aa1ce5bd9dcfa6b679661c /chlstate.cpp
parentbca5121051383933e5fdf15f6bcb04ddb797ac45 (diff)
downloadmazeoflife-49900856bece81481a56888b7bbce45bf746c422.tar.gz
mazeoflife-49900856bece81481a56888b7bbce45bf746c422.tar.bz2
mazeoflife-49900856bece81481a56888b7bbce45bf746c422.zip
Added Choose Highscore List state
Refs #104
Diffstat (limited to 'chlstate.cpp')
-rw-r--r--chlstate.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/chlstate.cpp b/chlstate.cpp new file mode 100644 index 0000000..24dd674 --- /dev/null +++ b/chlstate.cpp
@@ -0,0 +1,48 @@
1#include "includes.h"
2
3ChooseHighscoreListState::ChooseHighscoreListState()
4{
5 LOADIMAGE(background,chl)
6 LOADIMAGE(pointer,pointer)
7
8 selection = 0;
9
10 SDL_WM_SetCaption("Maze Of Life - Choose Highscore List", NULL);
11}
12
13void ChooseHighscoreListState::input(SDLKey key)
14{
15 if ((key == SDLK_UP) && (selection != 0))
16 {
17 selection--;
18 } else if ((key == SDLK_DOWN) && (selection != 2))
19 {
20 selection++;
21 } else if (key == SDLK_RETURN)
22 {
23 switch (selection)
24 {
25 case 0: // Go to local highscore list
26 break;
27 case 1: // Go to global highscore list
28 break;
29 case 2:
30 changeState(new TitleState());
31
32 break;
33 }
34 }
35}
36
37void ChooseHighscoreListState::render(SDL_Surface* screen)
38{
39 SDL_BlitSurface(background, NULL, screen, NULL);
40
41 SDL_Rect pSpace;
42 pSpace.x = 127;
43 pSpace.y = (selection==0?306:(selection==1?336:396));
44 pSpace.w = pointer->w;
45 pSpace.h = pointer->h;
46
47 SDL_BlitSurface(pointer, NULL, screen, &pSpace);
48}