Autor Beitrag
Prophet-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win 7
Delphi 7
BeitragVerfasst: Do 05.06.08 19:07 
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:
ausblenden volle Höhe Delphi-Quelltext
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   // Kollisionsüberprüfung
   ((pacman.left +pacman.width) >= (panel10.left))and   //für Aufwärts, mit Randbuffer(+7)
   (pacman.left<= (panel10.left+panel10.width))and        //für Ecke1
   ((pacman.top+pacman.width)>=panel10.top) ) or
   ((pacman.top <=(panel11.top+panel11.height+7))and   // Kollisionsüberprüfung
   ((pacman.left +pacman.width) >= (panel11.left))and   //für Aufwärts, mit Randbuffer(+7)
   (pacman.left<= (panel11.left+panel11.width))and        //für Ecke2
   ((pacman.top+pacman.width)>=panel11.top) )
then up:=0
else up:=7;


if ((pacman.Left <=(panel10.left+panel10.width+7))and  //KÜ für Links an Ecke1 (s.o.)
   ((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  //KÜ für Links an Ecke2 (s.o.)
   ((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 //KÜ für rechts (s.o.)
   (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 //KÜ für rechts (s.o.)
   (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  //für Abwärts
   ((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  //für Abwärts
   ((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 user profile iconChristian S.: Quote- durch Delphi-Tags ersetzt
Moderiert von user profile iconNarses: Anhang ausgetauscht (EXE entfernt) - allerdings haben unsere Virenscans auch nix verdächtiges gezeigt; aber für die Sicherheit... ;)
Einloggen, um Attachments anzusehen!


Zuletzt bearbeitet von Prophet- am Fr 06.06.08 16:42, insgesamt 1-mal bearbeitet
wazup
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 101

Windows XP
Delphi 2009
BeitragVerfasst: Do 05.06.08 19:59 
Beim öffnen der Anwendung werd ich von meinem Anti-Virus über ein Trojaner informatiert ?!?
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Do 05.06.08 20:00 
me too
huuuuuh
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Do 05.06.08 20:16 
ich nich... und antivir hat sich erst vor ner stunde aktualisiert
Prophet- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win 7
Delphi 7
BeitragVerfasst: Fr 06.06.08 16:43 
Öhm, ist auf jeden Fall kein Virus dabei. Hab erst am WE meinen Virenscanner ne Runde drehen lassen. Könnt ihr beruhigt üffnen.
Prophet- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win 7
Delphi 7
BeitragVerfasst: So 08.06.08 09:48 
PUSH

Hat noch keiner den Fehler gefunden? Oder kann mir jemand eine einfachere Methode sagen?
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 08.06.08 12:17 
habs 10 min. versucht hab aber keinen fehler gefunden. :wink:
vielleicht ist da ja keiner. :idea:
Prophet- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win 7
Delphi 7
BeitragVerfasst: Di 10.06.08 17:52 
Fahr mal genau unter ein Panel, am besten das ganz unten. Dann versuche nach unten zu fahren. Du wirst feststellen, dasss dies nicht klappt.