Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Collision_line function?


Octohunter
 Share

Recommended Posts

Hey all,
I was just wondering if there was an existing function that would allow the game to detect whether there was a solid object between two points.  I'm in the process of coding a ranged weapon system, and I'm just about done except for the actual bullet and this.  Any help would be appreciated :)
Link to comment
Share on other sites

That's not how my ranged system works, though. Basically, you target an NPC and press the attack button.  If you have a ranged weapon equipped, it will hit the NPC if it is in range.  What I want is to program a function that will allow the game to detect whether there is a solid between the x and y coordinates of the player and the x and y coordinates of the npc. Thanks, anyway.
Link to comment
Share on other sites

Then run a function to check whether there is anything between X1,Y1 and X2,Y2 :) Or rather, write one.. There's plenty of material around on google for this stuff in Grid Based games, I'm sure you can find some base code for it. ^^
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...