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.SetMobile(true);
|
||||||
Self.SetGravity(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-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"]);
|
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 edit-doodad -q --tag color=red door-red.doodad
|
||||||
# doodad install-script locked-door.js 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 edit-doodad -q --tag color=red door-red.doodad
|
||||||
doodad install-script colored-door.js 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 edit-doodad -q --tag color=blue door-blue.doodad
|
||||||
doodad install-script colored-door.js 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 edit-doodad -q --tag color=green door-green.doodad
|
||||||
doodad install-script colored-door.js 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 edit-doodad -q --tag color=yellow door-yellow.doodad
|
||||||
doodad install-script colored-door.js door-yellow.doodad
|
doodad install-script colored-door.js door-yellow.doodad
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
var color = Self.GetTag("color");
|
var color = Self.GetTag("color");
|
||||||
var keyname = "key-" + color + ".doodad";
|
var keyname = "key-" + color + ".doodad";
|
||||||
|
@ -6,8 +5,9 @@ function main() {
|
||||||
// Layers in the doodad image.
|
// Layers in the doodad image.
|
||||||
var layer = {
|
var layer = {
|
||||||
closed: 0,
|
closed: 0,
|
||||||
right: 1,
|
unlocked: 1,
|
||||||
left: 2,
|
right: 2,
|
||||||
|
left: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Variables that change in event handler.
|
// Variables that change in event handler.
|
||||||
|
@ -15,7 +15,7 @@ function main() {
|
||||||
var opened = false; // If door is currently showing its opened state.
|
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.
|
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) {
|
Events.OnCollide(function(e) {
|
||||||
// Record the side that this actor has touched us, in case the door
|
// Record the side that this actor has touched us, in case the door
|
||||||
|
@ -51,7 +51,7 @@ function main() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Events.OnLeave(function(e) {
|
Events.OnLeave(function(e) {
|
||||||
Self.ShowLayer(layer.closed);
|
Self.ShowLayer(unlocked ? layer.unlocked : layer.closed);
|
||||||
// Sound.Play("door-close.wav")
|
// Sound.Play("door-close.wav")
|
||||||
|
|
||||||
// Reset collision state.
|
// Reset collision state.
|
||||||
|
|
|
@ -6,7 +6,7 @@ function main() {
|
||||||
var animating = false;
|
var animating = false;
|
||||||
var opened = false;
|
var opened = false;
|
||||||
|
|
||||||
Self.SetHitbox(16, 0, 32, 64);
|
Self.SetHitbox(0, 0, 34, 76);
|
||||||
|
|
||||||
Message.Subscribe("power", function(powered) {
|
Message.Subscribe("power", function(powered) {
|
||||||
console.log("%s got power=%+v", Self.Title, 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 |
2
go.sum
|
@ -62,6 +62,8 @@ github.com/stripe/safesql v0.2.0 h1:xiefmCDd8c35PVSGrL2FhBiaKxviXnGziBDOpOejeBE=
|
||||||
github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4=
|
github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4=
|
||||||
github.com/tomnomnom/xtermcolor v0.0.0-20160428124646-b78803f00a7e h1:Ee+VZw13r9NTOMnwTPs6O5KZ0MJU54hsxu9FpZ4pQ10=
|
github.com/tomnomnom/xtermcolor v0.0.0-20160428124646-b78803f00a7e h1:Ee+VZw13r9NTOMnwTPs6O5KZ0MJU54hsxu9FpZ4pQ10=
|
||||||
github.com/tomnomnom/xtermcolor v0.0.0-20160428124646-b78803f00a7e/go.mod h1:fSIW/szJHsRts/4U8wlMPhs+YqJC+7NYR+Qqb1uJVpA=
|
github.com/tomnomnom/xtermcolor v0.0.0-20160428124646-b78803f00a7e/go.mod h1:fSIW/szJHsRts/4U8wlMPhs+YqJC+7NYR+Qqb1uJVpA=
|
||||||
|
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 h1:vY5WqiEon0ZSTGM3ayVVi+twaHKHDFUVloaQ/wug9/c=
|
||||||
|
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk=
|
||||||
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
|
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
|
||||||
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
||||||
|
|