Autor Beitrag
Zlatan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 175



BeitragVerfasst: Sa 12.03.11 13:54 
Könnte jemand diesen Quelltext korrigieren.Ich find einfach keinen Fehler :(

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
VK_Space: muni:= 6;
m1.Show; m2.Show; m3.Show; m4.Show; m5.Show; m6.Show;

end;

end.
glotzer
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 393
Erhaltene Danke: 49

Win 7
Lazarus
BeitragVerfasst: Sa 12.03.11 13:58 
www.delphi-treff.de/tutorials/grundlagen/

guck dir mal die "if" abfragen an...
HenryHux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 542
Erhaltene Danke: 33

Windows 7 Premium
Delphi XE, Eclipse
BeitragVerfasst: Sa 12.03.11 13:58 
Was soll er denn mit dem VK_Space machen??
Muss das nicht irgendwie im Zusammenhang mit der Taste stehen die übergeben wird? =)

Lg
Zlatan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 175



BeitragVerfasst: Sa 12.03.11 14:01 
nachladen, ich habe ein sehr einfaches Shooterspiel vor, bzw. bin auch schon recht weit,
aber mit space soll man nachladen
Ich habe einfach muni : integer
und bei jedem Mouseclick Muni -1
HenryHux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 542
Erhaltene Danke: 33

Windows 7 Premium
Delphi XE, Eclipse
BeitragVerfasst: Sa 12.03.11 14:03 
Würd mich mal interessieren, was weit gekommen bei dir heißt, wenn du oben nicht siehst was falsch ist :D
Zlatan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 175



BeitragVerfasst: Sa 12.03.11 14:04 
nicht unverschämt werden ich brauche nur noch die nachlad funktion dann bin ich fertig
guinnes
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 182
Erhaltene Danke: 14



BeitragVerfasst: Sa 12.03.11 14:06 
user profile iconZlatan hat folgendes geschrieben Zum zitierten Posting springen:
nicht unverschämt werden

Die Wahrheit ist nicht unverschämt
HenryHux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 542
Erhaltene Danke: 33

Windows 7 Premium
Delphi XE, Eclipse
BeitragVerfasst: Sa 12.03.11 14:07 
Das war nicht unverschämt, das war ernst gemeint.
Außerdem setzt du hier bei jedem Schuss deine Munition auf 6.
Ich meine mich zu erinnern, dass das bei den meisten Waffen anders läuft :D

Btw hast du den Fehler oben denn gefunden / behoben?
Zlatan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 175



BeitragVerfasst: Sa 12.03.11 14:09 
sorry, aber ich hofte ihr wisst wo der fehler ist ich habe keine Idee mehr
also delphi sagt anstatt : ein := aber dann kommen noch mehr fehler

Ich setze meine muni nicht immer auf 6
Du weißt doch gar nicht wie ich dsas schießen realisiert habe


Zuletzt bearbeitet von Zlatan am Sa 12.03.11 14:11, insgesamt 1-mal bearbeitet
glotzer
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 393
Erhaltene Danke: 49

Win 7
Lazarus
BeitragVerfasst: Sa 12.03.11 14:11 
aus gutem grund, schau dir mal die tutorials an...
HenryHux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 542
Erhaltene Danke: 33

Windows 7 Premium
Delphi XE, Eclipse
BeitragVerfasst: Sa 12.03.11 14:18 
Wie schon oben gesagt, du kannst nicht einfach irgendwo in deinen Quelltext VK_Space reinschreiben.
Du weißt was ein Parameter ist?
Gut, bei der Procedure FormKeyDown wird die eine Variable Key vom Typ Word übergeben.
Vielleicht solltest du diese Variable mal auf den Typ VK_Space testen.
So wie es immoment ist, weiß der Compiler nicht, was er damit anfangen soll.
VK_Space ist keine Variable und somit kannst du ihr mit := nichts zuweisen!

Lg
MaxWurzel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 77
Erhaltene Danke: 10



BeitragVerfasst: Mo 14.03.11 08:36