Difference between revisions of "An Event in Time"
(Created page with "On this page you will find a bunch of tips & tricks related to events, loops, & timing methods that you can use to control exactly when specific events &/or state changes (via...") |
|||
Line 4: | Line 4: | ||
− | == Pause == | + | == Pause (static) == |
− | The simplest method for controlling time is to use the '''pause''' action part. The pause action part will | + | The simplest method for controlling time is to use the '''pause''' action part. The pause action part will prevent any action parts created after it from executing until the pause has finished. |
{| class="ts" | {| class="ts" | ||
Line 16: | Line 16: | ||
if condition "cond_example" is true | if condition "cond_example" is true | ||
− | pause for | + | pause for 500 milliseconds |
change condition "cond_example" to false | change condition "cond_example" to false | ||
end if | end if | ||
+ | |||
+ | |||
+ | == Pause (dynamic) == | ||
+ | |||
+ | The same action part above can also be used to create dynamic pauses, which can be really useful for making your game projects feel much more alive & less like they are stuck on some kind of fixed looping pattern that occurs every x amount of time passed. | ||
+ | |||
+ | To setup dynamic pauses you will need to create a '''value''' that you can link to the pause action part. The integer number belonging to values can be modified at any time via action parts or script, however we will only be covering action parts for now to keep things as simple as possible. | ||
+ | |||
+ | Anyway, let's just assume you have created a value somewhere inside of the Visionaire Studio editor & have called it "v_time". Right, let's see an example of what a dynamic pause would look like inside of an action block... | ||
+ | |||
+ | set random value "v_time" between 100 and 3000 | ||
+ | pause for "v_time" milliseconds | ||
+ | additional action parts go here | ||
+ | |||
+ | |||
+ | == Animation Frame Events == | ||
{{toc}} | {{toc}} |
Revision as of 17:11, 1 August 2022
On this page you will find a bunch of tips & tricks related to events, loops, & timing methods that you can use to control exactly when specific events &/or state changes (via values/conditions) should occur in your game projects.
Anyway, let's crack on...
Pause (static)
The simplest method for controlling time is to use the pause action part. The pause action part will prevent any action parts created after it from executing until the pause has finished.
Quick note: The pause action part allows you to specify the time in milliseconds, seconds, or minutes; however I highly recommend that you use milliseconds because it allows you to input precise time values. |
Anyway, here's an example of the pause action part being used with some other action parts...
if condition "cond_example" is true pause for 500 milliseconds change condition "cond_example" to false end if
Pause (dynamic)
The same action part above can also be used to create dynamic pauses, which can be really useful for making your game projects feel much more alive & less like they are stuck on some kind of fixed looping pattern that occurs every x amount of time passed.
To setup dynamic pauses you will need to create a value that you can link to the pause action part. The integer number belonging to values can be modified at any time via action parts or script, however we will only be covering action parts for now to keep things as simple as possible.
Anyway, let's just assume you have created a value somewhere inside of the Visionaire Studio editor & have called it "v_time". Right, let's see an example of what a dynamic pause would look like inside of an action block...
set random value "v_time" between 100 and 3000 pause for "v_time" milliseconds additional action parts go here
Animation Frame Events