Ignore:
Timestamp:
Oct 13, 2019, 5:34:57 PM (5 years ago)
Author:
chronos
Message:
  • Added: In computer AI form allow to set delay of steps computation. Set to zero means fastest processing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormComputer.pas

    r32 r38  
    66
    77uses
    8   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, UGame, fgl;
     8  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
     9  UGame, fgl;
    910
    1011type
     
    3031    ButtonStart: TButton;
    3132    ButtonStop: TButton;
     33    Label1: TLabel;
     34    TrackBar1: TTrackBar;
    3235    procedure ButtonStartClick(Sender: TObject);
    3336    procedure ButtonStopClick(Sender: TObject);
     
    135138  );
    136139begin
     140  ButtonStopClick(Self);
    137141  Core.PersistentForm1.Save(Self);
    138142end;
     
    187191        S := S + '), ';
    188192      end;
    189       MoveAllAndUpdate(GameTries[0].Moves[0]);
     193      MoveAllAndUpdate(GameTries[0].Moves[0], False);
    190194{      if CanMergeDirection(drDown) then MoveAllAnimate(drDown)
    191195      else if CanMergeDirection(drRight) then MoveAllAnimate(drRight)
     
    198202      }
    199203      Application.ProcessMessages;
    200       Sleep(10);
     204      Sleep(TrackBar1.Position);
    201205    end;
    202206  end;
     
    243247      NewTry.Game.UndoEnabled := False;
    244248      NewTry.Game.AnimationDuration := 0;
    245       NewTry.Game.MoveAllAnimate(Direction);
     249      NewTry.Game.MoveAll(Direction, False);
    246250      SetLength(NewTry.Moves, Length(NewTry.Moves) + 1);
    247251      NewTry.Moves[Length(NewTry.Moves) - 1] := Direction;
Note: See TracChangeset for help on using the changeset viewer.