DelphiX

Game programming

 

English

 Russian

Project files structure and FAQ

Graphic files priority:

load *.dxg  else // if not found
load *.bmp else // if not found
load *.jpg 

File location.

*.dxg must be on Graphics\DXG
*.bmp must be on Graphics\BMP
*.jpg must be on Graphics\JPG

 

*.dxw must be on Sound\DXW
*.wav must be on Sound\WAV

You may mix *.dxg *.bmp and  *.jpg

In Graphics\data you can find information about used graphics.

 

If you downloaded 11025_8_mono format files.

You will need next change in project code.

procedure TMainForm.DXSoundInitialize(Sender: TObject);
var
WaveFormat:TWaveFormatEx;
begin
MakePCMWaveFormatEx(WaveFormat,11025,8,1);
//MakePCMWaveFormatEx(WaveFormat,22050,16,1);
DXSound.Primary.SetFormat(WaveFormat);
end;

 

If you downloaded  files only  for  gsMain and gssMenu scene.

You need skip gsTitle and gsMainMenu scene. So you will need next change in project code.

procedure TMainForm.FormCreate(Sender: TObject);
begin
.......
.......
//StartScene(gsTitle);//skip
//StartScene(gsMainMenu);//skip
StartScene(gsMain);

end;

and Quit from program by clicking 'ESC' to skip gsGameOver scene or disable it.

 

DXSprite.pas was changed  to make property SurfaceRect accessible from outside of the unit.

All changes are green.

...........

procedure SetSurfaceRect(const Value: TRect);
public

............

property SurfaceRect: TRect read FSurfaceRect write SetSurfaceRect;

..........

procedure TSpriteEngine.SetSurface(Value: TDirectDrawSurface);
begin
FSurface := Value;
if FSurface<>nil then
begin
SurfaceRect := Surface.ClientRect;
//FSurfaceRect := Surface.ClientRect;
//Width := FSurfaceRect.Right-FSurfaceRect.Left;
//Height := FSurfaceRect.Bottom-FSurfaceRect.Top;
end;
end;

procedure TSpriteEngine.SetSurfaceRect(const Value: TRect);
begin
FSurfaceRect := Value;
Width := FSurfaceRect.Right-FSurfaceRect.Left;
Height := FSurfaceRect.Bottom-FSurfaceRect.Top;
end;

Source code initially  is in window mode.

unit Main;
.............................
const
//FullScreen=true;
FullScreen=false;

 

 
 

Site Navigator

home/news

in game graphics

coming soon

tutorials

 

structure

download

e-mail

 




TopList

 

 

Hosted by uCoz