Mercurial > repos > genjam1
annotate src/map.c @ 23:330e58fb01aa
simple object selection
author | William Morgan <bill@mrgn.org> |
---|---|
date | Mon, 13 Jan 2014 23:05:30 -0800 |
parents | bb7dfb42b320 |
children |
rev | line source |
---|---|
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #include <genesis.h> |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #include "map.h" |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 u16 distances[20*14]; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 u16 tilemap[40*28]; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 typedef struct { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 u16 index; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 u16 x; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 u16 y; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 } mpoint; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
13 #define is_empty(tindex) (tilemap[tindex] == EMPTY_TA || tilemap[tindex] == SPAWN_UL) |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
14 |
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 s16 explore(mpoint * points, s16 num_points, u16 src, u16 srcx, u16 srcy) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 u16 dist = distances[src]+1; |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
18 if (srcx < 19 && distances[src + 1] > dist && is_empty((srcx+1)*2+srcy*2*40)) |
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 distances[src + 1] = dist; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 points[num_points].index = src + 1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 points[num_points].x = srcx+1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 points[num_points++].y = srcy; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 } |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
25 if (srcx && distances[src - 1] > dist && is_empty((srcx-1)*2 + srcy*2*40)) |
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 distances[src - 1] = dist; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 points[num_points].index = src - 1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 points[num_points].x = srcx-1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 points[num_points++].y = srcy; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 } |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
32 if (srcy < 13 && distances[src + 20] > dist && is_empty(srcx*2+(srcy+1)*2*40)) |
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 distances[src + 20] = dist; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 points[num_points].index = src + 20; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 points[num_points].x = srcx; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 points[num_points++].y = srcy+1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 } |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
39 if (srcy && distances[src - 20] > dist && is_empty(srcx*2 + (srcy-1)*2*40)) |
20
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 distances[src - 20] = dist; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 points[num_points].index = src - 20; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 points[num_points].x = srcx; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 points[num_points++].y = srcy-1; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 return num_points; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 void gen_distances(u16 x, u16 y) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 //TODO: Figure out the actual maximum number of candidate points that can exist |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 mpoint pointsa[20*14]; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 mpoint pointsb[20*14]; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 mpoint *points=pointsa; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 mpoint *new_points; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 s16 num_points = 0, old_points; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 x /= 2; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 y /= 2; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 memset(distances, 0xFF, sizeof(distances)); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 distances[x + y*20] = 0; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
62 num_points = explore(points, num_points, x + y*20, x, y); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
63 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 while (num_points) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
65 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
66 new_points = points == pointsa ? pointsb : pointsa; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
67 old_points = num_points; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
68 for (num_points = 0, old_points--; old_points >= 0; old_points--) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
69 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
70 num_points = explore(new_points, num_points, points[old_points].index, points[old_points].x, points[old_points].y); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
71 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
72 points = new_points; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
73 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
74 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
75 |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
76 void print_distances(void) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
77 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
78 u16 x,y,tindex,dindex,dist; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
79 for (y = 0; y < 14; y++) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
81 dindex = y * 20; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
82 tindex = y * 2 * 40; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
83 for (x = 0; x < 20; x++, dindex++, tindex += 2) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 dist = distances[dindex]; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
86 if (dist < 10000) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
87 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
88 tilemap[tindex+41] = TILE_ATTR_FULL(3, 0, 0, 0, '0' - 32 + dist % 10 + TILE_FONTINDEX); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 dist /= 10; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
90 if (dist) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
91 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
92 tilemap[tindex+40] = TILE_ATTR_FULL(3, 0, 0, 0, '0' - 32 + dist % 10 + TILE_FONTINDEX); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
93 dist /= 10; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
94 if (dist) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
95 { |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
96 tilemap[tindex+1] = TILE_ATTR_FULL(3, 0, 0, 0, '0' - 32 + dist % 10 + TILE_FONTINDEX); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
97 dist /= 10; |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
98 if (dist) |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
99 tilemap[tindex] = TILE_ATTR_FULL(3, 0, 0, 0, '0' - 32 + dist % 10 + TILE_FONTINDEX); |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
100 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
101 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
102 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
103 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
104 } |
51a0972fcf76
Move some tilemap/distance stuff out of creep.c and main.c into a separate source file
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
105 } |
21
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
106 |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
107 u16 tileinfo[OBJECT_TYPES][4] = { |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
108 {EMPTY_TA, EMPTY_TA, EMPTY_TA, EMPTY_TA}, |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
109 {WALL_UL, WALL_UL, WALL_UL, WALL_UL}, |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
110 {TOWER_UL, TOWER_UL, TOWER_UL, TOWER_UL}, |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
111 {GOAL_UL, GOAL_UL, GOAL_UL, GOAL_UL}, |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
112 {SPAWN_UL, SPAWN_UL, SPAWN_UL, SPAWN_UL} |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
113 }; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
114 |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
115 void place_object(u16 type, u16 x, u16 y) |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
116 { |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
117 u16 tindex = x + y*40; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
118 tilemap[tindex] = tileinfo[type][0]; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
119 tilemap[tindex + 1] = tileinfo[type][1]; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
120 tilemap[tindex + 40] = tileinfo[type][2]; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
121 tilemap[tindex + 41] = tileinfo[type][3]; |
bb7dfb42b320
Small refactor to object placement. Add spawn point object
Michael Pavone <pavone@retrodev.com>
parents:
20
diff
changeset
|
122 } |