Changeset 65 for trunk/UCore.pas


Ignore:
Timestamp:
Jan 23, 2020, 12:21:53 AM (5 years ago)
Author:
chronos
Message:
  • Added: Separated TGame paint and state change events.
  • Modified: Animate tiles movements in background thread.
  • Modified: Initialize TCore as first application form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r51 r65  
    4040  private
    4141    procedure GameChange(Sender: TObject);
     42    procedure GamePaint(Sender: TObject);
    4243    procedure GameWin(Sender: TObject);
    4344    procedure GameOver(Sender: TObject);
     
    8081  Game.Board.Size := Point(4, 4);
    8182  Game.OnChange := GameChange;
     83  Game.OnPaint := GamePaint;
    8284  Game.OnWin := GameWin;
    8385  Game.OnGameOver := GameOver;
     
    179181procedure TCore.GameChange(Sender: TObject);
    180182begin
    181   FormMain.Redraw;
    182183  UpdateInterface;
     184end;
     185
     186procedure TCore.GamePaint(Sender: TObject);
     187begin
     188  if Assigned(FormMain) then FormMain.Redraw;
    183189end;
    184190
Note: See TracChangeset for help on using the changeset viewer.