Hi p(3.14), I don't know if this will help or not. The "old" way of collision detection is as follows:
Code:
procedure TPlayerSprite.DoCollision(Sprite: TSprite; var Done: Boolean);
begin
if Sprite is TMonoSprite then
TMonoSprite(Sprite).Hit;
Done := False;
end;
The "new" way, also used in unDelphiX 1.08 is:
Code:
procedure TfrmMain.CarCollision(Sender:TObject;var done:Boolean);
var
theMan : TMan;
begin
if (sender is TMan) then
begin
theMan:=TMan(sender);
if (not theMan.hit) then
begin
theMan.Image:=dximgs.Items[fBloodImageIndex];
theMan.Z:=-30;
theMan.hit:=true;
fScore:=fScore+100;
end;
end;
end;
Then in your _psStartingState:
Code:
Car:=TCar.create(dxspriteEngine1.engine,dximageList1,CarImageIndex,_startingGas); Car.OnCollision:=self.carCollision;
Maybe it will help you :-) My game written in unDelphiX is also full screen but I don't have the alt tab crash...
Bookmarks