unit
ShipShip;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, StdCtrls, ExtCtrls;
type
TForm1 =
class
(TForm)
ActionList1: TActionList;
MoveToUp: TAction;
MoveToDown: TAction;
MoveToLeft: TAction;
MoveToRight: TAction;
p: TImage;
Ostr: TImage;
procedure
MoveToUpExecute(Sender: TObject);
procedure
MoveToDownExecute(Sender: TObject);
procedure
MoveToLeftExecute(Sender: TObject);
procedure
MoveToRightExecute(Sender: TObject);
end
;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure
TForm1
.
MoveToLeftExecute(Sender: TObject);
begin
if
(P
.
Left<>
0
)
then
P
.
Left:=P
.
Left-
1
;
end
;
procedure
TForm1
.
MoveToRightExecute(Sender: TObject);
begin
if
(P
.
Left<>Screen
.
Width-P
.
Width)
then
P
.
Left:=P
.
Left+
1
;
end
;
procedure
TForm1
.
MoveToUpExecute(Sender: TObject);
begin
if
(P
.
Top<>
0
)
then
P
.
Top:=P
.
Top-
1
;
end
;
procedure
TForm1
.
MoveToDownExecute(Sender: TObject);
begin
if
(P
.
Top<>Screen
.
Height-P
.
Height)
then
P
.
Top:=P
.
Top+
1
;
end
;
end
.