Changeset 2 for trunk/UMainForm.pas


Ignore:
Timestamp:
Mar 5, 2011, 10:16:19 PM (14 years ago)
Author:
george
Message:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      tunneler
      lib
      backup
  • trunk/UMainForm.pas

    r1 r2  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   ComCtrls, UCore;
     9  ComCtrls, Menus, UCore;
    1010
    1111type
     
    1515  TMainForm = class(TForm)
    1616    Image1: TImage;
     17    MainMenu1: TMainMenu;
     18    MenuItem1: TMenuItem;
     19    MenuItem2: TMenuItem;
     20    MenuItem3: TMenuItem;
    1721    StatusBar1: TStatusBar;
    1822    Timer1: TTimer;
     
    2125    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    2226    procedure Image1Resize(Sender: TObject);
     27    procedure MenuItem2Click(Sender: TObject);
     28    procedure MenuItem3Click(Sender: TObject);
    2329    procedure Timer1Timer(Sender: TObject);
    2430  private
     
    3945procedure TMainForm.Timer1Timer(Sender: TObject);
    4046begin
    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;
    4255end;
    4356
     
    4659  Engine.Bitmap := Image1.Picture.Bitmap;
    4760  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;
    4884end;
    4985
     
    68104end;
    69105
     106procedure TMainForm.MenuItem2Click(Sender: TObject);
     107begin
     108  Close;
     109end;
     110
     111procedure TMainForm.MenuItem3Click(Sender: TObject);
     112begin
     113
     114end;
     115
    70116end.
    71117
Note: See TracChangeset for help on using the changeset viewer.