25.12.2012 Views

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Building</strong> <strong>Game</strong> Worlds<br />

148<br />

U L T I M A T E G A M E D E S I G N<br />

Counter<br />

}<br />

// Make "region2" rain more heavily at level "50"<br />

weatherSystem.startRain(region2, 50);<br />

A counter trigger simply counts down a number of time units and then launches its<br />

event. The amount of time the counter trigger waits to launch an event is set in its<br />

properties. This allows you to play with timing. How long should you give players to<br />

flee? How long until the next event? So, if a player trips a counter trigger, they might<br />

have a ten-second head start before a gigantic robotic spider is loosed into the level<br />

after them. You’ll also want to tune the attack speed and attack properties of the spider<br />

to give the players a chance.<br />

You might use a counter trigger on one side of the map to launch a counter trigger<br />

on the other side of the map. This allows for a “popcorn popping” effect as counter<br />

triggers launch their events across a map. These are very useful for action <strong>game</strong>s and<br />

environmental shooters.<br />

This script sample shows how you might warn the player that they have invaded<br />

the robotic spider’s nesting point, give the player a chance to flee, and then set the spider<br />

hunting after the player:<br />

Material<br />

// JavaScript sample of "counter" trigger support<br />

if(player.intersects(spider.getBoundary())) {<br />

alertUser(spiderWarningText);<br />

waitSeconds(10);<br />

spider.startHunting();<br />

}<br />

A material trigger, when tripped by a player location trigger (remember the “popcorn”<br />

effect), changes texture information in a scene. For instance, a player may have tripped<br />

a location trigger that causes an ice crystal formation to rise out of the ground covered<br />

by a dusty particle effect. As the ice crystals rise, light triggers are tripped and the light<br />

in the room intensifies (for dramatic and visual bang!).<br />

Wouldn’t it be nice to have the wall textures or wall materials somehow account for<br />

all the light bouncing off these cool ice crystals? Well, you could make an animated<br />

“light reflection” version of the wall texture and display it when the material trigger<br />

is tripped. Now, as the ice crystals rise, the animated light reflections on your custom<br />

wall texture or material are displayed! Very cool. If no new “material” information is<br />

given to the material trigger, it commonly does nothing. It doesn’t know what to do if<br />

it doesn’t have new material information.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!