Le jeu de labyrinthe fun et gratuit - Retour au site
Hors-ligne
Hors-ligne
Hors-ligne
Player.Lose;
Player.ShowMessage('Tu as dépassé le nombre de pas autorisé : tu as perdu !');
Hors-ligne
Hors-ligne
uses
FunLabyBase, FLBSimpleEffects;
const
idGrass = 'Grass';
idWall = 'Wall';
components
StepCounter: TCounterOnViewPlugin
MsgFormat: 'Pas : %d';
TextX: 12;
TextY: 8;
end;
LevelCounter: TCounterOnViewPlugin
MsgFormat: 'Niveau %d';
TextX: 309;
TextY: 8;
end;
MaxStepCounter: TCounterOnViewPlugin
MsgFormat: 'Pas requis maximum : %d';
TextX: 12;
TextY: 280;
end;
plugin TCounterOnViewPlugin3
hint 'Pas requis';
property MsgFormat: string;
property Counter: Integer;
property BackColor: TColor32;
property FontColor: TColor32;
property TextX: Integer;
property TextY: Integer;
on AfterConstruction do
begin
inherited;
MsgFormat := '%d';
BackColor := clWhite32;
FontColor := clBlack32;
TextX := 8;
TextY := 8;
end;
on DrawView do
var
Text: string;
Extent: TSize;
begin
Bitmap.Font.Name := 'Tahoma'; {don't localize}
Bitmap.Font.Size := 8;
Text := Format(MsgFormat, [Counter]);
Extent := Bitmap.TextExtent(Text);
Bitmap.FillRectTS(TextX-2, TextY, TextX+Extent.cx+2, TextY+Extent.cy,
BackColor);
Bitmap.RenderText(TextX, TextY, Text, 12, FontColor);
end;
end;
field TPas(TGround)
name 'Terrain à pas + murs';
image 'Fields/Grass';
on Entering do
begin
CounterOnViewPlugin.Counter := CounterOnViewPlugin.Counter + 1;
end;
on Entered do
begin
Master.Map['MainMap'].Map[Pos.X+1,Pos.Y+2,Pos.Z].Field := Wall;
end;
end;
Map[Pos.X+1, Pos.Y+2, Pos.Z].Field := Wall;
effect TBouty(TCounterEffect)
name 'touby';
on Execute do
begin
if CounterOnViewPlugin.Counter > CounterOnViewPlugin3.Counter then
Player.MoveTo(Point3D(3, 3, 0))
else
Master.Map['MainMap'].Map[5, 79, 0] := Grass;
CounterOnViewPlugin.Counter := 0;
Master.Map['MainMap'].Map[6, 79, 0] := Grass;
end;
end;
on Execute do
begin
if CounterOnViewPlugin.Counter > CounterOnViewPlugin3.Counter then
Player.MoveTo(Point3D(3, 3, 0))
else
begin
Map[5, 79, 0] := Grass;
CounterOnViewPlugin.Counter := 0;
Map[6, 79, 0] := Grass;
end;
end;
Hors-ligne
Pièces jointes : Pas.zip (15,5 KB)
Hors-ligne
Hors-ligne
Hors-ligne