Changeset 23 for trunk/Forms
- Timestamp:
- Sep 28, 2011, 8:34:06 PM (13 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.lfm
r21 r23 5 5 Width = 514 6 6 Caption = 'Tunneler' 7 ClientHeight = 38 97 ClientHeight = 385 8 8 ClientWidth = 514 9 9 Menu = MainMenu1 … … 18 18 object StatusBar1: TStatusBar 19 19 Left = 0 20 Height = 1721 Top = 3 7220 Height = 21 21 Top = 364 22 22 Width = 514 23 23 Panels = < … … 47 47 object Image1: TImage 48 48 Left = 0 49 Height = 3 7249 Height = 364 50 50 Top = 0 51 51 Width = 514 -
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 -
trunk/Forms/UNewGameForm.lfm
r22 r23 7 7 ClientHeight = 387 8 8 ClientWidth = 560 9 On Create = FormCreate9 OnShow = FormShow 10 10 LCLVersion = '0.9.31' 11 11 object ButtonStart: TButton … … 32 32 object Label1: TLabel 33 33 Left = 8 34 Height = 1 434 Height = 18 35 35 Top = 8 36 Width = 4436 Width = 53 37 37 Caption = 'Players:' 38 38 ParentColor = False -
trunk/Forms/UNewGameForm.pas
r22 r23 19 19 ListView1: TListView; 20 20 procedure ButtonStartClick(Sender: TObject); 21 procedure Form Create(Sender: TObject);21 procedure FormShow(Sender: TObject); 22 22 procedure ListView1Change(Sender: TObject; Item: TListItem; 23 23 Change: TItemChange); … … 40 40 { TNewGameForm } 41 41 42 procedure TNewGameForm.FormCreate(Sender: TObject);43 var44 NewItem: TListItem;45 I: Integer;46 begin47 with ListView1 do try48 BeginUpdate;49 Clear;50 for I := 0 to Engine.Players.Count - 1 do51 with TPlayer(Engine.Players[I]) do begin52 NewItem := Items.Add;53 NewItem.Caption := Name;54 NewItem.SubItems.Add(IntToStr(Color));55 NewItem.SubItems.Add('');56 NewItem.Checked := Enabled;57 NewItem.Data := Pointer(Engine.Players[I]);58 end;59 finally60 EndUpdate;61 end;62 end;63 64 42 procedure TNewGameForm.ListView1Change(Sender: TObject; Item: TListItem; 65 43 Change: TItemChange); … … 74 52 end; 75 53 54 procedure TNewGameForm.FormShow(Sender: TObject); 55 var 56 NewItem: TListItem; 57 I: Integer; 58 begin 59 with ListView1 do try 60 BeginUpdate; 61 Clear; 62 for I := 0 to Engine.PlayerPool.Count - 1 do 63 with TPlayer(Engine.PlayerPool[I]) do begin 64 NewItem := Items.Add; 65 NewItem.Caption := Name; 66 NewItem.SubItems.Add(IntToStr(Color)); 67 NewItem.SubItems.Add(''); 68 NewItem.Checked := Enabled; 69 NewItem.Data := Pointer(Engine.PlayerPool[I]); 70 end; 71 finally 72 EndUpdate; 73 end; 74 end; 75 76 76 end. 77 77
Note:
See TracChangeset
for help on using the changeset viewer.