Changeset 23 for trunk/Forms/UMainForm.pas
- Timestamp:
- Sep 28, 2011, 8:34:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.pas
r22 r23 43 43 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 44 44 procedure FormCreate(Sender: TObject); 45 procedure FormDestroy(Sender: TObject); 45 46 procedure FormDeactivate(Sender: TObject); 46 procedure FormDestroy(Sender: TObject);47 47 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 48 48 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); … … 60 60 public 61 61 PersistentForm: TPersistentForm; 62 Engine: TEngine; 62 63 end; 63 64 … … 85 86 try 86 87 Engine.Lock.Acquire; 87 StatusBar1.Panels[1].Text := IntToStr(TPlayer(Engine.Players[0]).Position.X) + ', ' +88 IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' +89 IntToStr(TPlayer(Engine.Players[0]).Direction);88 //StatusBar1.Panels[1].Text := IntToStr(TPlayer(Engine.Players[0]).Position.X) + ', ' + 89 // IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' + 90 // IntToStr(TPlayer(Engine.Players[0]).Direction); 90 91 StatusBar1.Panels[2].Text := FloatToStr(RoundTo(DrawDuration / OneMillisecond, -2)); 91 StatusBar1.Panels[3].Text := IntToStr(TPlayer(Engine.Players[0]).Bullets.Count);92 //StatusBar1.Panels[3].Text := IntToStr(TPlayer(Engine.Players[0]).Bullets.Count); 92 93 finally 93 94 Engine.Lock.Release; … … 111 112 Randomize; 112 113 DoubleBuffered := True; 114 Engine := TEngine.Create; 113 115 Engine.Bitmap := Image1.Picture.Bitmap; 114 with Engine do begin115 PlayerCount := 4;116 with TPlayer(Players[0]) do begin117 Name := 'Player 1';118 Keys.Left := 65;119 Keys.Down := 83;120 Keys.Right := 68;121 Keys.Up := 87;122 Keys.Shoot := 69;123 end;124 with TPlayer(Players[1]) do begin125 Name := 'Player 2';126 Keys.Left := 37;127 Keys.Down := 40;128 Keys.Right := 39;129 Keys.Up := 38;130 Keys.Shoot := 17;131 end;132 with TPlayer(Players[2]) do begin133 Name := 'Player 3';134 Keys.Left := 76;135 Keys.Down := 186;136 Keys.Right := 222;137 Keys.Up := 80;138 Keys.Shoot := 191;139 end;140 with TPlayer(Players[3]) do begin141 Name := 'Player 4';142 Keys.Left := 100;143 Keys.Down := 98;144 Keys.Right := 102;145 Keys.Up := 104;146 Keys.Shoot := 105;147 end;148 end;149 116 Engine.NewGame; 150 117 Engine.Active := True; … … 160 127 begin 161 128 PersistentForm.Free; 129 Engine.Free; 162 130 end; 163 131
Note:
See TracChangeset
for help on using the changeset viewer.