RECTSOVERLAP
Übersicht BlitzMax, BlitzMax NG Codearchiv & Module
FreemanBetreff: RECTSOVERLAP |
Mo, Jun 20, 2005 13:03 Antworten mit Zitat |
|
---|---|---|
Code: [AUSKLAPPEN] Graphics 800,600,0,-1 x2=210 y2=200 While Not KeyDown(key_escape) Cls x1=MouseX() y1=MouseY() DrawRect x1,y1,32,32 DrawRect x2,y2,24,56 kolli=RECTSOVERLAP(X1,Y1,32,32,X2,Y2,24,56) DrawText "kollision :"+kolli,0,0 Flip Wend Function RECTSOVERLAP(X1,Y1,Breite1,Hoehe1,X2,Y2,Breite2,Hoehe2) If x1<=(x2+breite2) And y1<=y2+hoehe2 And (x1+breite1) >=x2 And (y1+hoehe1)>= y2 Then Return 1 End Function vielleicht braucht es ja mal jemand FrEeMaN |
||
MacBook | MacOSX 10.5 | 80GB HDD | 1GB | BlitzMax 1.28 |
Markus2 |
Mo, Jun 27, 2005 18:32 Antworten mit Zitat |
|
---|---|---|
Ich glaube deine Func. liefert auch 1 zurück wenn die Rechtecke
sich berühren oder war das gewollt ? So müßte es stimmen : If x1<(x2+breite2) And y1<y2+hoehe2 And (x1+breite1) >x2 And (y1+hoehe1)> y2 Then Return 1 |
||
Freeman |
Di, Jun 28, 2005 12:36 Antworten mit Zitat |
|
---|---|---|
ja das war so gewollt. Finde es so ganz gut, weil wenn man die kollision 2er rechtecke oder so überprüfen möchte, dann schon richtig
FREeMaN |
||
MacBook | MacOSX 10.5 | 80GB HDD | 1GB | BlitzMax 1.28 |
Übersicht BlitzMax, BlitzMax NG Codearchiv & Module
Powered by phpBB © 2001 - 2006, phpBB Group