How do I Make a Level Select Menu?

Get help using Construct 2

Post » Mon Oct 10, 2016 6:03 pm

I've been trying to make a level select menu for a bit now, and at first it seemed to work. But once I incorporated what color the level buttons are (based on if they are locked or not), it went downhill. Every time i changed it, it either locks all the levels or unlocks all the levels. I even used another person's template with a level select menu, but it still doesn't work. Please help! :cry:
B
7
S
1
Posts: 12
Reputation: 403

Post » Mon Oct 10, 2016 6:08 pm

viewtopic.php?f=146&t=182270

Look at my code if you can't understand it let me know. I can help you out.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Mon Oct 10, 2016 6:19 pm

My guess at the problem, despite very limited information:

Are you using 'for each'?

You probably have a 'picking' problem, as in picking all of them. Therefore it is applying it to all of them.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Mon Oct 10, 2016 6:29 pm

PixelPower:
I understand that this way works, but I'm coding a 25+ levels game, and I feel like that this is just way too much work that clutters the work space, even if it is a copy and paste thing. Any way that this could be made simpler that uses less coding, but still works for 20+ levels?

badmoodtaylor:
No, I'm not using for each. I just set it to 'If animation frame = 1, go to "level" & SelectionButton.level_Number' (SelectionButton being the buttons in the level select, level_Number being the instance variable that shows what level each button is for). Then, I set 'If animation frame = 0, play sound (whatever sound i want)' which means the button is locked. I also have it like, 'if (global variable) is > or = to SelectionButton.level_Number, set ani frame to 1', and 'if (global variable is < SelectionButton.level_Number, set ani frame to 0'. Is there something that is off with this coding? I don't know why it doesn't work.
B
7
S
1
Posts: 12
Reputation: 403

Post » Mon Oct 10, 2016 6:45 pm

If you are doing system-global variable > instance.variable I don't believe it is picking any of those instances, so all are picked. If you do sprite instance.variable < global variable then I believe it would pick only those instances that are true.

I would recommend though:
on layout start
-for each (menu)
--if instance variable < etc etc
---then animate x
--else; animate x

I'm not entirely sure if that is necessary but is usually safer.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Tue Oct 11, 2016 6:15 am

I dont know what to say but making games is work. You can try to UDID method if you want to use 1 sprite only and just make duplicates but even thats a bit of work. Trust me we all go through it. I am making a Metroid style game now and I am banging my head on the wall its hard work but will pay off.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Tue Oct 11, 2016 8:57 am

Just consider posting your capx, this will be the easiest way to investigate what is going wrong and what appropriate solution can be applied.
Although I do believe the description you gave indeed sounds like a picking issue that badmoodtaylor hinted at.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Wed Oct 12, 2016 10:13 am

@ezgaming420

Ok I got the easiest way

Have a sprite that has 2 animations open and locked , set the animation to locked. To set the animation to open do this.

System = compare variable = choose sprite = set animation "open"

Its one line of code , can't get easier than that.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Wed Oct 12, 2016 6:58 pm

Have you looking my example? It uses array for managing progress like in Angry Birds and a such.
https://dl.dropboxusercontent.com/u/659 ... eMenu.capx
ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Tue Oct 18, 2016 8:23 pm

Thanks everyone! I'll take all your suggestions in consideration.
@Kyatric
How do I post my capx file? I never did so, and I don't know how.
B
7
S
1
Posts: 12
Reputation: 403

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests