Changeset 34 for trunk/UGame.pas
- Timestamp:
- Oct 13, 2019, 2:08:10 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r33 r34 717 717 begin 718 718 Result := False; 719 if Direction = drNone then Exit; 719 720 Area := GetMoveArea(Direction); 720 721 for I := 0 to Max(Board.Size.X, Board.Size.Y) - 1 do begin … … 878 879 NewTile: TTile; 879 880 begin 880 HighestValue := Board.GetHighestTileValue; 881 MoveAllAnimate(Direction); 882 883 NewTile := FillRandomTile; 884 HistoryMove := THistoryMove.Create; 885 HistoryMove.Direction := Direction; 886 HistoryMove.NewItemPos := NewTile.Index; 887 HistoryMove.NewItemValue := NewTile.Value; 888 History.Moves.Add(HistoryMove); 889 890 if not CanMove and (Board.GetEmptyTilesCount = 0) then 891 GameOver; 892 if (HighestValue < WinScore) and 893 (Board.GetHighestTileValue >= WinScore) then Win; 881 if CanMoveDirection(Direction) then begin 882 HighestValue := Board.GetHighestTileValue; 883 MoveAllAnimate(Direction); 884 885 NewTile := FillRandomTile; 886 HistoryMove := THistoryMove.Create; 887 HistoryMove.Direction := Direction; 888 HistoryMove.NewItemPos := NewTile.Index; 889 HistoryMove.NewItemValue := NewTile.Value; 890 History.Moves.Add(HistoryMove); 891 892 if not CanMove and (Board.GetEmptyTilesCount = 0) then 893 GameOver; 894 if (HighestValue < WinScore) and 895 (Board.GetHighestTileValue >= WinScore) then Win; 896 end; 894 897 end; 895 898
Note:
See TracChangeset
for help on using the changeset viewer.