diff 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
line wrap: on
line diff
--- a/src/main.c	Sun Jan 12 17:19:42 2014 -0800
+++ b/src/main.c	Sun Jan 12 18:16:51 2014 -0800
@@ -99,16 +99,14 @@
 			VDP_setTileMapRectByIndex(VDP_PLAN_B, tilemap + i*40, i*64, 40, 0);
 		}
 		VDP_setSprite(0, cursor_x, cursor_y, SPRITE_SIZE(2,2), TILE_ATTR_FULL(PAL0, 1, 0, 0, cursor_tile_index), spriteDefCache[0].link);
-		if (cur_creeps < 4)
+		if (countdown)
+			--countdown;
+		else if (cur_creeps < 4)
 		{
-			if (countdown)
-				--countdown;
-			else
-			{
-				spawn_creep(CREEP_NORMAL, 4, 122);
-				countdown = 300;
-			}
+			spawn_creep(CREEP_NORMAL, 4, 122);
+			countdown = 300;
 		}
+		update_creeps();
 	}
 	return 0;
 }