annotate src/main.c @ 18:60bb690233cf

merge
author William Morgan <bill@mrgn.org>
date Sun, 12 Jan 2014 19:11:54 -0800
parents ea345aa9cc30 a9500e8bff93
children 51a0972fcf76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #include <genesis.h>
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #include "creep.h"
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
4 // I now realize this should be one tile that uses the flipping flags. oops.
10
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
5 const u32 cursor_tiles[4*8] = {
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
6 0x21100000, // top left
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
7 0x10000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
8 0x10000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
9 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
10 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
11 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
12 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
13 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
14
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
15 0x00000000, // bottom left
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
16 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
17 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
18 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
19 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
20 0x10000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
21 0x10000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
22 0x21100000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
23
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
24 0x00000112, // top right
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
25 0x00000001,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
26 0x00000001,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
27 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
28 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
29 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
30 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
31 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
32
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
33 0x00000000, // bottom right
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
34 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
35 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
36 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
37 0x00000000,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
38 0x00000001,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
39 0x00000001,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
40 0x00000112,
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
41
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
42 };
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
43
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
44 #define EMPTY 0
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
45 #define WALL 'O'-32 + TILE_FONTINDEX
18
William Morgan <bill@mrgn.org>
parents: 17 16
diff changeset
46 #define TOWER TILE_ATTR_FULL(1, 0, 0, 0, 'T'-32 + TILE_FONTINDEX)
William Morgan <bill@mrgn.org>
parents: 17 16
diff changeset
47 #define GOAL TILE_ATTR_FULL(1, 0, 0, 0, 'G'-32 + TILE_FONTINDEX)
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
48
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
49 u16 tilemap[40*28];
7
3ed112d64b1b Added basic creep spawning code
Mike Pavone <pavone@retrodev.com>
parents: 4
diff changeset
50 u16 countdown;
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
51
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
52 int cursor_x = 0; // tiles
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
53 int cursor_y = 0; // tiles
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
54 int pixels_per_tile = 8;
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
55 const int cursor_width = 2; // tiles
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
56
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
57
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
58 u16 build_order[3] = {
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
59 EMPTY,
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
60 WALL,
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
61 TOWER,
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
62 };
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
63 u8 build_order_size = 3;
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
64 u8 running = 0;
10
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
65
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
66 void joy_event_handler(u16 joy, u16 changed, u16 state) {
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
67 u16 went_down = changed & state;
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
68 if (went_down & BUTTON_UP) {
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
69 cursor_y -= cursor_width;
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
70 }
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
71 if (went_down & BUTTON_DOWN) {
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
72 cursor_y += cursor_width;
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
73 }
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
74 if (went_down & BUTTON_LEFT) {
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
75 cursor_x -= cursor_width;
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
76 }
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
77 if (went_down & BUTTON_RIGHT) {
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
78 cursor_x += cursor_width;
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
79 }
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
80 if (went_down & BUTTON_A && !running) {
17
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
81 //u16 type_to_place = EMPTY;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
82 u16 type_to_place = WALL;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
83 tilemap[cursor_x + (cursor_y ) * 40] = type_to_place;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
84 tilemap[cursor_x + 1 + (cursor_y ) * 40] = type_to_place;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
85 tilemap[cursor_x + (cursor_y + 1) * 40] = type_to_place;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
86 tilemap[cursor_x + 1 + (cursor_y + 1) * 40] = type_to_place;
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
87 gen_distances(38, 14);
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
88 if (distances[122/16] == 0xFFFF)
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
89 {
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
90 tilemap[cursor_x + (cursor_y ) * 40] = 0;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
91 tilemap[cursor_x + 1 + (cursor_y ) * 40] = 0;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
92 tilemap[cursor_x + (cursor_y + 1) * 40] = 0;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
93 tilemap[cursor_x + 1 + (cursor_y + 1) * 40] = 0;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
94 }
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
95 }
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
96 if (went_down & BUTTON_START)
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
97 {
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
98 running = 1;
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
99 }
10
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
100 }
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
101
2
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
102 int main(void)
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 {
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
104 JOY_init();
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
105 JOY_setEventHandler(&joy_event_handler);
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
106
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
107 u8 cursor_tile_index = 1;
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
108 VDP_loadTileData((const u32 *)cursor_tiles, cursor_tile_index, 4, 0);
10
889227ec630c cursor and input code added.
William Morgan <bill@mrgn.org>
parents: 7
diff changeset
109
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
110 u16 i;
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
111 VDP_setPlanSize(64, 32);
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
112 /*for (i = 6; i < 40*28; i += 4)
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
113 if ((i > 80 || i & 4) && (i < 40*26 || !(i & 4)) && i % 40 < 38)
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
114 {
17
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
115 tilemap[i] = WALL;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
116 tilemap[i+1] = WALL;
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
117 }
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
118 */
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
119
17
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
120 tilemap[38 + 14*40] = GOAL;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
121 tilemap[39 + 14*40] = GOAL;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
122 tilemap[38 + 15*40] = GOAL;
ea345aa9cc30 using new tile constants
William Morgan <bill@mrgn.org>
parents: 15
diff changeset
123 tilemap[39 + 15*40] = GOAL;
13
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
124 for (i = 0; i < MAX_SPRITE; i++)
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
125 {
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
126 spriteDefCache[i].posx = -0x80;
d118fe8fb1db Make cursor and creeps play nice
Mike Pavone <pavone@retrodev.com>
parents: 12
diff changeset
127 }
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
128 gen_distances(38, 14);
11
c0bb53eaa6f4 Calculate distances from goal for all passible points for pathfinding purposes
Mike Pavone <pavone@retrodev.com>
parents: 7
diff changeset
129 //print_distances();
2
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 for (;;)
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131 {
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132 VDP_waitVSync();
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 VDP_updateSprites();
4
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
134 for (i = 0; i < 28; i++)
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
135 {
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
136 VDP_setTileMapRectByIndex(VDP_PLAN_B, tilemap + i*40, i*64, 40, 0);
d73f53857e5f Add placeholder walls and goal
Mike Pavone <pavone@retrodev.com>
parents: 2
diff changeset
137 }
15
f71eb24b3896 placement of red walls with a button
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
138 VDP_setSprite(0, cursor_x * pixels_per_tile, cursor_y * pixels_per_tile, SPRITE_SIZE(2,2), TILE_ATTR_FULL(PAL0, 1, 0, 0, cursor_tile_index), spriteDefCache[0].link);
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
139 if (running)
7
3ed112d64b1b Added basic creep spawning code
Mike Pavone <pavone@retrodev.com>
parents: 4
diff changeset
140 {
16
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
141 if (countdown)
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
142 --countdown;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
143 else if (cur_creeps < 4)
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
144 {
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
145 spawn_creep(CREEP_NORMAL, 4, 122);
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
146 countdown = 300;
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
147 }
a9500e8bff93 Wait to spawn creeps until player hits start. Prevent player from placing walls in such a way to completely block creeps from goal. Remove placeholder walls.
Mike Pavone <pavone@retrodev.com>
parents: 15
diff changeset
148 update_creeps();
7
3ed112d64b1b Added basic creep spawning code
Mike Pavone <pavone@retrodev.com>
parents: 4
diff changeset
149 }
2
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150 }
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151 return 0;
8f23be2db808 Movec creep.h into the src folder. Added main loop
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
152 }