Changeset 2 for trunk/UMainForm.pas
- Timestamp:
- Mar 5, 2011, 10:16:19 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
tunneler
lib
backup
-
Property svn:ignore
set to
-
trunk/UMainForm.pas
r1 r2 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 ComCtrls, UCore;9 ComCtrls, Menus, UCore; 10 10 11 11 type … … 15 15 TMainForm = class(TForm) 16 16 Image1: TImage; 17 MainMenu1: TMainMenu; 18 MenuItem1: TMenuItem; 19 MenuItem2: TMenuItem; 20 MenuItem3: TMenuItem; 17 21 StatusBar1: TStatusBar; 18 22 Timer1: TTimer; … … 21 25 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 22 26 procedure Image1Resize(Sender: TObject); 27 procedure MenuItem2Click(Sender: TObject); 28 procedure MenuItem3Click(Sender: TObject); 23 29 procedure Timer1Timer(Sender: TObject); 24 30 private … … 39 45 procedure TMainForm.Timer1Timer(Sender: TObject); 40 46 begin 41 Engine.Paint; 47 try 48 Timer1.Enabled := False; 49 Engine.Paint; 50 StatusBar1.Panels[1].Text := IntToStr(TPlayer(Engine.Players[0]).Position.X) + ', ' + 51 IntToStr(TPlayer(Engine.Players[0]).Position.Y); 52 finally 53 Timer1.Enabled := True; 54 end; 42 55 end; 43 56 … … 46 59 Engine.Bitmap := Image1.Picture.Bitmap; 47 60 Image1Resize(Self); 61 with Engine do begin 62 PlayerCount := 2; 63 with TPlayer(Players[0]) do begin 64 Position := Point(25 + Random(World.Surface.Count.X - 50), 65 25 + Random(World.Surface.Count.Y - 50)); 66 Color := TColor($00f805); 67 Keys.Left := 65; 68 Keys.Down := 87; 69 Keys.Right := 68; 70 Keys.Up := 83; 71 Keys.Shoot := 69; 72 end; 73 with TPlayer(Players[1]) do begin 74 Position := Point(25 + Random(World.Surface.Count.X - 50), 75 25 + Random(World.Surface.Count.Y - 50)); 76 Color := TColor($00f805); 77 Keys.Left := 37; 78 Keys.Down := 38; 79 Keys.Right := 39; 80 Keys.Up := 40; 81 Keys.Shoot := 17; 82 end; 83 end; 48 84 end; 49 85 … … 68 104 end; 69 105 106 procedure TMainForm.MenuItem2Click(Sender: TObject); 107 begin 108 Close; 109 end; 110 111 procedure TMainForm.MenuItem3Click(Sender: TObject); 112 begin 113 114 end; 115 70 116 end. 71 117
Note:
See TracChangeset
for help on using the changeset viewer.