Highlighting objects of interest

In many action adventure and shooter games there is a mechanic that is called various things such as eagle vision, survival mode etc.. Basically when a button is pressed all objects of interest are highlighted, labelled or glow. This is fairly easy to do in Project Spark. In these examples the player holds down the left bumper to see the objects of interest.

In every object that will be highlighted put this kode

WHEN [once] DO [global][objset: interest][increment by][me]

In your player brain

WHEN [left bumper]
…WHEN [for each of][global][objset: interest] DO [your effect here (see below for  ideas)]

Highlight  DO [highlight][it]
Hologram DO [hologram][it]
Name DO [display][it][name][above][it]
Icon
You can define a variable in the object that defines its type as an object of interest and then display an icon above it that represents that type.

In the object add : WHEN [once] DO [textvar:icon][equals][text:flame]

In the player:
…WHEN [for each of][global][objset: interest] DO
…/…WHEN [it][textvar:icon][equal to][text:flame] DO [display][icon:flaming bottle][above][it]
…/…WHEN [it][textvar:icon][equal to][text:loot] DO [display][icon:trophy][above][it]

Flashing 
…WHEN [for each of][global][objset: interest] DO
…/…WHEN [boolvar:effect] DO [it][hologram]
…WHEN [countdown timer][0.5][loop] DO [toggle][boolvar:effect] // you can set the speed of the flash here

At the moment this kode requires the player to hold down the left bumper to see the effect. You could also do this on a timer using a boolean variable.

WHEN [left bumper][pressed] DO [boolvar:vision on][equals][true]
WHEN [boolvar:vision on]
the rest of the kode as childlines
+ …WHEN [countdown timer][3] DO [boolvar:vision on][equals][false]

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: