prevent ball from spawning into the wa

0 favourites
  • 6 posts
From the Asset Store
Minimalist Crash Balls is a game where the goal is to hit the ball on the portal, with 20 different levels :)
  • I tried making an empty space and using the coordinates there to spawn inside the white empty space but, for some reason it spawns outside the maps ang gets stuck!?!?

  • Please show us the code you are trying to use to 'spawn' in.

    But when you spawn you should either be moving a sprite or creating a sprite and just make sure it's position is inside the white are.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The 1st image above shows the Spawning Zone(Grey area) for the balls

    I took the coordinates for the spawning zone and plugged it in for the layout

    (The 2nd image) I just now redid it and the balls are nowhere to be seen...

  • Oops I switched the images so when referring to the 1st image I'm actually referring to the 2nd which is the same for referring to the 2nd image

  • If I understand correctly you want the ball to move to a random position in the Grey.

    Your call sets the position of Normie somewhere between 0 and 1376 for the X and between 0 and 871.5 for the Y.

    I'm not positive but it looks like that your Grey area does not start in the top left (first pixel) of your game. What you need to do if find the top left pixels location of where you want them to spawn, lets say its (200,50). Then you find the size of your Grey area lets say (800,100). Then you start the range at the top left spot and add a random(width) to the X and a random(height) to the Y.

    Start of Layout || Normie set position to (200+random(800),50+random(100))

  • If I understand correctly you want the ball to move to a random position in the Grey.

    Your call sets the position of Normie somewhere between 0 and 1376 for the X and between 0 and 871.5 for the Y.

    I'm not positive but it looks like that your Grey area does not start in the top left (first pixel) of your game. What you need to do if find the top left pixels location of where you want them to spawn, lets say its (200,50). Then you find the size of your Grey area lets say (800,100). Then you start the range at the top left spot and add a random(width) to the X and a random(height) to the Y.

    Start of Layout || Normie set position to (200+random(800),50+random(100))

    TYSM!!!!!!!!!!!

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