Le jeu de labyrinthe fun et gratuit - Retour au site
unit TresorAleatoire;
uses
FunLabyBase;
components
PoseTresor : TPoseTresor;
function OkPourPoserTresor(Square: TSquare): Boolean private;
begin
Result := (Square.Field is TGround) and (Square.Effect = nil) and
(Square.Tool = nil) and (Square.Obstacle = nil);
end;
effect TPoseTresor
name 'Pose du trésor';
on AfterConstruction do
begin
inherited;
EditVisualTag := 'Tréso';
end;
on Exited do
var
Map : TMap;
TresorX : Integer;
TresorY : Integer;
begin
inherited;
Map := Master.Map['MainMap'];
repeat
TresorX := Random(21-11+1) + 11;
TresorY := Random(11);
until OkPourPoserTresor(Map[Point3D(TresorX, TresorY, 0)]);
Map[Point3D(TresorX, TresorY, 0)].Effect := Treasure;
Square.Effect := nil;
end;
end;
end.
Modifié DerF_44 (nov. 19, 2012 13:10:52)
Hors-ligne
unit MovingWall;
uses
FunLabyBase;
messages
BlocMobile1 : TPlayerMessage = 101;
BlocMobile2 : TPlayerMessage = 102;
BlocMobile3 : TPlayerMessage = 103;
BlocsMobiles : TPlayerMessage = 104;
components
MurMobile : TMurMobile;
GoTimer : TGoTimer;
MurMobilePlugin : TMurMobilePlugin;
field TMurMobile
name 'Mur mobile';
image 'Fields/FireWall';
on Entering do
begin
inherited;
Cancel;
end;
end;
effect TGoTimer
name 'Déclencheur compte à rebours';
on AfterConstruction do
begin
inherited;
EditVisualTag := 'Départ';
end;
on Exited do
begin
inherited;
Master.Timers.ScheduleNotificationMsg(2000, Player, msgBlocMobile1);
Master.Timers.ScheduleNotificationMsg(4000, Player, msgBlocMobile2);
Master.Timers.ScheduleNotificationMsg(6000, Player, msgBlocMobile3);
Master.Timers.ScheduleNotificationMsg(8000, Player, msgBlocsMobiles);
Square.Effect := nil;
Player.PlaySound('Passage secret.wav');
end;
end;
plugin TMurMobilePlugin
hint 'plugin du mur mobile';
on message BlocMobile1 do
var
Map : TMap;
begin
Map := Master.Map['MainMap'];
Map[3, 4, 0].Field := Hole;
Map[6, 4, 0].Field := MurMobile;
end;
on message BlocMobile2 do
var
Map : TMap;
begin
Map := Master.Map['MainMap'];
Player.PlaySound('Passage secret.wav');
Map[4, 4, 0].Field := Hole;
Map[7, 4, 0].Field := MurMobile;
end;
on message BlocMobile3 do
var
Map : TMap;
begin
Map := Master.Map['MainMap'];
Map[5, 4, 0].Field := Hole;
Map[8, 4, 0].Field := MurMobile;
end;
on message BlocsMobiles do
var
Map : TMap;
begin
Map := Master.Map['MainMap'];
Map[6, 4, 0].Field := Grass;
Map[7, 4, 0].Field := Grass;
Map[8, 4, 0].Field := Grass;
Map[6, 3, 0].Field := MurMobile;
Map[7, 3, 0].Field := MurMobile;
Map[8, 3, 0].Field := MurMobile;
end;
end;
end.
Modifié DerF_44 (nov. 20, 2012 01:56:49)
Hors-ligne
unit PortesSurprises;
uses
FunLabyBase;
messages
MurFerme : TPlayerMessage = 101;
components
GoTimer1 : TGoTimer1;
GoTimer2 : TGoTimer2;
GoTimer3 : TGoTimer3;
GoTimer4 : TGoTimer4;
GoTimer5 : TGoTimer5;
GoTimer6 : TGoTimer6;
GoTimer7 : TGoTimer7;
MursPlugin : TMursPlugin;
effect TGoTimer1
name 'Go1';
property MurY : Integer;
on AfterConstruction do
begin
inherited;
EditVisualTag := 'Départ';
end;
on Exited do
var
Map : TMap;
begin
inherited;
MurY := Random(9);
Map := Master.Map['MainMap'];
Map[1, MurY, 0] := Grass+GoTimer2;
Master.Timers.ScheduleNotificationMsg(1500, Player, msgMurFerme);
Square.Effect := nil;
end;
end;
effect TGoTimer2
name 'Go2';
property MurY : Integer;
on Exited do
var
Map : TMap;
begin
inherited;
MurY := Random(9);
Map := Master.Map['MainMap'];
Map[3, MurY, 0] := Grass+GoTimer3;
Master.Timers.ScheduleNotificationMsg(1500, Player, msgMurFerme);
Square.Effect := nil;
end;
end;
//---------------------------------Etc, etc, jusqu'à l'effet TGoTimer7..
//---------------------------------On incrémente à chaque fois le X de Map, de 2 en 2,
//---------------------------------et on pose le GoTimer suivant...
effect TGoTimer7
name 'Go7';
property MurY : Integer;
on Exited do
var
Map : TMap;
begin
inherited;
MurY := Random(9);
Map := Master.Map['MainMap'];
Map[13, MurY, 0].Field := Grass;
Master.Timers.ScheduleNotificationMsg(1500, Player, msgMurFerme);
Square.Effect := nil;
end;
end;
plugin TMursPlugin
hint 'Plugin des murs';
property MurX : Integer;
on AfterConstruction do
begin
MurX := -1;
end;
on message MurFerme do
var
Map : TMap;
I : Integer;
begin
MurX := MurX + 2;
Map := Master.Map['MainMap'];
Player.PlaySound('Explosion.wav');
for I := 0 to 8 do
begin
Map[MurX, I, 0].Field := Wall;
end;
end;
end;
end.
Modifié DerF_44 (nov. 23, 2012 10:07:35)
Hors-ligne