How do I make variables?

Get help using Construct 2

Post » Tue Mar 14, 2017 7:39 pm

i want my game to have tens of characters to select. first of all how can i set the character i selected (with its respective controls) to the level im playing?
i did some research and i found global variables the best way to do it. but having tens of characters makes me wonder, is it better to have 1 global variable with tens of number values (each value is a character)? or tens of global variables with 2 values (0/1)?
i found another way too which consisted in animations but didnt get it right.
Also please tell me how to do it cause im having a hard time trying to. is there a tutorial somewhere?
thanks
B
5
Posts: 31
Reputation: 291

Post » Tue Mar 14, 2017 8:48 pm

Generally speaking, I would recommend using a single variable to represent a single property/idea, rather than using an individual boolean variable for each possible value.

So each of your characters has a unique number associated with it. Save that number to your "SelectedCharacter" variable, and use that number for your event conditions.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Tue Mar 14, 2017 9:04 pm

oosyrag wrote:Generally speaking, I would recommend using a single variable to represent a single property/idea, rather than using an individual boolean variable for each possible value.

So each of your characters has a unique number associated with it. Save that number to your "SelectedCharacter" variable, and use that number for your event conditions.

in conclusion: one single global variable with tens of values, each value is a character...
B
5
Posts: 31
Reputation: 291


Return to How do I....?

Who is online

Users browsing this forum: draiza and 21 guests