Birthday cake problems

  • 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:

    <img src="http://i46.tinypic.com/15r16q1.png" border="0" />

    By the way, there is only one layout, Layout 1. Levels are done through the global variable.

  • 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.

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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 <img src="smileys/smiley41.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)