Mercurial > MadButterfly
comparison examples/tank/tank_main.c @ 130:3a4d6179e6a9
change mb_c_source.m4 and mb_c_header.m4 to specify parent for SVG object
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 16 Sep 2008 21:23:34 +0800 |
parents | ba581d8a4b9b |
children | 6a8588df68af |
comparison
equal
deleted
inserted
replaced
129:ba581d8a4b9b | 130:3a4d6179e6a9 |
---|---|
150 tank_rt->mb_rt = mb_rt; | 150 tank_rt->mb_rt = mb_rt; |
151 for(i = 0; i < 12; i++) { | 151 for(i = 0; i < 12; i++) { |
152 for(j = 0; j < 16; j++) { | 152 for(j = 0; j < 16; j++) { |
153 switch(map[i][j]) { | 153 switch(map[i][j]) { |
154 case MUD: | 154 case MUD: |
155 mud = mud_new(rdman); | 155 mud = mud_new(rdman, rdman->root_coord); |
156 CHANGE_POS(mud, j * 50, i * 50); | 156 CHANGE_POS(mud, j * 50, i * 50); |
157 tank_rt->map[i][j] = (void *)mud; | 157 tank_rt->map[i][j] = (void *)mud; |
158 break; | 158 break; |
159 case BRI: | 159 case BRI: |
160 brick = brick_new(rdman); | 160 brick = brick_new(rdman, rdman->root_coord); |
161 CHANGE_POS(brick, j * 50, i * 50); | 161 CHANGE_POS(brick, j * 50, i * 50); |
162 tank_rt->map[i][j] = (void *)brick; | 162 tank_rt->map[i][j] = (void *)brick; |
163 break; | 163 break; |
164 case ROC: | 164 case ROC: |
165 rock = rock_new(rdman); | 165 rock = rock_new(rdman, rdman->root_coord); |
166 CHANGE_POS(rock, j * 50, i * 50); | 166 CHANGE_POS(rock, j * 50, i * 50); |
167 tank_rt->map[i][j] = (void *)rock; | 167 tank_rt->map[i][j] = (void *)rock; |
168 break; | 168 break; |
169 case BSH: | 169 case BSH: |
170 bush = bush_new(rdman); | 170 bush = bush_new(rdman, rdman->root_coord); |
171 CHANGE_POS(bush, j * 50, i * 50); | 171 CHANGE_POS(bush, j * 50, i * 50); |
172 tank_rt->map[i][j] = (void *)bush; | 172 tank_rt->map[i][j] = (void *)bush; |
173 break; | 173 break; |
174 } | 174 } |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 tank_rt->tank1 = tank1_new(rdman); | 178 tank_rt->tank1 = tank1_new(rdman, rdman->root_coord); |
179 CHANGE_POS(tank_rt->tank1, 5 * 50, 11 * 50); | 179 CHANGE_POS(tank_rt->tank1, 5 * 50, 11 * 50); |
180 tank_rt->tank2 = tank2_new(rdman); | 180 tank_rt->tank2 = tank2_new(rdman, rdman->root_coord); |
181 CHANGE_POS(tank_rt->tank2, 10 * 50, 11 * 50); | 181 CHANGE_POS(tank_rt->tank2, 10 * 50, 11 * 50); |
182 for(i = 0; i < 3; i++) { | 182 for(i = 0; i < 3; i++) { |
183 tank_rt->tank_enemies[i] = tank_en_new(rdman); | 183 tank_rt->tank_enemies[i] = tank_en_new(rdman, rdman->root_coord); |
184 CHANGE_POS(tank_rt->tank_enemies[i], (2 + i * 3) * 50, 0); | 184 CHANGE_POS(tank_rt->tank_enemies[i], (2 + i * 3) * 50, 0); |
185 } | 185 } |
186 tank_rt->n_enemy = i; | 186 tank_rt->n_enemy = i; |
187 | 187 |
188 tank_rt->tank1_progm = mb_progm_new(4, rdman); | 188 tank_rt->tank1_progm = mb_progm_new(4, rdman); |