Le jeu de labyrinthe fun et gratuit - Retour au site
Modifié DerF_44 (nov. 16, 2011 12:42:47)
Hors-ligne
Hors-ligne
if Player has at least 10 SilverKeys then
Player discards 10 SilverKeys
else
Player.SilverKeys := 0;
Hors-ligne
Hors-ligne
Modifié DerF_44 (nov. 18, 2011 09:41:57)
Hors-ligne
ShowFullScreenMessage(Player, 'Le message à afficher en plein écran.');
plugin TOnGameStartedPlugin
on message GameStarted do
begin
// Ici les choses à faire au début du jeu
end;
end;
Modifié sjrd (nov. 18, 2011 11:24:32)
Hors-ligne
sjrd
Le plus simple est d'aller voir directement comment c'est fait dans le didacticiel. L'utile se trouve dans DidacticielUtils.fnd.
Hors-ligne
uses
FunLabyBase, FullScreenPlayerMessage;
procedure BeginFullScreenMessages(Player: TPlayer);
var
Master: TMaster;
begin
Master := Player.Master;
Player.RemovePlugin(DefaultShowMessagePlugin);
Player.AddPlugin(FullScreenShowMessagePlugin);
end;
procedure EndFullScreenMessages(Player: TPlayer);
var
Master: TMaster;
begin
Master := Player.Master;
Player.RemovePlugin(FullScreenShowMessagePlugin);
Player.AddPlugin(DefaultShowMessagePlugin);
end;
procedure ShowFullScreenMessage(Player: TPlayer; const Text: string);
begin
BeginFullScreenMessages(Player);
try
Player.ShowMessage(Text);
finally
EndFullScreenMessages(Player);
end;
end;
Modifié sjrd (nov. 18, 2011 14:12:54)
Hors-ligne
Modifié DerF_44 (nov. 18, 2011 15:39:12)
Hors-ligne
ShowFullScreenMessage(Player, 'Le message');
Player.ShowMessage('Le message');
unit TonLaby;
uses
FunLabyBase, FullScreenPlayerMessage;
components
OnGameStartedPlugin: TOnGameStartedPlugin;
procedure BeginFullScreenMessages(Player: TPlayer);
var
Master: TMaster;
begin
Master := Player.Master;
Player.RemovePlugin(DefaultShowMessagePlugin);
Player.AddPlugin(FullScreenShowMessagePlugin);
end;
procedure EndFullScreenMessages(Player: TPlayer);
var
Master: TMaster;
begin
Master := Player.Master;
Player.RemovePlugin(FullScreenShowMessagePlugin);
Player.AddPlugin(DefaultShowMessagePlugin);
end;
procedure ShowFullScreenMessage(Player: TPlayer; const Text: string);
begin
BeginFullScreenMessages(Player);
try
Player.ShowMessage(Text);
finally
EndFullScreenMessages(Player);
end;
end;
plugin TOnGameStartedPlugin
on message GameStarted do
begin
ShowFullScreenMessage(Player,
'Ici le texte affiché en plein écran au démarrage du jeu');
end;
end;
end.
Hors-ligne