Object overlaps set of points

New releases and general discussions.

Post » Sat Sep 06, 2008 7:07 pm

It would be very cool if you could describe a set of points in the object overlaps point condition.
Such as:

sprite2 overlaps X = sprite.right
Y=(sprite.top, sprite.bottom)

so it registers collision for any y in that interval

would be really nice and easy to make sensorless custom movements using this.

EDIT: come to think of it this could potentially be used in a lot of other places too.
like compare: sprite.x = {0,20} would be equivalent to sprite.x>0 and sprite.x<20, if you really wanted to take it extremely far something like, sprite.x={int|0,20} would qualify true when sprite.x was equal to an integer in that interval.
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Sun Sep 21, 2008 3:11 pm

I'm going to bump this because there's been no replies and I still think it's a good idea, though my explanation probably didn't do it justice.

Basically I was trying to make a custom platform movement and realised I absolutely hate using other sprites as detectors, there's too much fiddling around with hotspots and size changes etc, they just get annoying. So I tried to use the "object overlaps point" condition to replace these detectors, only to find its extremely limiting and unsuitable for this purpose.

For a detector on the right, I set the single point to the midpoint of the sprite on the Y axis, and the furthest right point on the X axis, but because it's just a single point at your midpoint if you collide with something on your feet or your head it doesn't stop you. I thought for a second about looping it through every Y, then realised that was dumb since collision detection must handle a bunch of points at once anyway.

You should be able to (at the very least) specify 2 X values, and 2 Y values, and it tests collisions within the region between them (a box), thus giving removing the need for invisible detectors.
It might be nicer in fact to have >3 (x,y) coordinates, and test a polygon between them, allowing the creation of weirder shapes that might be more useful.

The reason I was suggesting sets is that you could potentially describe different shapes other than some n sided polygon (like a circle). Though, the syntax would probably be ultra confusing, and might be hard to implement.
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Mon Sep 22, 2008 7:45 am

Yeah I can see how this would be a really useful idea... I guess I am so used to making detectors for stuff (thanks a lot Clickteam) that it's like second nature to use them for just about anything. This wold make things a lot easier and cleaner and you wouldn't have 50 different rainbow coloured objects, all named "Detector".

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests