diff --git a/dev-assets/doodads/boy/boy.js b/dev-assets/doodads/boy/boy.js index 9d17f5c..6d48705 100644 --- a/dev-assets/doodads/boy/boy.js +++ b/dev-assets/doodads/boy/boy.js @@ -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"]); diff --git a/dev-assets/doodads/doors/blue-closed.png b/dev-assets/doodads/doors/blue-closed.png index 8db25c4..c8e2c8b 100644 Binary files a/dev-assets/doodads/doors/blue-closed.png and b/dev-assets/doodads/doors/blue-closed.png differ diff --git a/dev-assets/doodads/doors/blue-left.png b/dev-assets/doodads/doors/blue-left.png index 5be63c3..98a5bfb 100644 Binary files a/dev-assets/doodads/doors/blue-left.png and b/dev-assets/doodads/doors/blue-left.png differ diff --git a/dev-assets/doodads/doors/blue-right.png b/dev-assets/doodads/doors/blue-right.png index af09c3e..472c545 100644 Binary files a/dev-assets/doodads/doors/blue-right.png and b/dev-assets/doodads/doors/blue-right.png differ diff --git a/dev-assets/doodads/doors/blue-unlocked.png b/dev-assets/doodads/doors/blue-unlocked.png new file mode 100644 index 0000000..660ce7b Binary files /dev/null and b/dev-assets/doodads/doors/blue-unlocked.png differ diff --git a/dev-assets/doodads/doors/build.sh b/dev-assets/doodads/doors/build.sh index 1cdf245..52d6e18 100755 --- a/dev-assets/doodads/doors/build.sh +++ b/dev-assets/doodads/doors/build.sh @@ -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 diff --git a/dev-assets/doodads/doors/colored-door.js b/dev-assets/doodads/doors/colored-door.js index 1967449..eaa1bcf 100644 --- a/dev-assets/doodads/doors/colored-door.js +++ b/dev-assets/doodads/doors/colored-door.js @@ -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. diff --git a/dev-assets/doodads/doors/electric-door.js b/dev-assets/doodads/doors/electric-door.js index 43056c6..8bc9b0e 100644 --- a/dev-assets/doodads/doors/electric-door.js +++ b/dev-assets/doodads/doors/electric-door.js @@ -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); diff --git a/dev-assets/doodads/doors/electric1.png b/dev-assets/doodads/doors/electric1.png index a9ca8a5..26a378b 100644 Binary files a/dev-assets/doodads/doors/electric1.png and b/dev-assets/doodads/doors/electric1.png differ diff --git a/dev-assets/doodads/doors/electric2.png b/dev-assets/doodads/doors/electric2.png index 09f24b1..95aad3e 100644 Binary files a/dev-assets/doodads/doors/electric2.png and b/dev-assets/doodads/doors/electric2.png differ diff --git a/dev-assets/doodads/doors/electric3.png b/dev-assets/doodads/doors/electric3.png index 912d766..ffaf07a 100644 Binary files a/dev-assets/doodads/doors/electric3.png and b/dev-assets/doodads/doors/electric3.png differ diff --git a/dev-assets/doodads/doors/electric4.png b/dev-assets/doodads/doors/electric4.png index 4519275..e54c18f 100644 Binary files a/dev-assets/doodads/doors/electric4.png and b/dev-assets/doodads/doors/electric4.png differ diff --git a/dev-assets/doodads/doors/green-closed.png b/dev-assets/doodads/doors/green-closed.png index 014d2db..e178cda 100644 Binary files a/dev-assets/doodads/doors/green-closed.png and b/dev-assets/doodads/doors/green-closed.png differ diff --git a/dev-assets/doodads/doors/green-left.png b/dev-assets/doodads/doors/green-left.png index 11b15c6..37728e5 100644 Binary files a/dev-assets/doodads/doors/green-left.png and b/dev-assets/doodads/doors/green-left.png differ diff --git a/dev-assets/doodads/doors/green-right.png b/dev-assets/doodads/doors/green-right.png index a057821..137716b 100644 Binary files a/dev-assets/doodads/doors/green-right.png and b/dev-assets/doodads/doors/green-right.png differ diff --git a/dev-assets/doodads/doors/green-unlocked.png b/dev-assets/doodads/doors/green-unlocked.png new file mode 100644 index 0000000..254fadb Binary files /dev/null and b/dev-assets/doodads/doors/green-unlocked.png differ diff --git a/dev-assets/doodads/doors/red-closed.png b/dev-assets/doodads/doors/red-closed.png index 0b02e02..57fa66a 100644 Binary files a/dev-assets/doodads/doors/red-closed.png and b/dev-assets/doodads/doors/red-closed.png differ diff --git a/dev-assets/doodads/doors/red-left.png b/dev-assets/doodads/doors/red-left.png index 4fce4f2..a345af8 100644 Binary files a/dev-assets/doodads/doors/red-left.png and b/dev-assets/doodads/doors/red-left.png differ diff --git a/dev-assets/doodads/doors/red-right.png b/dev-assets/doodads/doors/red-right.png index a9f7183..de5da7c 100644 Binary files a/dev-assets/doodads/doors/red-right.png and b/dev-assets/doodads/doors/red-right.png differ diff --git a/dev-assets/doodads/doors/red-unlocked.png b/dev-assets/doodads/doors/red-unlocked.png new file mode 100644 index 0000000..8124fb5 Binary files /dev/null and b/dev-assets/doodads/doors/red-unlocked.png differ diff --git a/dev-assets/doodads/doors/yellow-closed.png b/dev-assets/doodads/doors/yellow-closed.png index 8f1f008..867e05c 100644 Binary files a/dev-assets/doodads/doors/yellow-closed.png and b/dev-assets/doodads/doors/yellow-closed.png differ diff --git a/dev-assets/doodads/doors/yellow-left.png b/dev-assets/doodads/doors/yellow-left.png index 6d3946b..944a420 100644 Binary files a/dev-assets/doodads/doors/yellow-left.png and b/dev-assets/doodads/doors/yellow-left.png differ diff --git a/dev-assets/doodads/doors/yellow-right.png b/dev-assets/doodads/doors/yellow-right.png index 1eb9ac9..4b89710 100644 Binary files a/dev-assets/doodads/doors/yellow-right.png and b/dev-assets/doodads/doors/yellow-right.png differ diff --git a/dev-assets/doodads/doors/yellow-unlocked.png b/dev-assets/doodads/doors/yellow-unlocked.png new file mode 100644 index 0000000..da2d0e7 Binary files /dev/null and b/dev-assets/doodads/doors/yellow-unlocked.png differ diff --git a/go.sum b/go.sum index 1a7e73a..283977b 100644 --- a/go.sum +++ b/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/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/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/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=