Chargeable weapons

By LadylexUK

In many action titles your character may have a chargeable weapon that unleashes a formidable attack on your opponent. For example,in Destiny you have a super weapon that is only available after you have collected a certain amount of xp from killing enemies and it is only available for a short period or for a certain amount of shots before you start from scratch again.This tutorial is not about the attack, but the mechanic for charging the weapon, using a timer, and cooldown.

Charging your weapon

There are many ways you could do this, here are three

Automatically charges over time

WHEN [once] DO [boolvar: charged][equals][false]
WHEN[not] [boolvar: charged] DO [numvar:power charge][increment by][0.03]
WHEN [numvar:power charge][equals][50] DO [boolvar:charged][equals][true]

Charges when you hold down a button

WHEN [once] DO [boolvar: charged][equals][false]
WHEN [not][boolvar:charged]
…WHEN [left stick button] DO  [numvar:power charge][increment by][0.03]
…WHEN [numvar:power charge][greater than or equal to][50] DO [boolvar:charged][equals true]
…/…WHEN [else]
…/…/…WHEN [started to][left button][released] DO [numvar:power charge][equals][0]

Charges as you kill enemies

WHEN [once] DO [boolvar: charged][equals][false]
WHEN [not][boolvar:charged]
…WHEN [attack hit]
…/…WHEN [for each of][it]
…/…./…WHEN [it][is dead] DO [numvar:killcount][increment by][1]
WHEN [numvar:killcount][equals][20] DO [numvar:killcount][equals][0]
…WHEN DO [boolvar:charged][equals][true]

Display the charge

WHEN [boolvar:charged] DO [display][text: ABILITY ACTIVE][screen top right]
…WHEN [else] DO [display meter][numvar:power charge][max][50][screen top right] // change to kill count for that example

Use the charge up

WHEN [boolvar:charged]
…WHEN [started to] DO [numvar:power charge][equals][50]
…WHEN [right trigger] DO [shoot][fireball] // example of an ability
…WHEN [countdown timer][30] DO [boolvar:charged][equals][false] // you can alter this number to suit
…/…WHEN [else] DO [numvar:power left][equals][timer seconds remaining]
…WHEN DO [display meter][numvar:power left][max][30][screen top right][yellow]
…WHEN [started to][numvar:power left][equals][0] DO [numvar:power charge][equals][0] // change to kill count for that example

Comments are closed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: