Le jeu de labyrinthe fun et gratuit - Retour au site
plugin TBombPlugin
hint 'Plugin des bombes';
on AfterConstruction do
begin
inherited;
MaxLength := 1;
end;
on PressKey do
var
ObjectBomb : TObjectBomb;
Square : TSquare;
BombEffect : TEffect;
Map: TMap;
Pos, OrigPos: T3DPoint;
Dir: TDirection;
Len, I: Integer;
QPos: TQualifiedPos;
begin
Map := Player.Map;
OrigPos := Player.Position;
Pos := PointBehind(OrigPos, Dir);
Len := 0;
QPos.Map := Map;
if Key <> Ord('B') then
Exit;
if Player can ExplosObstacle then
Square.Effect := BombEffect;
BombObject.Count := BombObject.Count - 1;
Temporize;
Temporize;
OrigPos + 1;
OrigPos.Obstacle := nil;
end else
Player.PlaySound ('Sol.wav');
end;
end;
Hors-ligne
OrigPos := PointBefhind(OrigPos, diNorth); // ou Player.Direction
Hors-ligne
Hors-ligne