Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2014 00:00
Show Gist options
  • Save anonymous/9882238 to your computer and use it in GitHub Desktop.
Save anonymous/9882238 to your computer and use it in GitHub Desktop.
title
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Attack of the Martian Giants
author Mark Richardson
noundo
realtime_interval 0.5
run_rules_on_level_start
========
OBJECTS
========
Background
Black
Milestone
#090 #0C0 #0F0
222..
11...
0....
.....
.....
Count5
#00B #00D #00F #22F #44F
..444
..333
..222
..111
..000
Count4
#00B #00D #00F #22F
.....
..333
..222
..111
..000
Count3
#00B #00D #00F
.....
.....
..222
..111
..000
Count2
#00B #00D
.....
.....
.....
..111
..000
Count1
#00B
.....
.....
.....
.....
..000
Count0
#00B
.....
.....
.....
.....
.....
Spawn
DarkGray
0....
0....
0....
0....
0....
Spawn2
Gray DarkGray Black
00001
00011
00121
01221
12221
TargetH
White
.....
..0..
00.00
..0..
.....
TargetV
White
..0..
..0..
.0.0.
..0..
..0..
RoadU
Yellow
.....
..0..
..0..
.....
.....
RoadD
Yellow
.....
.....
..0..
..0..
.....
RoadL
Yellow
.....
.....
.00..
.....
.....
RoadR
Yellow
.....
.....
..00.
.....
.....
Wall
Gray
BaseGood
Gray DarkGray Black
0000.
0000.
1111.
1221.
1221.
BaseRuin
Gray DarkGray Red Yellow
11111
13011
02103
10102
00011
LaserTower
Gray LightGray Red
00200
01210
22122
01210
00200
FireTower
Gray LightGray Red
02220
21112
21112
21112
02220
GunTower
Gray LightGray Yellow
00100
00200
12121
00200
00100
Enemy
LightGreen DarkGray Red
.111.
.020.
00000
.000.
00.00
LaserH
#F00 #800
.....
11111
00000
11111
.....
LaserV
#F00 #800
.101.
.101.
.101.
.101.
.101.
LaserX
#F00 #800
.101.
11011
00000
11011
.101.
Fire
Red Orange Yellow
.212.
21012
10001
21012
.212.
Active
White
.0.0.
0...0
.....
0...0
.0.0.
Acting
White
00000
0...0
0...0
0...0
00000
Selection
#00B #00D #00F #22F #44F
.....
01.10
.232.
..4..
.....
Death
Red
.....
.0.0.
..0..
.0.0.
.....
Player
White
0.0.0
.....
0...0
.....
0.0.0
=======
LEGEND
=======
. = Background
u = RoadU
d = RoadD
l = RoadL
r = RoadR
c = Count5
z = Count0
e = Count5 and Wall
f = Count0 and Wall
a = Milestone and e
# = Wall
b = BaseGood and Count5 and Player
s = Spawn and RoadR
t = Spawn2
p = Player
1 = LaserTower
2 = FireTower
3 = GunTower
y = Selection
Road = RoadU or RoadD or RoadL or RoadR
Count = Count0 or Count1 or Count2 or Count3 or Count4 or Count5
Target = TargetH or TargetV
Tower = LaserTower or FireTower or GunTower
Base = BaseGood or BaseRuin
Structure = Wall or Base or Tower or Spawn or Spawn2
Laser = LaserH or LaserV or LaserX
Weapon = Laser or Fire
LateDynamic = Tower or Milestone
Dynamic = LateDynamic or Enemy or Weapon
=======
SOUNDS
=======
SFX0 88932302 (Base damaged)
SFX1 81395702 (Base destroyed)
SFX2 41939501 (Laser)
SFX3 96499502 (Fire)
SFX4 43616502 (Gun)
================
COLLISIONLAYERS
================
Background
Active, Acting, Selection, Death
Count, Spawn, Target
Road, Milestone
Wall, Base, Tower, Enemy, Weapon, Spawn2
Player
======
RULES
======
(Initialise milestones)
up [ no Tower | Selection | | no Milestone ] -> [ | Selection | | Milestone ]
up [ no Tower | Selection | ... | no Milestone | no Milestone ] -> [ | Selection | ... | | Milestone ]
(Prime dynamic objects)
[ Dynamic ] -> [ action Dynamic ]
[ action Dynamic ] [ action Player ] -> [ Dynamic ] [ action Player ]
[ action Dynamic ] [ > Player ] -> [ Dynamic ] [ > Player ]
[ action Milestone no Wall ] -> [ Milestone ]
[ action LateDynamic ] -> [ Active LateDynamic ]
(Remove weapons)
[ action Weapon ] -> [ ]
(Buy tower)
up [ action Player Wall no Count ] [ Tower | Selection ] [ no Tower | Selection | Count5 | Count5 ] -> [ Player Tower Count5 ] [ Tower | Selection ] [ | Selection | | ]
up [ no Tower | Selection | ... | no Count | | Count ] -> [ | Selection | ... | Count | | ]
up [ no Tower | Selection | ... | no Count ] -> [ | Selection | ... | Count0 ]
(Select tower)
up [ action Player Tower no Count | no Selection ] [ Tower | Selection ] -> [ Player Tower | Selection ] [ Tower | ]
(Enemy walk)
[ action Enemy RoadU ] -> [ up Enemy RoadU ]
[ action Enemy RoadD ] -> [ down Enemy RoadD ]
[ action Enemy RoadL ] -> [ left Enemy RoadL ]
[ action Enemy RoadR ] -> [ right Enemy RoadR ]
(Enemy attack)
[ > Enemy | BaseGood Count5 ] -> [ | BaseGood Count4 ] SFX0
[ > Enemy | BaseGood Count4 ] -> [ | BaseGood Count3 ] SFX0
[ > Enemy | BaseGood Count3 ] -> [ | BaseGood Count2 ] SFX0
[ > Enemy | BaseGood Count2 ] -> [ | BaseGood Count1 ] SFX0
[ > Enemy | BaseGood Count1 ] -> [ | BaseRuin Count0 ] SFX1
[ > Enemy | BaseRuin Count0 ] -> [ | BaseRuin Count0 ]
(Tower cool down)
[ Active Tower Count1 ] -> [ Tower Count0 ]
[ Active Tower Count2 ] -> [ Tower Count1 ]
[ Active Tower Count3 ] -> [ Tower Count2 ]
[ Active Tower Count4 ] -> [ Tower Count3 ]
[ Active Tower Count5 ] -> [ Tower Count4 ]
(Spawn enemy)
startloop
random late up [ Active Milestone Wall Count1 | Wall Count0 ] [ Spawn no Enemy ] -> [ Acting Milestone Wall Count0 | Wall Count0 ] [ Spawn Enemy ]
+ late up [ Active Milestone Wall Count2 | Wall Count0 ] [ Spawn no Enemy ] -> [ Acting Milestone Wall Count1 | Wall Count0 ] [ Spawn Enemy ]
+ late up [ Active Milestone Wall Count3 | Wall Count0 ] [ Spawn no Enemy ] -> [ Acting Milestone Wall Count2 | Wall Count0 ] [ Spawn Enemy ]
+ late up [ Active Milestone Wall Count4 | Wall Count0 ] [ Spawn no Enemy ] -> [ Acting Milestone Wall Count3 | Wall Count0 ] [ Spawn Enemy ]
+ late up [ Active Milestone Wall Count5 | Wall Count0 ] [ Spawn no Enemy ] -> [ Acting Milestone Wall Count4 | Wall Count0 ] [ Spawn Enemy ]
endloop
late up [ Active Milestone Wall Count5 | Wall Count | Wall Count0 ] -> [ Wall Count5 | Wall Count Milestone | Wall Count0 ]
late up [ Active Milestone Wall Count5 | Wall Count5 | Wall Count ] -> [ Wall Count5 | Wall Count5 | Wall Count Milestone ]
late up [ no Wall | Wall Count | ... | Acting Milestone ] -> [ | Wall Count Milestone | ... | ]
late [ Acting Milestone ] -> [ Milestone ]
(Start laser tower)
startloop
late random [ Active LaserTower Count0 ] -> [ Acting LaserTower Count0 ]
(Start laser)
late horizontal [ Acting LaserTower | no Target no Structure ] -> [ Acting LaserTower | TargetH ]
late vertical [ Acting LaserTower | no Target no Structure ] -> [ Acting LaserTower | TargetV ]
(Extend laser)
late horizontal [ TargetH no Enemy | no TargetH no Structure ] -> [ TargetH | TargetH ]
late vertical [ TargetV no Enemy | no TargetV no Structure ] -> [ TargetV | TargetV ]
(Use laser if enemy hit)
late [ Enemy Target ] [ Acting LaserTower Count0 ] -> [ Death Target ] [ Acting LaserTower Count5 ] SFX2
(Cash in killed enemy)
late up [ Death ] [ no Tower | Selection | ... | Count4 ] -> [ Acting ] [ | Selection | ... | Count5 ]
late up [ Death ] [ no Tower | Selection | ... | Count3 ] -> [ Acting ] [ | Selection | ... | Count4 ]
late up [ Death ] [ no Tower | Selection | ... | Count2 ] -> [ Acting ] [ | Selection | ... | Count3 ]
late up [ Death ] [ no Tower | Selection | ... | Count1 ] -> [ Acting ] [ | Selection | ... | Count2 ]
late up [ Death ] [ no Tower | Selection | ... | Count0 ] -> [ Acting ] [ | Selection | ... | Count1 ]
late [ Death ] -> [ Acting ]
(Draw laser)
late [ Acting Target | Target ] -> [ Acting Target | Acting Target ]
late [ Acting Target Laser ] -> [ LaserX ]
late [ Acting TargetH ] -> [ LaserH ]
late [ Acting TargetV ] -> [ LaserV ]
late [ Target ] -> [ ]
(Stop laser tower)
late [ Acting LaserTower ] -> [ LaserTower ]
endloop
late [ Active LaserTower ] -> [ LaserTower ]
(Start fire tower)
late [ Active FireTower Count0 | Enemy ] -> [ Acting FireTower Count5 | Enemy ] SFX3
(Cash in killed enemies)
startloop
random late [ Acting FireTower | Enemy ] -> [ Acting FireTower | Fire Death ]
late up [ Death ] [ no Tower | Selection | ... | Count4 ] -> [ ] [ | Selection | ... | Count5 ]
late up [ Death ] [ no Tower | Selection | ... | Count3 ] -> [ ] [ | Selection | ... | Count4 ]
late up [ Death ] [ no Tower | Selection | ... | Count2 ] -> [ ] [ | Selection | ... | Count3 ]
late up [ Death ] [ no Tower | Selection | ... | Count1 ] -> [ ] [ | Selection | ... | Count2 ]
late up [ Death ] [ no Tower | Selection | ... | Count0 ] -> [ ] [ | Selection | ... | Count1 ]
endloop
(Throw fire around)
late [ Acting FireTower | no Structure no Fire ] -> [ Acting FireTower | Fire ]
late [ Acting FireTower ] -> [ FireTower ]
late [ Active FireTower ] -> [ FireTower ]
late [ Death ] -> [ ]
(Start gun tower)
startloop
random late [ Active GunTower Count0 | Enemy ] -> [ GunTower Count3 | Fire Death ] SFX4
(Cash in killed enemy)
late up [ Death ] [ no Tower | Selection | ... | Count4 ] -> [ ] [ | Selection | ... | Count5 ]
late up [ Death ] [ no Tower | Selection | ... | Count3 ] -> [ ] [ | Selection | ... | Count4 ]
late up [ Death ] [ no Tower | Selection | ... | Count2 ] -> [ ] [ | Selection | ... | Count3 ]
late up [ Death ] [ no Tower | Selection | ... | Count1 ] -> [ ] [ | Selection | ... | Count2 ]
late up [ Death ] [ no Tower | Selection | ... | Count0 ] -> [ ] [ | Selection | ... | Count1 ]
endloop
late [ Active GunTower ] -> [ GunTower ]
late [ Death ] -> [ ]
==============
WINCONDITIONS
==============
no Count5 on Wall
no Count4 on Wall
no Count3 on Wall
no Count2 on Wall
no Count1 on Wall
no Enemy
no BaseRuin
=======
LEVELS
=======
message Giant Martian monsters are storming our outposts! It's up to you to defend the base.
message You are authorised to use the following, from left to right: long range SolTech laser cannons, wide area napalm storage tanks, and rapid fire explosive shells.
message Collect resources from fallen Martians. Select your weapons and build them on the roadside.
message Sector 1
f##############.z
e##rrrrrrrrd###.z
et#u#######d###.z
esru#dllllll#b#.c
e####d#######u#.c
e####rrrrrrrru#.c
a##############.c
.......y........y
.......123.......
message Sector 2
f################.z
e##rrrd##rrrd####.z
e##u##d##u##d####.z
et#u##d##u##d####.z
esru##d##u##d##b#.z
e#####d##u##d##u#.c
e#####d##u##d##u#.c
e#####rrru##rrru#.c
a################.c
........y.........y
........123........
message Sector 3
ff#############.z
ee#rrrrrrrrrrd#.z
ee#urrrrrrrrdd#.z
ee#uu#######dd#.z
ee#uulll#dllld#.z
ee#ulllu#ddlll#.z
ee#t##uu#dd####.z
eetsd#uu#dd#rb#.z
eesdd#uu#dd#uu#.c
ea#drruu#drruu#.c
ee#rrrru#rrrru#.c
ae#############.c
.......y........y
.......123.......
message Sector 4
fff######################.z
eee#####rrrd##rrrd##rrrd#.z
eee#####u##rrru##rrru##d#.z
eee##t##u##############d#.z
eee#tsrrudrdrdrd#dllllll#.z
eeetsrrrrdududurrrrrrrrrb.c
eeasrrrrdrururuu#ullllll#.c
eee#####d##############u#.c
eae#####d##rrrd##rrrd##u#.c
eee#####rrru##rrru##rrru#.c
aee######################.c
............y.............y
............123............
message Excellent! You have defended all of our outposts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment