Birthday cake problems

Discussion and feedback on Construct 2

Post » Fri Jan 18, 2013 2:29 am

I'm making a game where when on level 1, you must click 1 white cake among a bunch of chocolate ones. There is one. And on level two, you must click two white cakes. And so on. But the code I've done is acting a bit randomly, ie the levels break at a certain point, usually level 7 or 8. And sometimes if it's for example level 4, it might show 3 cakes.

Here is all of the code:



By the way, there is only one layout, Layout 1. Levels are done through the global variable.thetrue2013-01-18 02:40:15
B
7
S
2
G
3
Posts: 110
Reputation: 1,926

Post » Fri Jan 18, 2013 2:58 am

I'm guessing you are randomly picking the same white cake more than once. You need to add some logic to not repick a white one.
ImageImage
B
66
S
19
G
121
Posts: 3,195
Reputation: 72,852

Post » Fri Jan 18, 2013 8:05 am

Yeah what blackhornet said. Maybe if you add below the condition "Repeat level times" the condition "(Negated) Is animation whitecake playing?" then thou shalt haveth awesome cake logic
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Fri Jan 18, 2013 11:06 am

@Jase00

I did try that except the problem is that C2 hasn't picked out a specific cake yet. It will always choose based on the first cakes animation.
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Post » Fri Jan 18, 2013 11:50 am

Oh right. I thought C2 would first be detecting all cakes, then adding the negated animation command would lower the choices to just the white cakes, then it picks a single random one out of the white cakes, but fair enough if you've tried it
B
45
S
19
G
10
Posts: 562
Reputation: 9,543


Return to Construct 2 General

Who is online

Users browsing this forum: Aphrodite, blackant, Bleenx, Yahoo [Bot] and 10 guests