neingeist
/
cosmos
Archived
1
0
Fork 0

add new tiles

master
neingeist 11 years ago
parent d05e9594ac
commit 9c84917ff2

@ -1,6 +0,0 @@
all: data/sprites.json
data/sprites.json: asset/
spriter asset/
mv sprites.json data/
mv sprites.png images/

@ -0,0 +1,14 @@
all: ../data/sprites.json ../images/sprites.png ../images/tiles.png
../data/sprites.json: sprites/*.png
spriter sprites/
mv sprites.json ../data/
rm -f sprites.png
../images/sprites.png: sprites/*.png
spriter sprites/
rm -f sprites.json
mv sprites.png ../images/
../images/tiles.png: tiles/*.png
montage -tile 1x -geometry 24x24+0+0 -background Transparent $^ $@

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,16 +1,16 @@
[
[ 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],
[ 1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],
[ 1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],
[ 1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1],
[ 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,2,1,1],
[ 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,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1,1,1,1,1,1,1,1,1,1,1,1,1],
[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[ 1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1],
[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1],
[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -30,7 +30,7 @@ Q.Sprite.extend("Player",{
// You can call the parent's constructor with this._super(..)
this._super(p, {
sheet: "astronaut", // Setting a sprite sheet sets sprite width and height
x: 410, // You can also set additional properties that can
x: 360, // You can also set additional properties that can
y: 90 // be overridden on object creation
});
@ -136,6 +136,8 @@ Q.scene("level1",function(stage) {
// Add in a tile layer, and make it the collision layer
stage.collisionLayer(new Q.TileLayer({
tileW: 24,
tileH: 24,
dataAsset: 'level.json',
sheet: 'tiles' }));
@ -149,11 +151,11 @@ Q.scene("level1",function(stage) {
stage.viewport.scale = 2;
// Add in a couple of enemies
stage.insert(new Q.Neingeist({ x: 700, y: 0 }));
stage.insert(new Q.Starbug({ x: 800, y: 0 }));
stage.insert(new Q.Starbug({ x: 600, y: 0 }));
stage.insert(new Q.Neingeist({ x: 650, y: 0 }));
// Finally add the cake
stage.insert(new Q.Cake({ x: 180, y: 50 }));
stage.insert(new Q.Cake({ x: 146, y: 36 }));
});
// To display a game over / game won popup box,
@ -176,8 +178,8 @@ Q.scene('endGame',function(stage) {
});
// Expand the container to visibily fit it's contents
// (with a padding of 20 pixels)
container.fit(20);
// (with a padding)
container.fit(16);
});
// ## Asset Loading and Game Launch
@ -186,7 +188,7 @@ Q.scene('endGame',function(stage) {
// The callback will be triggered when everything is loaded
Q.load("sprites.png, sprites.json, level.json, tiles.png, background.png", function() {
// Sprites sheets can be created manually
Q.sheet("tiles","tiles.png", { tilew: 32, tileh: 32 });
Q.sheet("tiles","tiles.png", { tilew: 24, tileh: 24 });
// Or from a .json asset that defines sprite locations
Q.compileSheets("sprites.png","sprites.json");