Page 1 of 1

Line Of Sight

PostPosted: Sun Feb 20, 2005 10:56 am
by jazz_e_bob
I've written a Line-Of-Sight system that uses a CollisionFree test inside a while loop.

It works well. :)

The problem is I want some actors to be see-through and others solid. I don't want to disable collision state on them either!

My current system is blocked by ANY actor.

I want to use an actor variable like "isSolid".

But...

If I change the x and y of a collision test actor inside a while loop will collision detection for that actor work for a range of positions? Or will it only detect collsion on a Draw Event.

Any feedback appreciated! :)

PostPosted: Sun Feb 20, 2005 11:06 am
by jazz_e_bob
Further testing indicates that collision detection only occurs on a Draw Event.

Hmmm... :(

I need is a version of CollisionFree that ignores collisions where the collide actors "isSolid" flag is not set.

PostPosted: Sun Feb 20, 2005 11:16 am
by jazz_e_bob
Having a lovely conversation with myself here! :D

Anyhow - I found...

Actor *getactor(long x, long y)
Returns Actor at position (x,y) (in game coordinates) if success, invalid Actor (with cloneindex = -1 and name = "invalid Actor") on error.


Would this return the actor at precisely the given co-ordinates or can the actor simply be touching them somewhere?

More testing! :)

PostPosted: Sun Feb 20, 2005 11:32 am
by jazz_e_bob
Returns actor that collides with that point.

Yay! 8)

PostPosted: Sun Feb 20, 2005 10:40 pm
by Just4Fun
I love the way that you think! Better yet, you share it with the rest of us. :D

PostPosted: Sun Feb 20, 2005 11:08 pm
by jazz_e_bob
Heh heh.

I sometimes I feel like Game Editor is a game itself! :)

PostPosted: Mon Feb 21, 2005 4:43 pm
by IPete2
We're not ignoring you Jazz! You posted the first lot within about half an hour - you are too quick! :)

I think that's a great contribution - thanks.

IPete.2

PostPosted: Mon Feb 21, 2005 9:13 pm
by jazz_e_bob
I think that's a great contribution - thanks.


Thanks mate.

I am hoping to publish a Line-Of-Sight actor at the end of all this.

( At the moment I am being distracted by spring simulation! Too much fun. )

:)

Image