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.
master
Noah 2020-12-29 17:24:42 -08:00
parent 1a66659143
commit dd48f8cfae
24 changed files with 11 additions and 11 deletions

View File

@ -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"]);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

View File

@ -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

View File

@ -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.

View File

@ -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);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B