- Timestamp:
- Feb 16, 2014, 11:58:42 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UFormMain.pas
r9 r10 77 77 procedure TFormMain.PaintBox1Paint(Sender: TObject); 78 78 begin 79 with TPlayer(Game.Players[0])do begin79 with Game.CurrentPlayer do begin 80 80 View := Bounds(View.Left, View.Top, PaintBox1.Width, 81 81 PaintBox1.Height); … … 143 143 begin 144 144 if Button = mbLeft then begin 145 StartMousePoint := Point(X, Y); 146 StartViewPoint := Point(TPlayer(Game.Players[0]).View.Left, TPlayer(Game.Players[0]).View.Top); 147 MoveActive := True; 145 if Game.CurrentPlayer.Mode = pmHuman then begin 146 StartMousePoint := Point(X, Y); 147 StartViewPoint := Point(Game.CurrentPlayer.View.Left, Game.CurrentPlayer.View.Top); 148 MoveActive := True; 149 end; 148 150 end; 149 151 end; … … 158 160 begin 159 161 if MoveActive then begin 160 TPlayer(Game.Players[0]).View := Bounds(StartViewPoint.X + StartMousePoint.X - X, 161 StartViewPoint.Y + StartMousePoint.Y - Y, 162 TPlayer(Game.Players[0]).View.Right - TPlayer(Game.Players[0]).View.Left, 163 TPlayer(Game.Players[0]).View.Bottom - TPlayer(Game.Players[0]).View.Top); 164 Redraw; 162 if Game.CurrentPlayer.Mode = pmHuman then begin 163 Game.CurrentPlayer.View := Bounds(StartViewPoint.X + StartMousePoint.X - X, 164 StartViewPoint.Y + StartMousePoint.Y - Y, 165 Game.CurrentPlayer.View.Right - Game.CurrentPlayer.View.Left, 166 Game.CurrentPlayer.View.Bottom - Game.CurrentPlayer.View.Top); 167 Redraw; 168 end; 165 169 end; 166 170 end; … … 170 174 begin 171 175 if (StartMousePoint.X = X) and (StartMousePoint.Y = Y) then begin 172 TPlayer(Game.Players[0]).SelectCell(Point(X, Y)); 173 Redraw; 176 if Game.CurrentPlayer.Mode = pmHuman then begin 177 Game.CurrentPlayer.SelectCell(Point(X, Y)); 178 Redraw; 179 end; 174 180 end; 175 181 MoveActive := False; -
trunk/UGame.pas
r9 r10 47 47 end; 48 48 49 TPlayerMode = (pmHuman, pmComputer); 50 49 51 { TPlayer } 50 52 … … 56 58 ViewZoom: Double; 57 59 SelectedCell: TPoint; 60 Mode: TPlayerMode; 61 procedure ComputerTurn; 58 62 procedure SelectCell(Pos: TPoint); 59 63 procedure Paint(PaintBox: TPaintBox); … … 131 135 132 136 { TPlayer } 137 138 procedure TPlayer.ComputerTurn; 139 begin 140 141 end; 133 142 134 143 procedure TPlayer.SelectCell(Pos: TPoint);
Note:
See TracChangeset
for help on using the changeset viewer.