How do I clean up these local variables?

Just started using Construct 2? Post your questions here

Post » Tue May 27, 2014 9:48 am

How to I arrange this block so that only one event is used, and the variables remain local?
LocalVariableIssue.png
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 2
Reputation: 204

Post » Tue May 27, 2014 11:20 am

It isn t yet possible I think, local variables can only be done inside an event or a group.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed May 28, 2014 10:48 pm

Add "Reset Global Variables" in "System"
System/Reset Global Variables
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Thu May 29, 2014 2:22 am

Aphrodite wrote:It isn t yet possible I think, local variables can only be done inside an event or a group.


There is your answer. Put the "every tick" and local variables into a group, and then activate/deactivate that group whenever you need it. The other option is to put them into a Function and call it whenever you need it.

Also if you were going to be calling local variables every tick, they may as well be global variables, then none of this matters.
B
12
S
2
G
1
Posts: 26
Reputation: 835


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest