Le jeu de labyrinthe fun et gratuit - Retour au site
5
Hors-ligne
14
effect TMyMultiButton(TPushButton)
name 'Boutons multiples';
property Count: Integer; // nombre de boutons en tout (4 pour toi)
property DownCount: Integer;
on ButtonDown do
begin
DownCount := DownCount + 1;
if DownCount = Count then
begin
// Ici tous les boutons sont appuyés en même temps
FaireCeQuIlFaut;
end;
end;
on ButtonUp do
begin
DownCount := DownCount - 1;
end;
end;
Hors-ligne
5
Modifié Xaumina (mars 18, 2011 09:38:57)
Hors-ligne
14
Hors-ligne
5
Hors-ligne
5
Hors-ligne
14
Hors-ligne
5
Hors-ligne
14
obstacle TMonObstacle
name '...':
image '...':
property Count: Integer; // nombre total à détruire (le spécifier dans l'inspecteur)
property DestroyedCount: Integer;
on Pushing do
begin
inherited;
if Player can DestroyMyObstacle then
begin
Square.Obstacle := nil;
DestroyedCount := DestroyedCount + 1;
if DestroyedCount = Count then
begin
// ici tous les obstacles ont été détruits
end;
end else
begin
Player.ShowMessage('...');
end;
end;
end;
Hors-ligne
5
Hors-ligne