Hi all,
hab ein Probelm, schon die Suchfunktion benutzt, aber nichts gefunden.
Will einen Pacman-Spiel Programmieren. Nun komm ich bei meiner Kollision nicht mehr weiter. Bisher sieht mein Quelltext so aus:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| if ((pacman.top <=(panel10.top+panel10.height+7))and ((pacman.left +pacman.width) >= (panel10.left))and (pacman.left<= (panel10.left+panel10.width))and ((pacman.top+pacman.width)>=panel10.top) ) or ((pacman.top <=(panel11.top+panel11.height+7))and ((pacman.left +pacman.width) >= (panel11.left))and (pacman.left<= (panel11.left+panel11.width))and ((pacman.top+pacman.width)>=panel11.top) ) then up:=0 else up:=7;
if ((pacman.Left <=(panel10.left+panel10.width+7))and ((pacman.top +pacman.height) >= panel10.top)and (pacman.top <= (panel10.top + panel10.height))and ((pacman.left+pacman.width)>=panel10.left))or ((pacman.Left <=(panel11.left+ panel11.width+7))and ((pacman.top +pacman.height) >= panel11.top)and (pacman.top <= (panel11.top + panel11.height))and ((pacman.left+pacman.width)>=panel11.left))
then left:= 0 else left:= 7;
if (((pacman.left+pacman.width>= panel10.left-7)) and (pacman.top<=(panel10.top+panel10.height))and ((pacman.top+pacman.height)>=panel10.top) and (pacman.left<=(panel10.left+panel10.width)))or (((pacman.left+pacman.width>= panel11.left-7)) and (pacman.top<=(panel11.top+panel11.height))and ((pacman.top+pacman.height)>=panel11.top) and (pacman.left<=(panel11.left+panel11.width))) then right:=0 else right:=7;
if (((pacman.top+pacman.width)>=panel10.top-7)and ((pacman.left+pacman.width)>=panel10.left) and ((panel10.left+panel10.width)>= pacman.left)and (pacman.top<=(panel10.top+panel10.width)) ) or (((pacman.top+pacman.width)>=panel11.top-7)and ((pacman.left+pacman.width)>=panel11.left) and ((panel11.left+panel11.width)>= pacman.left)and (pacman.top<=(panel11.top+panel11.width)) ) then down:=0 else down:=7; |
Ist dann für 2 Panels gemacht. Leider kann ich den Pacman nicht nach unten bewegen, wenn Panel1 über Panel2 liegt und ich an der Unterseite des Panel2 bin. Weis jmd was ich falsch mache??
Bitte bei eurer Antwort zu beachten, dass ich gerade im ersten Jahr mit Delphi arbeite und daher noch nicht viel Erfahrung habe. Ich lade das Programm mal hoch, damit ihr euch einen Überblick verschaffen könnt.
Danke im vorraus.
Moderiert von
Christian S.: Quote- durch Delphi-Tags ersetzt
Moderiert von
Narses: Anhang ausgetauscht (EXE entfernt) - allerdings haben unsere Virenscans auch nix verdächtiges gezeigt; aber für die Sicherheit... 