-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnotes.txt
More file actions
118 lines (93 loc) · 2.04 KB
/
notes.txt
File metadata and controls
118 lines (93 loc) · 2.04 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Display Graphics:
- Low resolution
- ASCII characters (subpixels, textures)
- Colors (foreground, background)
- Move the cursor's position freely
Input Handling:
- Canonical Mode - line based
- Non-Canonical Input Mode - More control over input
- RAW Input Mode
- Turn off Echo
Sound and Music:
- :(
- Terminal Bell - NO
Toolbox:
- man 3 termios
- ANSII Escape Codes - https://en.m.wikipedia.org/wiki/ANSI_escape_code
ANSI Escape Codes:
FG Color
Paremeters: R G B
printf "\x1B[:38;2;R;G;Bm"
BG Color
Paremeters: R G B
printf "\x1B[48;2;R;G;Bm"
Move Cursor to (x, y) - Upper Left Corner is (1, 1)
Paremeters: X Y
printf "\x1B[Y;XH"
Clear Screen
printf "\x1B[2J"
Hide Cursor
printf "\x1B[?25l"
Show Cursor
printf "\x1B[?25h"
Reset Colors
printf "\x1B[m"
Stages
Stage 1
- Non-canonical input mode
- Turning off echo
- Proper reset on exit (both for normal exit and abnormal exit)
- Rudimentary game loop
- Grab the arrow keys
- Print them out (e.g. RIGHT)
Stage 2
- Empty level with borders
- Player can walk around within the borders
Stage 3
- Optimize rendering
- Optimize game loop
Stage 4
- Load up level from a file
Stage 5
- Gameplay
Stage 6
- Tests
Stage 7
- Rendering
- Colors
- Animations?
Gameplay
Game Elements:
@ - Player Character
X - Wall
$ - Gems / Gold
O - Rock
. - Earth
- Space/Empty
E - Exit
Rules:
- Player can dig a tunnel through Earth
- Rocks/Gems fall down if there is space below them
- Rocks/Gems falling on Player ends the game -> Lose Scenario
- Player entering Exit ends the game -> Win scenario
- Player can't go through Wall, Rock
- Player can collect Gems
Composite Rules:
This is stable
.O.
.O.
This is unstable -> Top rock rolls to the left
. O..
. O..
This is unstable -> Top rock rolls to the right
..O .
..O .
However, this is stable
.O ...
XX XXX
Rocks and Gems behave similarly in most of the time.
For example, a Gem can kill the player if it falls on its head.
Player can push a rock horizontally if there is empty Space behind the Rock.
In the scenario below, the Player can push the rocks right or left.
.. O@O ..
.........