How do i check if a space is empty without arrays?

0 favourites
  • 6 posts
From the Asset Store
In this template the music plays without looping in your game
  • Whatsup peeps long time no talk!

    I was wondering how I can check if a space is free without using arrays.

    I want to make a gun shoot if space in front of it is free. But the space can be blocked at any time

    I want to make sure that this is checking every tick unless there is another way

    • Sprite: Is overlapping at offset
    • distance(x1,y1,x2,y2)
    • use second sprite to test for collisions.

    All depends on your game and what you want to do.

    why did you ask about "without using arrays" ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • - Sprite: Is overlapping at offset

    - distance(x1,y1,x2,y2)

    - use second sprite to test for collisions.

    All depends on your game and what you want to do.

    why did you ask about "without using arrays" ?

    shinkan will this method be able to check if the space is free as a constant. For instance when I place a tile in front of it,it will stop shooting?

    And I was saying no arrays because the last time I tried to get information someone told me to use arrays

  • Yes.

  • shinkan I have one other question if I use the overlap at offset wont that just check once?

    Or will I have to call for every tick bro. I want the player to be able to stop incoming rounds by placing a tile infront of the gun but when he removes the tile the gun shoots again.

  • Depends on You. If You use a trigger it will check once, if "every tick" will check every tick.

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