unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus, Buttons;
type
TForm1 =
class(TForm)
Image1: TImage;
Image2: TImage;
Image3: TImage;
MainMenu1: TMainMenu;
Datei1: TMenuItem;
Start1: TMenuItem;
Beenden1: TMenuItem;
Timer1: TTimer;
Image4: TImage;
procedure FormKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
procedure Beenden1Click(Sender: TObject);
procedure Start1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
a,b,i,x,y:integer;
implementation
{$R *.dfm}
procedure TForm1.Start1Click(Sender: TObject);
begin
x:=0; y:=0;
image1.picture.loadfromfile('
space2.bmp');
image2.picture.loadfromfile('
terran1-big1.bmp');
image3.picture.loadfromfile('
ufo2-big3.bmp');
image1.Left:=x;
image1.Top:=y;
timer1.Enabled:=false;
end;
procedure Tform1.FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
var h: integer;
begin
form1.Caption:=inttostr(key);
if key=37
then inc(x);
if key=38
then dec(x);
if key=39
then inc(y);
if key=40
then dec(y);
{if key=32 then
begin
i:=0;
h:=0;
image4.picture.loadfromfile('bullet1.bmp');
image4.Left:=a;
image4.Top:=b;
repeat
begin
inc(a);
h:=h+1;
if h=50 then i:=1;
end;
until i=1;
end; }
end;
procedure Tform1.Timer1Timer(Sender: TObject);
begin
// inc(x);
image2.Left:=x;
image2.top:=y;
end;
procedure TForm1.Beenden1Click(Sender: TObject);
begin
close;
end;
end.