Way to see if there ISN'T an Object at Specific X/Y Position

Get help using Construct 2

Post » Fri Feb 06, 2015 2:56 am

I feel like this should be easy, but I'm drawing a blank. I want to know if there isn't a TileObject at the specific X/Y Position?
B
3
Posts: 7
Reputation: 189

Post » Fri Feb 06, 2015 3:21 am

so you want to know if an object is not at a certain position
say not at position X 266 and Y 345
if so its easy simply enter the condition to check an object for position X 266 and Y 345 and then right click and hit the
Invert button its a button with a cross mark on it
I don't think a file would be necessarily for this but let me know hope this helps
B
5
Posts: 60
Reputation: 345

Post » Fri Feb 06, 2015 3:29 am

Snip01.jpg


So this should work? If I have multiple "Tile" objects in my layout, and there ISN'T one in this specific spot, then one should get created?
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 7
Reputation: 189

Post » Fri Feb 06, 2015 3:36 am

How about have a dummy invisible object that you move to that location and see if there's an overlap? The above code won't work properly (although the idea is valid) because X and Y will rarely be an exact integer number, plus what if there are other object types that you want to check for?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Fri Feb 06, 2015 11:35 am

well that one should work but you said that there are multiple objects of the same so to fix that use an instance variable or use a dummy object like the guy above me said if you don't mind adding to many objects
B
5
Posts: 60
Reputation: 345

Post » Fri Feb 06, 2015 11:39 am

codah wrote:How about have a dummy invisible object that you move to that location and see if there's an overlap? The above code won't work properly (although the idea is valid) because X and Y will rarely be an exact integer number, plus what if there are other object types that you want to check for?


System: pick overlapping point might do it too.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
43
S
18
G
18
Posts: 2,106
Reputation: 16,436

Post » Fri Feb 06, 2015 1:01 pm

Aphrodite wrote:
codah wrote:How about have a dummy invisible object that you move to that location and see if there's an overlap? The above code won't work properly (although the idea is valid) because X and Y will rarely be an exact integer number, plus what if there are other object types that you want to check for?


System: pick overlapping point might do it too.


Never used it :D Now I know
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: LukeW, MAVERICK, whitephon and 12 guests