procedure TForm1.FormCreate(Sender: TObject);
var i, zufall:Integer;
begin
Randomize;
ReportMemoryLeaksOnShutdown := true;
AdPerCounter := TAdPerformanceCounter.Create;
AdDraw := TAdDraw.Create(self);
AdDraw.DllName := '
AndorraDX93D.dll';
if AdDraw.Initialize
then
begin
Application.OnIdle := Idle;
AdImageList := TAdImageList.Create(AdDraw);
with AdImageList.Add('
boy')
do
begin
Texture.LoadGraphicFromFile('
Bilder/boy.bmp',true,clFuchsia);
PatternWidth := 96;
PatternHeight := 96;
end;
with AdImageList.Add('
baker')
do
begin
Texture.LoadGraphicFromFile('
Bilder/baker.bmp',true,clFuchsia);
PatternWidth := 96;
PatternHeight := 96;
end;
with AdImageList.Add('
miller')
do
begin
Texture.LoadGraphicFromFile('
Bilder/miller.bmp',true,clFuchsia);
PatternWidth := 96;
PatternHeight := 96;
end;
with AdImageList.Add('
miner')
do
begin
Texture.LoadGraphicFromFile('
Bilder/miner.bmp',true,clFuchsia);
PatternWidth := 96;
PatternHeight := 96;
end;
with AdImageList.Add('
lumberjack')
do
begin
Texture.LoadGraphicFromFile('
Bilder/lumberjack.bmp',true,clFuchsia);
PatternWidth := 96;
PatternHeight := 96;
end;
with AdImageList.Add('
BG')
do
begin
Texture.LoadGraphicFromFile('
Bilder/BG.bmp',true,clFuchsia);
{PatternWidth := 96;
PatternHeight := 96; }
end;
AdImageList.Restore;
//Erzeugen des Partikelsystems
partsys := TAdParticleSystem.Create(AdDraw);
//Zuweisen des Bildes
partsys.Texture := AdImageList.Items[0].Texture;
AdGUI := TAdGUI.Create(AdDraw);
//Erzeugen der Klasse
AdGUI.Skin.LoadFromFile('
Bilder/sunna.axs');
//Laden des Skins
AdGUI.Cursors.LoadFromFile('
Bilder/cursors.xml');
//Laden der Cursor
AdGUI.LoadFromFile('
Bilder/gui.axg');
//Laden der GUI
AdConnector := TAdGUIConnector.Create(AdGUI);
//Erzeugen des GUI Connectors
AdConnector.ConnectEventHandlers(AdDraw.Window);
//Verknüfen mit dem Elternfenstersystem
//SpriteEngine erzeugen
AdSpriteEngine := TSpriteEngine.Create(
nil);
AdSpriteEngine.Surface := AdDraw;
for i := 0
to 9
do
begin
with TFigur.Create(AdSpriteEngine)
do
begin
zufall := random(5);
case zufall
of
0: Image := AdImageList.Find('
boy');
1: Image := AdImageList.Find('
baker');
2: Image := AdImageList.Find('
miller');
3: Image := AdImageList.Find('
miner');
4: Image := AdImageList.Find('
lumberjack');
end;
AnimActive := true;
AnimLoop := true;
AnimSpeed := 15;
XSpeed := -(random(100)+50);
SetLine;
end;
with TBackgroundSprite.Create(AdSpriteEngine)
do begin
Image:=AdImageList.Find('
BG');
z:=-1;
Depth:=10;
end;
end;
end
else
begin
ShowMessage('
Error while initializing Andorra 2D. Try to use another display '+
'
mode or another video adapter.');
Close;
end;
TAdButton(AdGUI.FindComponent('
Start')).X := (ClientWidth
div 2) - (TAdButton(AdGUI.FindComponent('
Start')).Width
div 2);
TAdButton(AdGUI.FindComponent('
Start')).Y := (ClientHeight
div 4) - (TAdButton(AdGUI.FindComponent('
Start')).Height
div 2);
TAdButton(AdGUI.FindComponent('
Start')).OnClick := Start;
TAdButton(AdGUI.FindComponent('
Optionen')).X := (ClientWidth
div 2) - (TAdButton(AdGUI.FindComponent('
Optionen')).Width
div 2);
TAdButton(AdGUI.FindComponent('
Optionen')).Y := ((ClientHeight
div 4) * 2) - (TAdButton(AdGUI.FindComponent('
Optionen')).Height
div 2);
TAdButton(AdGUI.FindComponent('
Optionen')).OnClick := Options;
TAdButton(AdGUI.FindComponent('
Beenden')).X := (ClientWidth
div 2) - (TAdButton(AdGUI.FindComponent('
Beenden')).Width
div 2);
TAdButton(AdGUI.FindComponent('
Beenden')).Y := ((ClientHeight
div 4) * 3) - (TAdButton(AdGUI.FindComponent('
Beenden')).Height
div 2);
TAdButton(AdGUI.FindComponent('
Beenden')).OnClick := Beenden;
HintWindowClass := TGraphicHintWindow;
Application.ShowHint := False;
Application.ShowHint := True;
{CL:=loadIni(DE);
if CL<>nil then
fillProps([form1],CL); }
end;