separate images for targets and trampolines
15
js/Makefile
@ -6,13 +6,24 @@ MAPS+=$(wildcard ../maps/contest?.map ../maps/contest10.map)
|
|||||||
MAPS+=$(wildcard ../maps/ems*.map)
|
MAPS+=$(wildcard ../maps/ems*.map)
|
||||||
MAPS+=../maps/pacman.map ../maps/pacman2.map
|
MAPS+=../maps/pacman.map ../maps/pacman2.map
|
||||||
|
|
||||||
all: maps.js
|
all: maps.js sprites.png
|
||||||
|
|
||||||
maps.js: mapsToJson.js $(MAPS)
|
maps.js: mapsToJson.js $(MAPS)
|
||||||
./mapsToJson.js $(MAPS) > maps.js
|
./mapsToJson.js $(MAPS) > maps.js
|
||||||
|
|
||||||
|
SPRITES=earth.png empty.png lambda.png liftclosed.png liftopen.png robot.png rock.png wall.png
|
||||||
|
SPRITES+=$(wildcard trampoline?.png)
|
||||||
|
SPRITES+=$(wildcard target?.png)
|
||||||
|
|
||||||
|
sprites.png: $(SPRITES)
|
||||||
|
convert -background "#000000" -append $(SPRITES) tmp_sprites.png
|
||||||
|
pngcrush -rem alla tmp_sprites.png tmp_sprites1.png
|
||||||
|
rm tmp_sprites.png
|
||||||
|
optipng -o9 tmp_sprites1.png
|
||||||
|
mv tmp_sprites1.png sprites.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f maps.js
|
rm -f maps.js sprites.png
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ var mineGui_spriteOffset = {
|
|||||||
'O': 4,
|
'O': 4,
|
||||||
'.': 0,
|
'.': 0,
|
||||||
' ': 1,
|
' ': 1,
|
||||||
'A': 8,'B': 8,'C': 8,'D': 8,'E': 8,'F': 8,'G': 8,'H': 8,'I': 8,
|
'A': 8,'B': 9,'C':10,'D':11,'E':12,'F':13,'G':14,'H':15,'I':16,
|
||||||
'1': 9,'2': 9,'3': 9,'4': 9,'5': 9,'6': 9,'7': 9,'8': 9,'9': 9
|
'1':17,'2':18,'3':19,'4':20,'5':21,'6':22,'7':23,'8':24,'9':25
|
||||||
};
|
};
|
||||||
|
|
||||||
var mineGui_images = {};
|
var mineGui_images = {};
|
||||||
@ -214,7 +214,7 @@ function mineGui_show() {
|
|||||||
|
|
||||||
for (var y = 0; y < mineGui_mine.height; ++y) {
|
for (var y = 0; y < mineGui_mine.height; ++y) {
|
||||||
for (var x = 0; x < mineGui_mine.width; ++x) {
|
for (var x = 0; x < mineGui_mine.width; ++x) {
|
||||||
ctx.drawImage(sprites, mineGui_spriteOffset[map[y][x]] * 16, 0, 16, 16, 16*x, 16*y, 16, 16);
|
ctx.drawImage(sprites, 0, mineGui_spriteOffset[map[y][x]] * 16, 16, 16, 16*x, 16*y, 16, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.fillStyle = "#0000FF";
|
ctx.fillStyle = "#0000FF";
|
||||||
|
BIN
js/sprites.png
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
js/target1.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
js/target2.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
js/target3.png
Normal file
After Width: | Height: | Size: 651 B |
BIN
js/target4.png
Normal file
After Width: | Height: | Size: 664 B |
BIN
js/target5.png
Normal file
After Width: | Height: | Size: 639 B |
BIN
js/target6.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
js/target7.png
Normal file
After Width: | Height: | Size: 658 B |
BIN
js/target8.png
Normal file
After Width: | Height: | Size: 654 B |
BIN
js/target9.png
Normal file
After Width: | Height: | Size: 653 B |
BIN
js/trampolineA.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
js/trampolineB.png
Normal file
After Width: | Height: | Size: 600 B |
BIN
js/trampolineC.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
js/trampolineD.png
Normal file
After Width: | Height: | Size: 600 B |
BIN
js/trampolineE.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
js/trampolineF.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
js/trampolineG.png
Normal file
After Width: | Height: | Size: 598 B |
BIN
js/trampolineH.png
Normal file
After Width: | Height: | Size: 600 B |
BIN
js/trampolineI.png
Normal file
After Width: | Height: | Size: 599 B |