Skip to content

Instantly share code, notes, and snippets.

@jseakle
Last active July 26, 2019 18:51
Show Gist options
  • Save jseakle/c68a847ec787d588359558e75c26560d to your computer and use it in GitHub Desktop.
Save jseakle/c68a847ec787d588359558e75c26560d to your computer and use it in GitHub Desktop.
Weird Bug (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Weird Bug
author Jonah Ostroff and Jake Eakle
color_palette amiga
background_color Black
(For help understanding how PuzzleScript works, check out the DOCS link at the top. The "Bird's-eye view" section is especially useful.)
========
OBJECTS
========
Goal
Red LightGreen
(Finalize graphics below.)
(0: Red, 1: Green, .: Blank)
.....
.0.0.
..1..
.0.0.
.....
Player
#F0F #F8F #80F
.1.1.
.000.
10201
.000.
11.11
DeadBug
#D8D #FCF #A5C
.1.1.
.000.
10201
.000.
11.11
Ant
Red #F75
..1..
.101.
..0..
.101.
.....
Background
#0B1104 #101804 #121808 #0D1D06
30222
31100
22223
00111
03330
Web
#F8FFFF
0.0.0
.0.0.
0.0.0
.0.0.
0.0.0
Wall
#BA9 #A98 #876 #987
01203
01201
21210
20113
20213
Pebble
#B84 #642
.111.
10001
10001
10001
.111.
Switch
#555 Yellow
.....
.000.
.010.
.000.
.....
Door
Yellow #A83 #555
22222
21012
20102
21012
22222
Gem
#08F #8FF
..0..
.010.
01110
.010.
..0..
Temp
White
.....
.....
.....
.....
.....
=======
LEGEND
=======
Blockable = Player or Pebble or Web or Ant or Gem (Objects that can be moved around and shouldn't overlap a wall.)
Blocking = Door or Wall (Objects that block movement.)
Weight = Player or Pebble or Gem or Ant (Objects that weigh down switches.)
Sticky = Pebble or Ant or Gem (Objects that stick to webs.)
Pushable = Pebble or Ant or Gem (Objects that can be pushed.)
(Character equivalences for level creation.)
@ = Player
. = Background
# = Wall
* = Pebble
O = Pebble and Web
~ = Web
+ = Door
! = Switch
G = Goal
A = Ant
? = Gem
=======
SOUNDS
=======
Pushable Move 80095707
Sfx1 73155703 (Web creation sound.)
Sfx2 56169902 (Web destruction sound.)
Sfx3 11025308 (Door open sound. I love it, sorry.)
Sfx4 85050702 (Death sound.)
sfx5 23117489 (Gem zapping Ant)
EndLevel 47272300
================
COLLISIONLAYERS
================
Background (Background.)
Goal Switch (Level features you can step on.)
Web (Webbing only.)
Door Wall Player Pebble Ant Gem DeadBug (Foreground: yourself, and other things you cannot step on.)
Temp (Invisible technical stuff for unlocking doors.)
======
RULES
======
(Player creates or destroys webs by pressing Action.)
[Action Player no Web] -> [Player Web] Sfx1
[Action Player Web] -> [Player] Sfx2
(Player pushes pushable objects.)
[> Player | Pushable] -> [> Player | > Pushable]
(Gems turn corners counterclockwise. Implemented in a simple gross way because the robust way is horrible)
[> Player | Gem | Blocking] -> [> Player | ^ Gem | Blocking]
[> Player | Gem | Pushable | Blocking] -> [> Player | ^ Gem | Pushable | Blocking]
[> Player | Gem | Pushable | Pushable | Blocking] -> [> Player | ^ Gem | Pushable | Pushable | Blocking]
(Code for propagating movement between webs and pushed objects. The + signs indicate that these rules are "grouped": they'll all keep happening, even out of order, until none of them can happen anymore. That means you can transfer movement from one pebble to another pebble, then from the second pebble to a web, then from that web to some adjacent web, then from THAT web to another pebble, etc.)
[> Sticky Web] -> [> Sticky > Web]
+[> Web Sticky] -> [> Web > Sticky]
+[> Pushable|Pushable] -> [> Pushable|> Pushable]
+[Moving Web|Web] -> [Moving Web|Moving Web]
(If a moving object hits an immovable object, cancel all movement.)
[> Blockable|Blocking] -> Cancel
(At end of turn, should we open doors? Put "Temp" on each door, then remove "Temp" if some switch is uncovered, then delete all switches and doors if Temp still remains.)
late[Door] -> [Temp Door]
late[Switch no Weight][Temp Door] -> [Switch][Door]
late[Temp Door][Switch] -> [Temp Door][]
late[Temp Door] -> [] Sfx3
(At end of turn, kill player if adjacent to ant.)
late[Player|Ant] -> [DeadBug|Ant] Sfx4
(Gem power!)
late[Gem | | Ant] -> [Gem | |] sfx5
==============
WINCONDITIONS
==============
All Player on Goal
No DeadBug
=======
LEVELS
=======
(Helpful reminder: you can command-click any level in the editor to immediately skip to that level.)
Message Make your way to the goal (the red and green thing).
#####################
#@#.#...............#
#.#...#######.#.###.#
#.###.#.....#.#.#.#.#
#..#..#.#.#.#.#.#.#.#
#*.##.#.#.#.......#.#
#..#..######.#.####.#
#.###.#...#..#....#.#
#.#...#.#.####.#.##.#
#...#.#.#......#.G#.#
#####################
Message Weigh down switches to open doors.
############
#...!..!...#
#..........#
##*##..##+##
#...#..#...#
#.@.#..#.G.#
#...#..#...#
############
Message Webs stick to pebbles.
###########
#.......###
#...!..*###
###....~~O#
#G+.@.....#
###.......#
#...!.!.###
#.......###
###########
Message Press X to create or remove webs.
#########
#....*..#
#.!...!.#
#...@..*#
#.......#
##+#..!.#
#G.#....#
#########
##############
#...*.....!#G#
#.#.#.#..#.#+#
#...........!#
#.#..#.#.#.#.#
#...@........#
#*#.#.#.#.#..#
#.!..........#
##############
#########
#.#.....#
#.##O!!.#
#@.O.!!.#
#.##*.#+#
#.#...#G#
#########
Message Don't touch fire ants!
#########
#.....#G#
#.!.*.#+#
#..@..#.#
#.!.!.#.#
#.....A.#
#########
#########
#.......#
#...@...#
#*.A!A..#
#.......#
#+......#
#G#######
###########
#.....#...#
#.*.@.+.G.#
#.....#...#
#.*.#######
#...AAAAAA#
#........!#
#.AAAAAAAA#
###########
Message Use the magic gem to get past the ants!
#############
#.....#.#.#G#
#.###.#.#.#.#
#.#.....A.A.#
#.###########
#...........#
#.#.###.#.#.#
#...#@.?#...#
#.#.#.###.#.#
#...........#
#############
#############
#G.A..#...+?#
###.###!*.#+#
#!#.........#
#.#####...@!#
#*..........#
#############
##############
#@.....#....g#
##...?.#.#####
#.a..#.#a#...#
##.#.#a#.#.*.#
##...###.....#
#a?..a.......#
##############
Message You win! You're welcome for all the help!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment