Le jeu de labyrinthe fun et gratuit - Retour au site
 
							 
							
						 5
  5   
								
								if Selected = 0 thenobstacle TMarchandBase
  name 'Marchand de base';
  category SCategoryMoney;
  property Price : Integer;
  on Pushing do
  var
    Selected: Integer;
  begin
    inherited;
    if not KeyPressed then
      Exit;
    Selected := Player.ShowSelectionMsg(
      'Veux-tu m''acheter quelque chose ?',
      ['Oui', 'Non']
      );
    if Selected = 0 then
    begin
      if MoneyPlugin.Counter >= Price then
        MoneyPlugin.Counter := MoneyPlugin.Counter - Price
      else
        Player.ShowMessage ('Mais... Tu n''as pas assez d''argent ! Reviens quand tu en auras plus !');
    end;
    if Selected = 1 then
    begin
      Player.ShowMessage ('Alors, à la prochaine fois, peut-être !');
    end;
  end;
end;obstacle TMarchandOfSilverKey
  name 'Marchand de clef d''argent';
  category SCategoryMoney;
  on Pushing do
  var
    Selected: Integer;
  begin
    inherited;
    if not KeyPressed then
      Exit;
    Selected := Player.ShowSelectionMsg(
      'Veux-tu acheter ma clé d''argent ?',
      ['Oui', 'Non']
      );
    if Selected = 0 then
    begin
      if MoneyPlugin.Counter >= 10 then
      begin
        MoneyPlugin.Counter := MoneyPlugin.Counter - 10
        Player receives 1 SilverKey;
      end else
        Player.ShowMessage ('Mais... Tu n''as pas assez d''argent ! Reviens quand tu en auras plus !');
    end;
    if Selected = 1 then
    begin
      Player.ShowMessage ('Alors, à la prochaine fois, peut-être !');
    end;
  end;
end;Modifié Xaumina (juin 8, 2011 15:02:58)
Pièces jointes :  Money.fnd (6,1 KB)
 Money.fnd (6,1 KB)
Hors-ligne
 
							 
							
						 14
  14   
								
								if (MoneyPlugin.Counter = Price) or (MoneyPlugin.Counter > Price) thenif MoneyPlugin.Counter >= Price then 
					
						
						Hors-ligne
 
							 
							
						 5
  5   
								
								Pièces jointes :  Money.fnd (6,1 KB)
 Money.fnd (6,1 KB)
Hors-ligne
 
							 
							
						 0
  0   
								
								


Hors-ligne
 
							 
							
						 14
  14   
								
								Hors-ligne
 
							 
							
						 0
  0   
								
								
Hors-ligne
 
							 
							
						 0
  0   
								
								 y'a du mieux : Plus d'erreur de compil'…
 y'a du mieux : Plus d'erreur de compil'…


 
					
						
						Modifié DerF_44 (nov. 20, 2011 16:48:15)
Hors-ligne
 
							 
							
						 14
  14   
								
								 
					
						
						Hors-ligne
 
							 
							
						 0
  0   
								
								



 (mais pas pour son explication !.
 (mais pas pour son explication !. )
)Pièces jointes :  Test Money.zip (52,9 KB)
 Test Money.zip (52,9 KB)
Hors-ligne
 
							 
							
						 14
  14   
								
								 
					
						
						Hors-ligne