Bizarre issue I'm having

0 favourites
  • 7 posts
  • Hello friends, yes this is my very first post here. Hi!

    I'm making this very simple game as an assignment in my class, but I'm having an issue I simply can't find the reason why its happening, so let me explain:

    In the 3rd stage of the game, I organized the events and actions so they would spawn two obstacles (rocks) side by side, each one in a different lane (there are 3 lanes) of the stage. The obstacles are spawning as intended, but here the problem: I've set the animals the player controls to stop when they overlap an obstacle, however, for some reason I can't discover alone they aren't stopping when they overlap the black stone. Just the brown-ish one.

    I'm sending a link to the CAPX. The issue I talk about is happening within the stage 3 sheet.

    filedropper.com/gamefull16dezembro2

  • In stead of

    stone is overlapping beast

    or

    stone is overlapping beast

    try

    beast is overlapping stone

    or

    beast is overlapping stone

    Better would be to bring the obstacles in 1 object, as animations.

    You can do the same for the animals. Animations gonna be named Animal_Action....

    Now you have only 2 objects (and there instances) to handle ... will be 1/10th of the amount of code you have now.

  • <ninja'd but...>

    It looks like you've found a bug in C2. You need to simplify this into an example CAPX to upload, but the issue seems to be, having two obstacle overlap tests, where you are testing two different objects to the same object, the second one is not detected.

    If you switch the order in your example, (check obstacle2 first), it works for #2, but then fails for #1.

    To get around this for now, I found that if you switch the order around, check for 'animal' overlapping #1 or 'animal' overlapping #2, it does work.

    I think the technical issue is that, the current implementation picks the 'animal' that is overlapping the first checked obstacle, but holds on to that picking list, which would be empty, since no animal overlaps in the first case, then the OR is run to check the second obstacle, but there are no animals picked now, so the whole thing fails!

  • Ok, thanks. Will try what you guys have suggested

    and lol finding a bug, now there's something I did not expect to do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also yeah I forgot to simplify it into an example :\ was desperate because I'm running out of time... my bad!

  • In stead of

    stone is overlapping beast

    or

    stone is overlapping beast

    try

    beast is overlapping stone

    or

    beast is overlapping stone

    Better would be to bring the obstacles in 1 object, as animations.

    You can do the same for the animals. Animations gonna be named Animal_Action....

    Now you have only 2 objects (and there instances) to handle ... will be 1/10th of the amount of code you have now.

    Oh yeah, also thanks for the animations tip! I've been working on this thing for some time now during classes and at the start I didn't know a thing about C2, didn't know how to make the animations, so I made the 3 animals as separate sprites. I'm so used to it being this way that I didn't even think of changing them to 1 sprite with different animations... but I'll certainly do it.

  • Well, i gambled that you cant use families (paid version). If you learned a lot (trying to rephrase cautious), it might be time to code it again from scratch. You will notice that it will be not that much work. At this moment you add to a base that has a 'early understanding', and you will feel like you are 'patching things' for ever.

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