CollisionFree confusion =)

Non-platform specific questions.

CollisionFree confusion =)

Postby Hblade » Tue Apr 30, 2013 11:32 pm

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'
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: CollisionFree confusion =)

Postby skydereign » Tue Apr 30, 2013 11:39 pm

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).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: CollisionFree confusion =)

Postby Hblade » Tue Apr 30, 2013 11:41 pm

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron