Html5 Canvas game 2nd level has overlapping from 1st level

Clarencehype148
Community Member

Beginner noob here, I'm guessing I need some sort of setTimeout? When my player reaches the 2nd of the first level. Here's my win condition.

if (flagPole) {
    flagPole.update()
    flagPole.velocity.x = 0
   
    if (
      !game.disableUserInput &&
      objectsTouch({
        object1: player,
        object2: flagPole
      })

The 2nd level begins

async function initLevel1B() { 

I can avoid this problem by not having enemies near the ending and basically a short straight path to the end. But not ideally how I want to do it though.

Labels (1)
0 Likes