comparison src/main.c @ 14:5c7f33441e43

Creeps now move towards the goal
author Mike Pavone <pavone@retrodev.com>
date Sun, 12 Jan 2014 18:16:51 -0800
parents d118fe8fb1db
children f71eb24b3896
comparison
equal deleted inserted replaced
13:d118fe8fb1db 14:5c7f33441e43
97 for (i = 0; i < 28; i++) 97 for (i = 0; i < 28; i++)
98 { 98 {
99 VDP_setTileMapRectByIndex(VDP_PLAN_B, tilemap + i*40, i*64, 40, 0); 99 VDP_setTileMapRectByIndex(VDP_PLAN_B, tilemap + i*40, i*64, 40, 0);
100 } 100 }
101 VDP_setSprite(0, cursor_x, cursor_y, SPRITE_SIZE(2,2), TILE_ATTR_FULL(PAL0, 1, 0, 0, cursor_tile_index), spriteDefCache[0].link); 101 VDP_setSprite(0, cursor_x, cursor_y, SPRITE_SIZE(2,2), TILE_ATTR_FULL(PAL0, 1, 0, 0, cursor_tile_index), spriteDefCache[0].link);
102 if (cur_creeps < 4) 102 if (countdown)
103 --countdown;
104 else if (cur_creeps < 4)
103 { 105 {
104 if (countdown) 106 spawn_creep(CREEP_NORMAL, 4, 122);
105 --countdown; 107 countdown = 300;
106 else
107 {
108 spawn_creep(CREEP_NORMAL, 4, 122);
109 countdown = 300;
110 }
111 } 108 }
109 update_creeps();
112 } 110 }
113 return 0; 111 return 0;
114 } 112 }