Stop this (seeming random) bug???

0 favourites
  • 3 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • Hi guys,

    I have a c3p file here ufile.io/439ql.

    This is my first game so the code will be a bit messy, but the general idea is that it's a quiz game based on the solar system. A question at the top pops up and you select the corresponding planet as the answer and fire it to the sun, if it's correct, the next question arrives.

    However, I'm getting a random bug in which sometimes 2 questions are appearing on screen at once. This makes the question impossible to read and breaks some other functionality. While watching the debugger, it seems that sometimes the question_no int++ is being incremented more than once when it is triggered by a correct planet colliding with the sun. The behaviour happens a lot more on my tablet than it does on the mac where I'm developing it. I'm really at a loss as to why this is happening and I just don't know what to do. I'd hugely...HUGELY appreciate any help with this.

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Those events are really inefficient, I would rework all of them and possibly destroy planets or set their position back to default as they fly on forever. It's probably something to do with the planet being on collision with the sun so it adds more than 1 to the variable. On question 12 you are adding 2 to question no. by the way. I would look at using Families, this would help with your events and grouping all planets, you have 200+ events there that could be just 20 and easier to manage.

  • I played through all the planets and didn't see the bug you are describing. Did you happen to fix it?

    Good start! Just as helpful feedback, you should really look into using families as you have a lot of repeated conditions and actions. This was my primary mistake as well when I first started developing (even before Construct).

    For example, touch on planet:

    • Put all your planets into one family called planets.
    • Apply an instance variable to the family
    • Then on each planet define the planet_id

    This will reduce your 8 lines with conditions down to one. Same thing with your positioning and your big_planets that hit the sun. All those positions and actions are repeated.

    Modified your c3p file to show you what I mean:

    https://www.dropbox.com/s/i979cphtlcizbzp/project-36.c3p?dl=1

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