-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
map_coloring.go
46 lines (41 loc) · 1.36 KB
/
map_coloring.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
type mapColor struct {
background uint32
backgroundSoft uint32
foreground uint32
ladders uint32
borders uint32
entityCodes map[objectType]entityColor
}
type entityColor struct {
r uint32
g uint32
b uint32
a uint32
}
func (m *mapColor) generateColors(maptype mapType) {
// Randomize within palettes different
// types of coloring schemes depending
// on map type.
}
func (m *mapColor) create() {
// default colors
m.background = 0x000000FF
m.backgroundSoft = 0x3e585cFF
m.foreground = 0x3d6253FF
m.ladders = 0x8b4513FF
m.borders = 0xFF0000FF
// Color codes for items in the map (image)
// Must correspond with the image colors.
m.entityCodes = make(map[objectType]entityColor)
m.entityCodes[mobPlayer] = entityColor{0, 0xFFFF, 0, 0}
m.entityCodes[itemCrate] = entityColor{0xFFFF, 0xFFFF, 0xFFFF, 0}
m.entityCodes[weaponAk47] = entityColor{0xFFFF, 0xFFFF, 0, 0}
m.entityCodes[mobEnemy1] = entityColor{0, 0, 0xFFFF, 0}
m.entityCodes[lampRegular] = entityColor{0, 0, 0xFFFF, 0}
m.entityCodes[itemPowerupHealth] = entityColor{0xFFFF, 0, 0xFFFF, 0}
m.entityCodes[itemPortal] = entityColor{0xFFFF, 0xFFFF, 0xAAAA, 0}
m.entityCodes[itemDoor] = entityColor{0xFFFF, 0xAAAA, 0xFFFF, 0}
m.entityCodes[lampRegular] = entityColor{0xAAAA, 0xAAAA, 0xFFFF, 0}
m.entityCodes[explosiveClusterMine] = entityColor{0xAAAA, 0xAAAA, 0xAAAA, 0}
}