Rob´s BB-Kurs 2
© Robert Gerlach 2001
If ImagesCollide(bild1, x1, y1, frame1, bild2, x2, y2, frame2) Then Print "Pixelgenaue Kollision!!! (!)" ; oder If ImagesOverlap(bild1, x1, y1, bild2, x2, y2) Then Print "Einfache Kollison!" |
If ImageRectCollide (bild, x, y, frame, rechteck_x, rechteck_y, rechteck_breite, rechteck_hoehe) Then Print "Pixelgenaue Kollision!" ; oder If ImageRectOverlap (bild, x, y, rechteck_x, rechteck_y, rechteck_breite, rechteck_hoehe) Then Print "Normale Kollision..." |
; Berechnet den Abstand zwischen 2 Punkten. Function abstand#(x1#,y1#,x2#,y2#) x_ab# = x1# - x2# ; x-Abstand y_ab# = y1# - y2# ; y-Abstand abstand# = Abs(Sqr((x_ab# ^ 2) + (y_ab# ^2))) ; Mittels Pythagoras den Abstand ausrechnen. Return abstand# End Function |
; Mit:
If ImagesCollide(bild1, x1, y1, frame1, bild2, x2, y2, frame2) Then Print "Pixelgenaue Kollision!!! (!)" ; oder If ImagesOverlap(bild1, x1, y1, bild2, x2, y2) Then Print "Einfache Kollison!" ; kann man pixelgenau oder einfach überprüfen ob 2 Bilder kollidieren. ; Mit If ImageRectCollide (bild, x, y, frame, rechteck_x, rechteck_y, rechteck_breite, rechteck_hoehe) Then Print "Pixelgenaue Kollision!" ; oder If ImageRectOverlap (bild, x, y, rechteck_x, rechteck_y, rechteck_breite, rechteck_hoehe) Then Print "Normale Kollision..." ; überprüft pixelgenau oder einfach man ob ein Bild mit einem Rechteck kollidiert. ; Alles was sonst noch überprüft werden soll, muss man per Hand machen. |