Le jeu de labyrinthe fun et gratuit - Retour au site
 
							 
							
						 5
  5   
								
								Hors-ligne
 
							 
							
						 9
  9   
								
								uses
  FunLabyBase,FunLabyGraphics;
messages
  Move: TDispatchMessage = $32;
components
  Movant: TMovant;
poscomponent TMovant(TMobileComponent)
  name 'Truc qui bouge';
  image '';
  on message GameStarted do
  begin
    Master.Timers.ScheduleNotificationMsg(ShortDelay, Self, msgMove);
  end;
  on message Move do
  var
    Effect: TEffect;
  begin
    try
      if Map = nil then
        Exit;
      Effect := Map[Position].Effect;
      if (Effect is TArrow) and (TArrow(Effect).Direction <> diNone) then
        Direction := TArrow(Effect).Direction;
    finally
      Master.Timers.ScheduleNotificationMsg(500, Self, msgMove);
    end;
  end;
end;
end.Hors-ligne
 
							 
							
						 14
  14   
								
								 MovingMonsters c'est particulier parce que le monstre doit se déplacer de lui-même à intervalles réguliers.
 MovingMonsters c'est particulier parce que le monstre doit se déplacer de lui-même à intervalles réguliers.
Truc.ChangePosition(Point3D(3, 4, 0));Hors-ligne
 
							 
							
						 5
  5   
								
								Hors-ligne
 
							 
							
						 5
  5   
								
								obstacle TPlayerHasSword
  name 'Personnage qui bloque le joueur s''il n''a pas d''épée';
  image 'Characters/ManWithBeard';
  on Pushing do
  var
    Selected: Integer;
  begin
    inherited;
    if not KeyPressed then
      Exit;
    Selected := Player.ShowSelectionMsg(
      'Eh toi, que fais-tu là ? Tu veux aller dans la forêt ? C''est '+
      'dangereux ! Je ne te laisserai passer que si tu as une épée. Est-ce le '+
      'cas ?',
      ['Oui', 'Non']
      );
    if Selected = 0 then
    begin
      Player.ShowMessage ('Prouve-le moi en tuant le monstre, juste à côté !');
      StillMovingMonster.ChangePosition(Point3D(11,23,1));
    end else
    begin
      Player.ShowMessage ('Va en trouver une alors, si tu veux entrer dans la forêt !');
    end;
  end;
end;
poscomponent TStillMovingMonster (TMovingMonster)
  name 'Petit monstre qui teste le joueur';
  on ChangePosition do
  begin
    inherited;
    if not Master.Editing and (Map = nil) then
    begin
      Master.Map['ForestMap'].Map[10,22,1].Obstacle:=nil;
      Master.Map['ForestMap'].Map[9,22,1].Obstacle:=ManAfterPlayerHasSword;
    end;
  end;
end;Modifié Xaumina (mars 19, 2011 17:22:25)
Hors-ligne
 
							 
							
						 5
  5   
								
								Modifié Xaumina (mars 19, 2011 17:31:42)
Hors-ligne
 
							 
							
						 14
  14   
								
								var
  QPos: TQualifiedPos;
begin
  // Reste de ton code
  QPos.Map := Map;
  QPos.Position := Point3D(11, 23, 1);
  StillMovingMonster.ChangePosition(QPos);
end;Hors-ligne
 
							 
							
						 5
  5   
								
								Modifié Xaumina (mars 19, 2011 19:10:24)
Hors-ligne
 
							 
							
						 14
  14   
								
								StillMovingMonster.ChangePosition(Point3D(11,23,1));Hors-ligne
 
							 
							
						 5
  5   
								
								Modifié Xaumina (mars 19, 2011 19:48:05)
Hors-ligne