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

Get help using Construct 2

Post » Tue Jul 16, 2013 4:54 am

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 wayTheNewGuy2013-07-16 04:57:05
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Tue Jul 16, 2013 5:15 am

- 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" ?
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,578
Reputation: 34,326

Post » Tue Jul 16, 2013 5:36 am

[QUOTE=shinkan] - 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" ?[/QUOTE]

@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
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Tue Jul 16, 2013 5:47 am

Yes.
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,578
Reputation: 34,326

Post » Tue Jul 16, 2013 7:19 am

@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.
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Tue Jul 16, 2013 7:31 am

Depends on You. If You use a trigger it will check once, if "every tick" will check every tick.
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,578
Reputation: 34,326


Return to How do I....?

Who is online

Users browsing this forum: celstrider, LukeNecklace and 12 guests