@@ -6,20 +6,20 @@ use ggez::{
6
6
7
7
pub struct Death {
8
8
consolas : graphics:: Font ,
9
- ferris_planet : graphics:: Image
9
+ ferris_planet : graphics:: Image ,
10
10
}
11
11
12
12
impl Death {
13
13
pub fn spawn ( ctx : & mut Context ) -> Self {
14
14
Self {
15
15
consolas : graphics:: Font :: new ( ctx, "/Consolas.ttf" ) . unwrap ( ) ,
16
- ferris_planet : graphics:: Image :: new ( ctx, "/ferris_planet.png" ) . unwrap ( )
16
+ ferris_planet : graphics:: Image :: new ( ctx, "/ferris_planet.png" ) . unwrap ( ) ,
17
17
}
18
18
}
19
19
20
20
pub fn draw ( & mut self , ctx : & mut Context ) -> GameResult < ( ) > {
21
21
graphics:: clear ( ctx, graphics:: BLACK ) ;
22
-
22
+
23
23
let dead = Text :: new ( TextFragment {
24
24
// `TextFragment` stores a string, and optional parameters which will override those
25
25
// of `Text` itself. This allows inlining differently formatted lines, words,
@@ -33,7 +33,7 @@ impl Death {
33
33
// This doesn't do anything at this point; can be used to omit fields in declarations.
34
34
..Default :: default ( )
35
35
} ) ;
36
-
36
+
37
37
let unsafe_dead = Text :: new ( TextFragment {
38
38
// `TextFragment` stores a string, and optional parameters which will override those
39
39
// of `Text` itself. This allows inlining differently formatted lines, words,
@@ -47,7 +47,7 @@ impl Death {
47
47
// This doesn't do anything at this point; can be used to omit fields in declarations.
48
48
..Default :: default ( )
49
49
} ) ;
50
-
50
+
51
51
let unsafe_dead_block_start = Text :: new ( TextFragment {
52
52
// `TextFragment` stores a string, and optional parameters which will override those
53
53
// of `Text` itself. This allows inlining differently formatted lines, words,
@@ -61,7 +61,7 @@ impl Death {
61
61
// This doesn't do anything at this point; can be used to omit fields in declarations.
62
62
..Default :: default ( )
63
63
} ) ;
64
-
64
+
65
65
let unsafe_dead_block_func = Text :: new ( TextFragment {
66
66
// `TextFragment` stores a string, and optional parameters which will override those
67
67
// of `Text` itself. This allows inlining differently formatted lines, words,
@@ -75,7 +75,7 @@ impl Death {
75
75
// This doesn't do anything at this point; can be used to omit fields in declarations.
76
76
..Default :: default ( )
77
77
} ) ;
78
-
78
+
79
79
let unsafe_dead_block_end = Text :: new ( TextFragment {
80
80
// `TextFragment` stores a string, and optional parameters which will override those
81
81
// of `Text` itself. This allows inlining differently formatted lines, words,
@@ -89,7 +89,7 @@ impl Death {
89
89
// This doesn't do anything at this point; can be used to omit fields in declarations.
90
90
..Default :: default ( )
91
91
} ) ;
92
-
92
+
93
93
graphics:: draw (
94
94
ctx,
95
95
& dead,
@@ -98,7 +98,7 @@ impl Death {
98
98
y : 40.0 ,
99
99
} , ) ,
100
100
) ?;
101
-
101
+
102
102
graphics:: draw (
103
103
ctx,
104
104
& unsafe_dead,
@@ -107,7 +107,7 @@ impl Death {
107
107
y : 200.0 ,
108
108
} , ) ,
109
109
) ?;
110
-
110
+
111
111
graphics:: draw (
112
112
ctx,
113
113
& unsafe_dead_block_start,
@@ -116,7 +116,7 @@ impl Death {
116
116
y : 200.0 ,
117
117
} , ) ,
118
118
) ?;
119
-
119
+
120
120
graphics:: draw (
121
121
ctx,
122
122
& unsafe_dead_block_func,
@@ -125,7 +125,7 @@ impl Death {
125
125
y : 260.0 ,
126
126
} , ) ,
127
127
) ?;
128
-
128
+
129
129
graphics:: draw (
130
130
ctx,
131
131
& unsafe_dead_block_end,
@@ -134,7 +134,7 @@ impl Death {
134
134
y : 300.0 ,
135
135
} , ) ,
136
136
) ?;
137
-
137
+
138
138
graphics:: draw (
139
139
ctx,
140
140
& self . ferris_planet ,
@@ -144,7 +144,11 @@ impl Death {
144
144
) , ) ,
145
145
)
146
146
. unwrap ( ) ;
147
-
147
+
148
148
graphics:: present ( ctx)
149
- }
150
- }
149
+ }
150
+
151
+ pub fn update ( & self , _ctx : & mut Context ) -> GameResult {
152
+ Ok ( ( ) )
153
+ }
154
+ }
0 commit comments