How do I variable

Get help using Construct 2

Post » Mon Oct 06, 2014 6:01 pm

Lets say you didnt want the player to be able to advance to next level unless they achieved a certain score . Now correct me if im wrong but wouldn't that be a Boolean true or false or could you also do a compare variable im trying too see which one would be better . I have my score setup already but to make the game a challenge I want to set a score for them to beat on each level . As im still confused on local and global variables as in when should you use either or if that makes Sense
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Mon Oct 06, 2014 6:12 pm

I guess easiest would be creating a global variable LevelUnlocked
and on level one finished set it to 2
on level two finished set it to 3
etcetera
And do a system compare variable to see if levelunlocked higher or equal to 3 to be able to go to level three..
This way you'd only need one global variable to keep track of the user's progress
Ofcourse you'd have to save it to webstorage to make sure when the user exits and restarts the game the progress isn't lost..

I'm sure there are tutorials on unlocking levels in the tutorial section, but these are the basics..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 06, 2014 8:08 pm

Wow this sounds like a advance topic but thanks im see if YouTube have some videos on this
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Mon Oct 06, 2014 8:15 pm

lilvee1989 wrote:Wow this sounds like a advance topic but thanks im see if YouTube have some videos on this

It's not advance at all once you step into array's world.

The manual has a in-depth description about variable, I think it's better for you to read there instead of asking people to explain basic functionality like this. The answer could be very long so you have the tendency to be replied with incomplete answer, simply because there's too much too tell.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Oct 06, 2014 10:05 pm

So what is you saying that its going to take an array to accomplish what im trying too do
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Tue Oct 07, 2014 4:09 am

lilvee1989 wrote:So what is you saying that its going to take an array to accomplish what im trying too do

You can do so with variables. But array will make it perfect and flexible, it's an intermediate stuff, if you haven't understand variables fully, don't go into array yet, study the variables first.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Tue Oct 07, 2014 4:29 am

I just actually finished reading the entire manual today and actually towards the end of the book was on arrays
B
11
S
3
Posts: 216
Reputation: 1,279


Post » Tue Oct 07, 2014 2:18 pm

Lordshiva1948 your time capx was pretty cool I wonder can you do the same if you wanted a graphical in game timer on screen also. But I was able to import my number graphics well using that example . I can tell u know this engine pretty well. Now I just have to figure out a perfect way to disable player controls while that timer is goin
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Wed Oct 08, 2014 7:01 am

lilvee1989 you could do it like this
You do not have the required permissions to view the files attached to this post.
B
255
S
39
G
15
Posts: 1,982
Reputation: 41,005

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests