Make Your Own PuzzleScript Games! by Anna Anthropy
Author:Anna Anthropy
Language: eng
Format: epub
Publisher: No Starch Press
Published: 2020-03-13T16:00:00+00:00
Creating the Buddy Group for the Win Condition
Fortunately, we can use groups for the win condition too. Just like we made a pushable group to turn crates and sleeping robots into pushable objects, we can make a new group to make robots count as the same thing, whether they’re sleeping or awake. Let’s update the legend by adding the following line:
Player = Horibot or Vertibot Pushable = Crate or HoribotSleeping or VertibotSleeping Buddy = Player or HoribotSleeping or VertibotSleeping
Note that because Player already includes Horibot and Vertibot, we can just use Player to create a new group called Buddy that includes both robots. Now, whenever we refer to a Buddy, we’re referring to any robot in either state, asleep or awake.
Let’s update our WINCONDITIONS section using Buddy:
============== WINCONDITIONS ============== all Buddy on Exit
The code all Buddy refers to all Buddy objects currently in the level. If there’s only one robot in a level, all Buddy means just that one robot. If both robots are in the level, all Buddy means both of them. Because sleeping and awake robots count as Buddy objects, it doesn’t matter what state they’re in. As long as all the Buddy objects in the current level are on an Exit object, the win condition is satisfied.
One more thing! To make sure that both robots can fit on the exit, each level needs to have at least two Exit spaces. Add two Exit spaces to your level, as shown here:
====== LEVELS ====== ######### #.......# #.I...H.# #.......# #...*...# #X.....X# #########
You can either add two Xs to your LEVELS section code, or you could add the Exit spaces using the level editor (see Chapter 3 to review how to do this). Here’s what the updated level should like:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Blood, Sweat, and Pixels by Jason Schreier(3474)
Dawn of the New Everything by Jaron Lanier(2679)
Godot 4 Game Development Cookbook by Jeff Johnson(2465)
The Art of Doom by Bethesda(2035)
Significant Zero by Walt Williams(1877)
Creative Character Design by Bryan Tillman(1832)
World of Warcraft Chronicle Volume 3 by Blizzard Entertainment(1652)
The Ultimate Roblox Book by David Jagneaux(1613)
Art Of Atari by Tim Lapetino(1558)
Pillars of Eternity Guidebook by Obsidian Entertainment(1532)
Dawn of the New Everything: Encounters with Reality and Virtual Reality by Jaron Lanier(1531)
1628927445Game by Unknown(1470)
Unreal Engine 4 Virtual Reality Projects by Kevin Mack(1463)
Unreal Engine Virtual Reality Quick Start Guide by Jessica Plowman(1443)
Mission Python by Sean McManus(1430)
The Ultimate Player's Guide to Minecraft by Stephen O'Brien(1416)
Learning D by 2015(1413)
Unity 2018 By Example by Alan Thorn(1390)
Road Games by Road Games(1365)
