Changeset 37
- Timestamp:
- Oct 13, 2019, 5:20:58 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r36 r37 88 88 Core.PersistentForm1.Load(Self); 89 89 UpdateInterface; 90 if Core.Game.Board.GetEmptyTilesCount > Core.Game.Board.Size.X * Core.Game.Board.Size.Y - 2 then 90 if Core.Game.Board.GetEmptyTilesCount > Core.Game.Board.Size.X * Core.Game.Board.Size.Y - 91 InitialTileCount then 91 92 Core.Game.New; 92 93 end; -
trunk/UGame.pas
r36 r37 152 152 ); 153 153 DirectionText: array[TMoveDirection] of string = ('None', 'Left', 'Up', 'Right', 'Down'); 154 InitialTileCount = 2; 154 155 155 156 resourcestring … … 482 483 Result := EmptyTiles[Random(EmptyTiles.Count)]; 483 484 Result.Value := NewValue; 484 if RecordHistory then begin485 SetLength(History.InitialTilesPos, Length(History.InitialTilesPos) + 1);486 History.InitialTilesPos[Length(History.InitialTilesPos) - 1] := Result.Index;487 end;488 485 end; 489 486 EmptyTiles.Free; … … 529 526 Running := True; 530 527 History.Clear; 531 for I := 0 to 1 do 532 FillRandomTile(0); 528 if RecordHistory then begin 529 for I := 0 to InitialTileCount - 1 do begin 530 SetLength(History.InitialTilesPos, Length(History.InitialTilesPos) + 1); 531 History.InitialTilesPos[Length(History.InitialTilesPos) - 1] := FillRandomTile(0).Index; 532 end; 533 end else begin 534 for I := 0 to InitialTileCount - 1 do 535 FillRandomTile(0); 536 end; 533 537 DoChange; 534 538 end;
Note:
See TracChangeset
for help on using the changeset viewer.