Collision
BlitzPlus Forums/BlitzPlus Beginners Area/Collision
| ||
How do i make text, lines, ovals, and rectangles collide with loaded images? |
| ||
You could draw them onto an empty image and use ImagesCollide ? It is not a fast method, however. To improve performance, you might choose an alternative method based on what it is you want to do. You could for instance try to reduce the number of points that need to be checked for collision. |
| ||
If you use ImageRectCollide you could get a decent but not 100% accurate collision system that can cover all the text and ovals etc. However, it would be kind of awkward to use on rectangles- What did you have in mind to make? |
| ||
I want to get a line to collide with an image so i can make it where you can aim, example(If the line is not touching anything and you are aimed at somthing, You can shoot them, otherwise something is in the way.) |
| ||
If the image is not too large or irregular in shape, you could use a "Lines Intersect" function to see if an aiming line would intersect with one of the lines of an imaginary rectangle surrounding your image. Depends on direction from which you are shooting. Lines Intersect function: http://www.blitzbasic.com/codearcs/codearcs.php?code=1855 It's very fast to do just maths in Blitz. |
| ||
Wow, thats way over my head. LOL. Thanks anyway. |
| ||
OT:Kyler,i recognise that name from years ago,is it possible we have met before? |
| ||
I doubt it. Where? |
| ||
not sure,i just reconginse the name thats all. :-] probably is someone else |