Different result when debugging with breakpoint

0 favourites
  • 2 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hello

    I'm working on jigsaw puzzle, so I'm using nested for to paste object on a canvas, in early test it's a success. The puzzle image and the pattern is pasted nicely.

    So I add more code for size, and position for the canvas and the object that will be pasted on canvas. Also because there'll be a lot of picture I made the sprite to Load from URL instead of using animation.

    This is where things going weird:

    1. The picture is pasted, but the pattern is not.

    2. After some check, I found that the pattern is not pasted after Load from URL request. If I place them before, the pattern will be pasted. So this lead me to use breakpoint to debug.

    3. I use breakpoint to debug, but the result is different. There's no error and the pattern is pasted on canvas. But if I try without breakpoint the pattern is not pasted on canvas

    Without Breakpoint

    With Breakpoint

    On Start of Layout

    Generate Puzzle function

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [SOLVED]

    After some check, turn out the pattern is not pasted on canvas because the object is not created yet.

    Probably because breakpoint debug is checking the code one step at a time, so there's a time to the pattern to be created then pasted on the canvas.

    and so I change the code to generate the pattern first, then add 0.1 wait, and paste the pattern into canvas.

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