Page 1 of 1

CollisionFree confusion =)

PostPosted: Tue Apr 30, 2013 11:32 pm
by Hblade
I started using CollisionFree and I really really like it, I'm running into confusion on how to use it correctly though =) So far I found out how to use it in Draw Actor and stuff but I'm sure theres much better ways to use it o-o'

Re: CollisionFree confusion =)

PostPosted: Tue Apr 30, 2013 11:39 pm
by skydereign
Hblade wrote:So far I found out how to use it in Draw Actor and stuff but I'm sure theres much better ways to use it o-o'

I think you are thinking about functions wrong. Think of any function as a tool. Said tool does one thing, which could be used in many ways. CollisionFree checks if their will be no collision if an actor was moved to a certain location. That is it. If you ever need that functionality, then you should put it there. For instance, a lot of people would use it for movement. In your keydown right, you want the player to run, assuming they don't collide with the wall, so you can use it there. If your movement scheme is in the draw actor event, then you might want to use it there. Now your overall design might be bad, like putting movement in draw when it is unnecessary (but this really depends on how you are doing movement).

Re: CollisionFree confusion =)

PostPosted: Tue Apr 30, 2013 11:41 pm
by Hblade
skydereign wrote:
Hblade wrote:So far I found out how to use it in Draw Actor and stuff but I'm sure theres much better ways to use it o-o'

I think you are thinking about functions wrong. Think of any function as a tool. Said tool does one thing, which could be used in many ways. CollisionFree checks if their will be no collision if an actor was moved to a certain location. That is it. If you ever need that functionality, then you should put it there. For instance, a lot of people would use it for movement. In your keydown right, you want the player to run, assuming they don't collide with the wall, so you can use it there. If your movement scheme is in the draw actor event, then you might want to use it there. Now your overall design might be bad, like putting movement in draw when it is unnecessary (but this really depends on how you are doing movement).


Thank you so much! This could actually solve my issue! =D