Add wide rocks
This commit is contained in:
parent
d379eb4a30
commit
5badddd599
4 changed files with 15 additions and 3 deletions
BIN
assets/sprites/rock-wide.png
Normal file
BIN
assets/sprites/rock-wide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -48,6 +48,8 @@ Level = function(levelName) {
|
|||
|
||||
dolphin = Dolphin(level, level.map.spawn.axis, level.map.spawn.position, level.map.spawn.z);
|
||||
placeEntityInGrid(dolphin);
|
||||
camera.x = dolphin.position.x;
|
||||
camera.y = dolphin.position.y;
|
||||
initParaloop();
|
||||
|
||||
level.map.rocks.forEach(function(rock) {
|
||||
|
@ -471,6 +473,9 @@ Level = function(levelName) {
|
|||
if (pressOrTurbo("rocklg")) {
|
||||
spawnRock("large");
|
||||
}
|
||||
if (pressOrTurbo("rockwd")) {
|
||||
spawnRock("wide");
|
||||
}
|
||||
|
||||
function spawnRock(size) {
|
||||
var info = {
|
||||
|
|
|
@ -7,11 +7,16 @@ Rock = function(level, x, y, z, size) {
|
|||
z: ({
|
||||
small: 12,
|
||||
medium: 31,
|
||||
large: 47
|
||||
large: 47,
|
||||
wide: 12,
|
||||
})[size],
|
||||
tag: "geometry"
|
||||
};
|
||||
|
||||
if (size == "wide") {
|
||||
rock.bbox.x = rock.bbox.y = 47;
|
||||
}
|
||||
|
||||
rock.addSprite("sprite", Renderer.sprite("rock-" + size));
|
||||
rock.currentSprite("sprite");
|
||||
|
||||
|
|
|
@ -23,8 +23,10 @@ Input = (function() {
|
|||
rocksm: 49, // 1
|
||||
rockmed: 50,
|
||||
rocklg: 51,
|
||||
key: 52,
|
||||
door: 53,
|
||||
rockwd: 52,
|
||||
key: 53,
|
||||
door: 54,
|
||||
transition: 55,
|
||||
remove: 9, // Tab
|
||||
export: 192, // ~
|
||||
redkey: 82, // R
|
||||
|
|
Loading…
Add table
Reference in a new issue