Skip to content

Commit 93b6d95

Browse files
authored
Added a start screen (#8)
* added some ideas for ascii art title screens * separate window setup/ownership from running the game logic * game now transitions between a noop start screen and the game forever in a loop * going back n forth between a real title screen and the game screen * add menu options to the title screen * added cursor to title menu * added color to title ascii art * slight refactor to isolate the color system better * add demo for start screen * added final todo
1 parent db231b0 commit 93b6d95

File tree

6 files changed

+264
-48
lines changed

6 files changed

+264
-48
lines changed

demo/15-screens.gif

74.7 KB
Loading

misc/title.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_____________
2+
/\____________\ ___ _____ ___ . . ___ _____
3+
\/___/\ \___/ \___ \ \ _) \ \ \ ___ \
4+
\ \ \ \___ \ \ \ \___\ ___\ \
5+
\ \ \
6+
\ \___\
7+
\/___/
8+
9+
10+
11+
12+
> start game
13+
leaderboard

misc/title_atlas.txt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
\

readme.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Tetrust
22

3+
```
4+
_____________
5+
/\____________\ ___ _____ ___ . . ___ _____
6+
\/___/\ \___/ \___ \ \ _) \ \ \ ___ \
7+
\ \ \ \___ \ \ \ \___\ ___\ \
8+
\ \ \
9+
\ \___\
10+
\/___/
11+
```
12+
313
## Intent
414

515
- Practice rust
@@ -63,7 +73,7 @@
6373

6474
- [X] [Allow tetrominos to rotate](https://github.com/scottnm/tetrust/commit/3dd8bba32517b65c19e1ad4082612eb287630734)
6575

66-
![Image of pieces rotation](demo/09-rotation.gif)
76+
![Image of pieces rotating](demo/09-rotation.gif)
6777

6878
- [X] [Preview blocks](https://github.com/scottnm/tetrust/commit/c8e859c5857bb7a48843ab7108bff9692a0370e0)
6979

@@ -85,7 +95,11 @@
8595

8696
![Image of quick drop and drop preview](demo/14-quick-drop.gif)
8797

88-
- [ ] Add start screen
98+
- [X] [Add start screen](https://github.com/scottnm/tetrust/commit/FILLMEIN)
99+
100+
![Image of start screen](demo/15-screens.gif)
101+
89102
- [ ] Add high score logging
90103
- [ ] Add high score screen from start
104+
- [ ] Add CI/CD to github repo
91105

src/block.rs

-12
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,6 @@ impl BlockType {
151151
BlockType::L => '\\',
152152
}
153153
}
154-
155-
pub fn sprite_color(&self) -> i16 {
156-
match *self {
157-
BlockType::I => pancurses::COLOR_WHITE,
158-
BlockType::O => pancurses::COLOR_RED,
159-
BlockType::T => pancurses::COLOR_CYAN,
160-
BlockType::S => pancurses::COLOR_GREEN,
161-
BlockType::Z => pancurses::COLOR_MAGENTA,
162-
BlockType::J => pancurses::COLOR_YELLOW,
163-
BlockType::L => pancurses::COLOR_BLUE,
164-
}
165-
}
166154
}
167155

168156
impl Block {

0 commit comments

Comments
 (0)