Mercurial > molko
comparison examples/example-action.c @ 140:453651d76f7c
core: upgrade message in terms of customization
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 13 Oct 2020 18:39:35 +0200 |
parents | 8b035f7f978a |
children | 4eeeccf2b732 |
comparison
equal
deleted
inserted
replaced
139:8b035f7f978a | 140:453651d76f7c |
---|---|
35 #include <core/window.h> | 35 #include <core/window.h> |
36 | 36 |
37 #include <assets/sprites/chest.h> | 37 #include <assets/sprites/chest.h> |
38 #include <assets/sprites/people.h> | 38 #include <assets/sprites/people.h> |
39 | 39 |
40 #define W 1280 | 40 #define W (1280) |
41 #define H 720 | 41 #define H (720) |
42 | |
43 #define MW (W * 0.75) | |
44 #define MH (H * 0.125) | |
45 #define MX ((W / 2) - (MW / 2)) | |
46 #define MY (100) | |
42 | 47 |
43 /* This is a stack of "parallel" events. */ | 48 /* This is a stack of "parallel" events. */ |
44 static struct action_stack events; | 49 static struct action_stack events; |
45 | 50 |
46 /* This is a stack of modal events. */ | 51 /* This is a stack of modal events. */ |
58 struct texture image; | 63 struct texture image; |
59 struct sprite sprite; | 64 struct sprite sprite; |
60 struct action event; | 65 struct action event; |
61 } chest = { | 66 } chest = { |
62 .msg = { | 67 .msg = { |
68 .x = MX, | |
69 .y = MY, | |
70 .w = MW, | |
71 .h = MH, | |
63 .text = { | 72 .text = { |
64 "100000 pièces.", | 73 "100000 pièces.", |
65 "Te voilà riche sale file de crevette." | 74 "Te voilà riche sale file de crevette." |
66 } | 75 } |
67 } | 76 } |
104 struct action script_act; | 113 struct action script_act; |
105 } guide = { | 114 } guide = { |
106 .msgs = { | 115 .msgs = { |
107 { | 116 { |
108 .msg = { | 117 .msg = { |
118 .x = MX, | |
119 .y = MY, | |
120 .w = MW, | |
121 .h = MH, | |
122 .delay = MESSAGE_DELAY_DEFAULT, | |
123 .flags = MESSAGE_FLAGS_FADEIN | MESSAGE_FLAGS_AUTOMATIC, | |
109 .text = { | 124 .text = { |
110 "Bienvenue dans ce monde Molko." | 125 "Bienvenue dans ce monde Molko." |
111 } | 126 } |
112 }, | 127 }, |
113 }, | 128 }, |
114 { | 129 { |
115 .msg = { | 130 .msg = { |
131 .x = MX, | |
132 .y = MY, | |
133 .w = MW, | |
134 .h = MH, | |
116 .text = { | 135 .text = { |
117 "Penses tu vraiment pouvoir me battre ?" | 136 "Penses tu vraiment pouvoir me battre ?" |
118 } | 137 } |
119 } | 138 } |
120 }, | 139 }, |
121 { | 140 { |
122 .msg = { | 141 .msg = { |
123 .flags = MESSAGE_QUESTION, | 142 .x = MX, |
143 .y = MY, | |
144 .w = MW, | |
145 .h = MH, | |
146 .flags = MESSAGE_FLAGS_QUESTION, | |
124 .text = { | 147 .text = { |
125 "Non j'ai la trouille.", | 148 "Non j'ai la trouille.", |
126 "Bien sûr, je suis la légende." | 149 "Bien sûr, je suis la légende." |
127 } | 150 } |
128 } | 151 } |
129 }, | 152 }, |
130 | 153 |
131 /* In case of NO. */ | 154 /* In case of NO. */ |
132 { | 155 { |
133 .msg = { | 156 .msg = { |
157 .x = MX, | |
158 .y = MY, | |
159 .w = MW, | |
160 .h = MH, | |
134 .text = { | 161 .text = { |
135 "Poule mouillée." | 162 "Poule mouillée." |
136 } | 163 } |
137 } | 164 } |
138 }, | 165 }, |
139 | 166 |
140 /* In case of YES. */ | 167 /* In case of YES. */ |
141 { | 168 { |
142 .msg = { | 169 .msg = { |
170 .x = MX, | |
171 .y = MY, | |
172 .w = MW, | |
173 .h = MH, | |
143 .text = { | 174 .text = { |
144 "Prépare toi à souffrir." | 175 "Prépare toi à souffrir." |
145 } | 176 } |
146 } | 177 } |
147 } | 178 } |