2D Collision

Previous topic - Next topic

WPShadow

Hi!

Ich habe ein kleines Problem, mit der 2D Collision! Folgendes Beispiel:

Code (glbasic) Select
FOR x = 0 TO 51

IF SPRCOLL(2, pos_a + 50, pos_b + 49, 4, 0 + (x * 20), ground_y[x]) > 0
pos_b = pos_b - 1
schirm = 0
ENDIF

NEXT
Irgendwie fällt mein Objekt immer durch! Ich weiß nicht genau, was ich falsch mache, da es eigentlich mein erster Versuch mit 2D Coll. ist...

GLG

W.

PS.: Wenn ich einen fixen bzw. einen beweglichen Untergrund benutze, dann funktioniert es ganz normal, bloß so nicht...
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

mull

Vielleicht ist da ja auch keine Kollision.

Probier mal um sicher zu gehen
IF SPRCOLL(2,  pos_a + 50, pos_b + 49, 4, pos_a + 50, pos_b + 49)

endif

Da liegen deine Objekte an der selben Stelle und es muß eine Kollision sein.
AMD Phenom II x4 955 Proc. 3.2 GHZ,  4GB Ram
Windows 7 64bit Ultima
NVIDIA GeForce GTX 460
Leistungsindex 5,7

WPShadow

Das funktioniert ja! Selbst wenn ich es so versuche:

IF SPRCOLL(2,  pos_a + 50, pos_b + 49, 4, pos_a + 50, 700)

Das problem ist bloß, wenn ich die Höhe im Array mache, dann läuft es nicht, obwohl es korrekt angezeigt wird! =/
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Schranz0r

komisch ich schaus mir dann noch genauer an  WP!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard