Collision

BlitzPlus Forums/BlitzPlus Beginners Area/Collision

Kyler(Posted 2007) [#1]
How do i make text, lines, ovals, and rectangles collide with loaded images?


b32(Posted 2007) [#2]
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.


Siopses(Posted 2007) [#3]
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?


Kyler(Posted 2007) [#4]
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.)


Andy_A(Posted 2007) [#5]
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.


Kyler(Posted 2007) [#6]
Wow, thats way over my head. LOL. Thanks anyway.


Dabz(Posted 2007) [#7]
OT:Kyler,i recognise that name from years ago,is it possible we have met before?


Kyler(Posted 2007) [#8]
I doubt it. Where?


Dabz(Posted 2007) [#9]
not sure,i just reconginse the name thats all. :-]

probably is someone else