New Doodads: Bigger Doors
* The colored locked doors and the Electric Door are increased in size to better match Boy's sprite size. * Colored doors now have a "locked" and "unlocked" state when closed; when locked, a gold padlock hangs on the door with a keyhole shaped to match the corresponding Colored Key.
|
@ -9,7 +9,7 @@ function main() {
|
|||
|
||||
Self.SetMobile(true);
|
||||
Self.SetGravity(true);
|
||||
Self.SetHitbox(0, 0, 29, 52);
|
||||
Self.SetHitbox(0, 0, 16, 52);
|
||||
Self.AddAnimation("walk-left", 200, ["stand-left", "walk-left-1", "walk-left-2", "walk-left-3", "walk-left-2", "walk-left-1"]);
|
||||
Self.AddAnimation("walk-right", 200, ["stand-right", "walk-right-1", "walk-right-2", "walk-right-3", "walk-right-2", "walk-right-1"]);
|
||||
|
||||
|
|
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 884 B |
BIN
dev-assets/doodads/doors/blue-unlocked.png
Normal file
After Width: | Height: | Size: 906 B |
|
@ -2,19 +2,19 @@
|
|||
# doodad edit-doodad -q --tag color=red door-red.doodad
|
||||
# doodad install-script locked-door.js door-red.doodad
|
||||
|
||||
doodad convert -t "Red Door" red-closed.png red-right.png red-left.png door-red.doodad
|
||||
doodad convert -t "Red Door" red-closed.png red-unlocked.png red-right.png red-left.png door-red.doodad
|
||||
doodad edit-doodad -q --tag color=red door-red.doodad
|
||||
doodad install-script colored-door.js door-red.doodad
|
||||
|
||||
doodad convert -t "Blue Door" blue-closed.png blue-right.png blue-left.png door-blue.doodad
|
||||
doodad convert -t "Blue Door" blue-closed.png blue-unlocked.png blue-right.png blue-left.png door-blue.doodad
|
||||
doodad edit-doodad -q --tag color=blue door-blue.doodad
|
||||
doodad install-script colored-door.js door-blue.doodad
|
||||
|
||||
doodad convert -t "Green Door" green-closed.png green-right.png green-left.png door-green.doodad
|
||||
doodad convert -t "Green Door" green-closed.png green-unlocked.png green-right.png green-left.png door-green.doodad
|
||||
doodad edit-doodad -q --tag color=green door-green.doodad
|
||||
doodad install-script colored-door.js door-green.doodad
|
||||
|
||||
doodad convert -t "Yellow Door" yellow-closed.png yellow-right.png yellow-left.png door-yellow.doodad
|
||||
doodad convert -t "Yellow Door" yellow-closed.png yellow-unlocked.png yellow-right.png yellow-left.png door-yellow.doodad
|
||||
doodad edit-doodad -q --tag color=yellow door-yellow.doodad
|
||||
doodad install-script colored-door.js door-yellow.doodad
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
function main() {
|
||||
var color = Self.GetTag("color");
|
||||
var keyname = "key-" + color + ".doodad";
|
||||
|
@ -6,8 +5,9 @@ function main() {
|
|||
// Layers in the doodad image.
|
||||
var layer = {
|
||||
closed: 0,
|
||||
right: 1,
|
||||
left: 2,
|
||||
unlocked: 1,
|
||||
right: 2,
|
||||
left: 3,
|
||||
};
|
||||
|
||||
// Variables that change in event handler.
|
||||
|
@ -15,7 +15,7 @@ function main() {
|
|||
var opened = false; // If door is currently showing its opened state.
|
||||
var enterSide = 0; // Side of player entering the door, -1 or 1, left or right.
|
||||
|
||||
Self.SetHitbox(23, 0, 23, 64);
|
||||
Self.SetHitbox(34, 0, 13, 76);
|
||||
|
||||
Events.OnCollide(function(e) {
|
||||
// Record the side that this actor has touched us, in case the door
|
||||
|
@ -51,7 +51,7 @@ function main() {
|
|||
}
|
||||
});
|
||||
Events.OnLeave(function(e) {
|
||||
Self.ShowLayer(layer.closed);
|
||||
Self.ShowLayer(unlocked ? layer.unlocked : layer.closed);
|
||||
// Sound.Play("door-close.wav")
|
||||
|
||||
// Reset collision state.
|
||||
|
|
|
@ -6,7 +6,7 @@ function main() {
|
|||
var animating = false;
|
||||
var opened = false;
|
||||
|
||||
Self.SetHitbox(16, 0, 32, 64);
|
||||
Self.SetHitbox(0, 0, 34, 76);
|
||||
|
||||
Message.Subscribe("power", function(powered) {
|
||||
console.log("%s got power=%+v", Self.Title, powered);
|
||||
|
|
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 907 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 978 B |
Before Width: | Height: | Size: 989 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 875 B |
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 880 B |
BIN
dev-assets/doodads/doors/green-unlocked.png
Normal file
After Width: | Height: | Size: 888 B |
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 1010 B |
Before Width: | Height: | Size: 846 B After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 865 B |
BIN
dev-assets/doodads/doors/red-unlocked.png
Normal file
After Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 886 B |
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 883 B |
BIN
dev-assets/doodads/doors/yellow-unlocked.png
Normal file
After Width: | Height: | Size: 939 B |