Help with a custom variable value.

Hudacious

Warper
Member
Joined
Mar 31, 2015
Messages
2
Reaction score
0
First Language
English
Primarily Uses
I was wondering if anyone could give me a hand with a variable problem i'm having?

Basically, my game involves time travelling. In order to do so, the player uses a time travel machine, this machine can be activated with several levers and switches.

Now the problem i'm having is that my plan was to initially have a variable that changes according to the player's reactions.

Here's an example.

For this, we will call the variable "Vortex".

So initially, Vortex should equal to the value of "50".

Once a switch has been activated which begins the variable, the value of the variable "Vortex" should decrease every second. 

The player can stop this by activating a lever which increases the value of the variable Vortex.

If the Player manages to increase the variable's value so that it reaches the value of "100", they are successful.

If the player is unable to react fast enough and the variable's value drops below "20", they are unsuccessful.

In clearer terms, it should be like this.

Vortex = 50

IF SWITCH "First Vortex" Is ON THEN

Vortex - 5 ( Each Second).

IF Vortex <= 20 THEN

Player is Unsuccessful.

Else

IF Vortex => 75

Player is Successful.

Sorry for the strange post format.

I hope someone can be of help?
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
That seems quite tricky to set up.
I would imagine it would involve some loops and a Parrelel Process. (Maybe) or something like that.
You'd probably need a loop for this bit:

IF SWITCH "First Vortex" Is ON THEN
Vortex - 5 ( Each Second).
Player is Successful.
But I'm not sure how to do the other bits.

~Jackus
 
Last edited by a moderator:

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
Tsukihime has a "if button pressed" switch that might be of interest to you. I recall it was meant to work in loops (where the vortex number increases/decreases)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top