ПРОграммист 2010 02

58

Upload: edivio6610

Post on 10-Apr-2015

249 views

Category:

Documents


1 download

TRANSCRIPT

[

2010

2010. 2, 2010 .

:Utkin, JTG, ,

............................................. .002 , ............................................. .003 . ......................................... .006 , , ... ......... .010 2010 ....................... .013 . DELPHI GameDEV Delphi. ............................. .01D . 3-4 .... .028 SSE ............................................... .032 . ................................................ .039

: , Indian,

:Utkin, Ivan32, , ,

: [email protected] [email protected] www.programmersforum.ru

: . , , , , . . , , . A4, 58 .

: Embarcadero Technologies.

^

[

2010

! www.programmersforum.ru. . , . , , , , . ! , , Utkin- , 2010. . , . Ivan_32 . , SSE. - . , . ! () ( , , , ) ( ) ( , ..) ( ) ( ) ( ) ( ) ( ) / . : [email protected] , ( SCRIBUS) , : , , , , / , (, ) ( , -, ) MS Word, VK WordPad , Arial 10 , () PNG, BMP TIF , - , VK WordPad . , -. , , . , .

, 3

^

[

2010

, , -, . - ...p.s.: -

Google. Android Android Market Translate for Animals.

Opera ( ). INTP (Interplanetary Network Transport Protocol), , . . : 2003.05.05 . : 2004.12.10 (): . , , . : - Nokia , , . , , : , . , .4

,

^

[

2010

- , . .

. 5 , . JetLev-Flyer, .

, .

. , .

PediSedate, .

http://linuxfund.org.

linuxfund.org,

5

,

^

[

2010

.ru 1 . .ru, . . , 10 , unverified, 3 , . . , , , . Linux . 2002 , . 5 . , .

iPad Apple 3 . iPad IPhone OS, Apple A4 1 , 256 16 64 . , iPad BT 2.1 Wi-Fi, , 3G . 500$ 700$. twitter. ru_medvedev . : , @ru_medvedev . . , , Youtube. Google Android Google People of Lava Scandinavia 37, 42 55 . Full HD, Google Maps, Twitter, Youtube, Facebook. 2500$.

, , , , ...

6

,

^

[

2010

. . - ...

by Utkin www.programmersforum.ru , , , , . ? , ?

?, ? . , , , , .. , , , , .. , , , . . http://absurdopedia.wikia.com/wiki/ , . , .

, : . . . . ... , . (.. ) . , , . * () , , . * http://ru.wikipedia.org/wiki/-_7

.

^

[

2010

, - , . : , , ( ), Function Sum (a, b: Integer): Integer. , Sum, Integer ( ), Integer, . : Function Sum (a, b: Integer): Integer; Begin Result := a+b End; Type TMas = record Data: Array of Integer; Count: Integer; End; , , , , .. Sort.

- ? , , Procedure Sort (var Mas: TMas); , , . - . , , . , ... ( ) , . . . : Function fact(x: integer): integer; var i, n: Integer; begin n:=1; for i:=1 to x do begin n:=n*i; end; fact:=n; end; i n ? . , , , . . : , MyData , ( ). Type MyClass = class (TObject) Protected MyData: TStringList;

8

.

^

[

2010

Private Public Constructor Create; Destructor Destroy; End; Constructor MyClass.Create; Begin Inherited Create End; Destructor MyClass.Destroy; Begin Inherited Destroy End;

? - , MyData , , , . , MyData Public (, ). .

, var. , . , - , . , , ( 7), . , ++ , ( ++ , ). , , : . , , . , . , . ? (). : unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Unit2, StdCtrls; Class Sneaky { private: int safe; public: // safe // 10 Sneaky () { safe = 10; } Int &sorry() { return safe; } } : Sneaky x; x.sorry () = 17;

9

.

^

[

2010

type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin AddX(); Button1.Caption:=IntToStr(GetX()); end; procedure TForm1.FormCreate(Sender: TObject); begin Init(); end; end. : unit Unit2; interface procedure Init(); procedure AddX(); function GetX(): Integer; implementation var x: Integer; procedure Init(); begin x:=0; end; procedure AddX();10

.

^

[

2010

begin x:=x+1; end; function GetX(): Integer; begin result:=x; end; end. , . Unit2. , . Unit2 ( , Unit1 ( )). - , (), . - , : TGroupMas TMas? TGroupMas , , , Data TGroupMas TMas. , Type TGroupMas = record TGroupMas. Data: Array of TMas; Count: Integer; Sort. , End; TGroupMas TMas Procedure Sort (var Mas: TMas); Sort: , , Procedure SortItem (var GropuMas: TMas TGroupMas; Index: Integer); Sort. Begin , Sort (GroupMas.Data[Index]); . , End; ( ): Type TMaterial = record Massa: Integer; End; Type11

Type TMas = record Data: Array of Integer; Count: Integer; End;

, ( , ):

.

^

[

2010

TAnimal = record Material: TMaterial; Sort: String; End; Type TMamal = record Animal: TAnimal; Family: String; End; Type THuman = record Mamal: TMamal; Race: String; Floor: String; Name: String; Family: String; End; Type TProgrammer = record Human: THuman; Sertificate: String; End; Type TProgrammer_of_Pascal = record Programmer: TProgrammer; IDE: String; End; . , . : TMamal, . , , . , , . . , , . : , . , . , . . 12

.

^

[

2010

, ? , ( ) ( ). . , , , . , , : ? , : 1. 2. 3. . . -, ... , , ( ), , . , . , . , . ( , , ) RTTI. . , . , ( case ) . , RTTI , , , . RTTI , ( ). : , . , , . , , , . Procedure SortItem (var GropuMas: TGroupMas; Index: Integer); Begin Sort (GroupMas.Data[Index]); End; , ( . ... / ) ( ), _._. , , - ( ). ( , ), 13

.

^

[

2010

, ProgrammTea ProgrammJavaTea . ( ). , , , , , , - . , , , 100. , 100 , , 1000 10 000, . . , ( ) . (++): , // , template T max(T x, T y) , { if (x < y) , , return y; . else , return x; } . , , , , , . , . RTTI, , ( Variant ). , , , , ( , , , ), . . , : (- -y). : , .. , , , , . . , x + y y + x.14

.

^

[

2010

( , , ), , . RTTI ( ) , , .. , , . , , , ( , ). . , , , , . , , () .

, , DLL. , , ? ( RTTI ). (, ) . ( , ), . , , , , , . ( ) , .

, . , ( , ), , ... , ( ) .

. . - . ., , Addison Wesley, 1997 . . . ++. ., -, 200115

.

^

[

2010

. . . .

http://ru.wikipedia.org/wiki/-_ http://absurdopedia.wikia.com/wiki/ . , . . . ., ., 2- , 1990 . . . ., -, 1995, 1987 , Addison Wesley

16

.

^

[

2010

, , ... ?

. , - , : ?. , .

by spamer www.programmersforum.ru , , , , , , , , .

, , / - . , - , . . , , -, . , , Pascal. ? , () Pascal, , ++ Assembler. , . . , , . - / ? , . , , , , . Pascal [1-4]. , , .. .

[5-7] . - (IDE, Integrated development environment). , IDE? , , . Pascal, , Turbo Pascal 7.0 - FreePascal. , - , IDE : TurboDelphi Delphi 2010 . , , IDE Delphi , .., .

17

.

^

[

2010

, , ... ?

, , , , . , . , , . Hello World... , , , . , , .. , , , , , : - ?. , , , : . . . - . , * . , . * , . , , . , , - - . . , , , . , , , .. , - , , - . , .

, . , , , , . , .

. .. . . : . ., -, 2003 . . . . ., , 2003 . .. . Turbo Pascal 7.0. : . ., , 200718

.

^

[

2010

, , ... ?

. .. . Pascal Delphi. ., -, 2008 . FreePascal http://www.freepascal.org/download.var . IDE DELPHI https://downloads.embarcadero.com/free/delphi

19

.

^

[

2010

2010

(2010) 7. IDE Embarcadero Delphi 2010 Version 14.0.3513.24210...

by Utkin www.programmersforum.ru Embecadero , ( #). .

Inline ( 2005) ++, . . , ( ). : . (virtual, dynamic, message) . . , ( ) . , . , (, public private , inline ) . , while repeat ? Procedure Add (var x: Integer; y: Integer); Inline; inline : {$INLINE ON} , Inline; {$INLINE AUTO} , : ) Inline; ) 32- . {$INLINE OFF} Inline. , ++ Inline , , , .

( Delphi.Net) ++ -. , (). (. ):20

^

[

2010

2010

.

TRUNC, ROUND, INC, DEC , . : TMyClass = class class operator Add(a, b: TMyClass): TMyClass; class operator Subtract(a, class operator Implicit(a: class operator Implicit(a: class operator Explicit(a: end; // Add TMyClass.Add(a, b: TMyClass): TMyClass; begin ... end; TMyClass

// // b: TMyClass): TMyclass; // Integer): TMyClass; // // TMyClass): Integer; // // Double): TMyClass; // //

TMyClass TMyClass Integer TMyClass TMyClass Integer Double TMyClass

21

^

[

2010

2010

var x, y: TMyClass; begin x := 12; y := x + x; b := b + 100; end;

// Integer // TMyClass.Add(a, b: TMyClass): TMyClass // TMyClass.Add(b, TMyClass.Implicit(100))

: http://www.realcoding.net/articles/delphinet-peregruzka-operatorov.html

(Class Helpers) ( #), . : ... type TMyClass = class procedure MyProc; function MyFunc: Integer; end; procedure TMyClass.MyProc; var X: Integer; begin X := MyFunc; end; function TMyClass.MyFunc: Integer; begin ... end; ... type TMyClassHelper = class helper for TMyClass procedure HelloWorld; function MyFunc: Integer; end; procedure TMyClassHelper.HelloWorld; begin WriteLn(Self.ClassName); // TMyClass, TMyClassHelper end; function TMyClassHelper.MyFunc: Integer; begin ... end;22

^

[

2010

2010

... var X: TMyClass; Begin X := TMyClass.Create; X.MyProc; // TMyClass.MyProc X.HelloWorld; // TMyClassHelper.HelloWorld X.MyFunc; // TMyClassHelper.MyFunc end; , , , . , Self ( ). , HelloWorld TMyClass ( ). TMyClass TMyClassHelper ( , ). , , . ( , ), . , TMyClass , TMyClassHelper, . , , , , IDE . , . . , , ( ). , , , . , , - , , . ( ). , ( ), , .

, . , - ( ): type TMyRecord = record type23

^

[

2010

2010

TInnerColorType = Integer; var Red: Integer; class var Blue: Integer; procedure printRed(); constructor Create(val: Integer); property RedProperty: TInnerColorType read Red write Red; class property BlueProp: TInnerColorType read Blue write Blue; end; constructor TMyRecord.Create(val: Integer); begin Red := val; end; procedure TMyRecord.printRed; begin writeln('Red: ', Red); end;

( ), ... type TAbstractClass = class abstract procedure SomeProcedure; end;

strict private strict protected private - , . protected - . , ...

type TKlass = class(TForm) strict protected protected strict private private public published automated end;

#, 2010 : type . TAbstractClass = class sealed . procedure SomeProcedure; end; 24

^

[

2010

2010

, . , ( ) .NET ( , WinApi, ).

( Delphi 8) , : type TClassWithConstant = class public const SomeConst = 'This is a class constant'; end; procedure TForm1.FormCreate(Sender: TObject); begin ShowMessage(TClassWithConstant.SomeConst); end;

( Delphi 8) , : type TClassWithClassType = class private type TRecordWithinAClass = record SomeField: string; end; public class var RecordWithinAClass: TRecordWithinAClass; end; ... procedure TForm1.FormCreate(Sender: TObject); begin TClassWithClassType.RecordWithinAClass.SomeField := 'This is a field of a class type declaration'; ShowMessage(TClassWithClassType.RecordWithinAClass.SomeField); end; . , ?

25

^

[

2010

2010

( Delphi 8) : Type X = class (TObject) Public Var Y: Integer; End; , , RTTI. .

, ( ). # ( ).

type TOuterClass = class strict private MyField: Integer; public type TInnerClass = class public MyInnerField: Integer; procedure InnerProc; end; procedure OuterProc; end; procedure TOuterClass.TInnerClass.InnerProc; begin ... end; , , . . , .Net, A F. , . , , .

, : TAbstractClass = class abstract public procedure Bar; virtual; end; TFinalMethodClass = class(TAbstractClass) public procedure Bar; override; final; end;26

^

[

2010

2010

Bar .

, , . ( Self ): type TMyClass = class strict private class var FX: Integer; strict protected // Note: accessors for class properties must be declared class static class function GetX: Integer; static; class procedure SetX(val: Integer); static; public class property X: Integer read GetX write SetX; class procedure StatProc(s: String); static; end; TMyClass.X := 17; TMyClass.StatProc('Hello'); . . for-element-in-collection for for for for Element Element Element Element in in in in ArrayExpr do Stmt; StringExpr do Stmt; SetExpr do Stmt; CollectionExpr do Stmt; .

// var A: Array [1..6] of String; I: String; for i in A do begin Memo1.Lines.Add(i); end;

, I String , , . - , , , . for, .

:27

^

[

2010

2010

Type , , Create , Var Mas: TMas; , , Mas:= TMas.Create('Hello','World','!'); Create ( , ). Create . Create ( , ). TMas = Array of String;

, ++ . ++, . , : TList = class private FItems: array of T; FCount: Integer; procedure Grow(ACapacity: Integer); function GetItem(AIndex: Integer): T; procedure SetItem(AIndex: Integer; AValue: T); public procedure Add(const AItem: T); procedure AddRange(const AItems: array of T); procedure RemoveAt(AIndex: Integer); procedure Clear; property Item[AIndex: Integer]: T read GetItem write SetItem; default; property Count: Integer read FCount; end; ( ). : , ( , , ). . Generics.Collections, TArray, TList, TStack, TQueue, TDictionary, TObjectList, TObjectQueue, TObjectStack, TObjectDictionary TEnumerator, . ilist: TList; ( ++) , , ( ) ( ).28

^

[

2010

2010

: . .NET . . Microsoft Visual Studio , . , . .

. http://skiminog.livejournal.com/33610.html . Embecadero http://edn.embarcadero.com . http://www.realcoding.net/articles/delphinet-peregruzka-operatorov.html . - http://www.translate.ru

. , : ( 2009- ), . FrameWork , . 1 , 512- , . , : 1) ( ). , , . 2) debug failed. , . ( , , ). IDE. 3) ELSE, begin, end ...

29

^

[

2010

GAMEDEV DELPHI.

(- ). GDI Delphi 7 ( ). , - , anvas TBitmap, ...

[email protected] , : 1. , . (- , , ). 2. . , , . . 3. , . , , - , .

... . : . ( ( ), ) . ( , . , * 10-100 ) . ( )

Delphi, . , , , , .. . , - , Form1 Label2, 10 10000 , , , , . MainForm, GameMain, SnakeProject. , , . : OnCreate() * . OnDestroy() ! TTimer . ( 30 ) . . 30

. DELPHI

^

[

2010

GAMEDEV DELPHI.

- TTimer ( System, MainTimer), OnTimer(). ( . 1612 , , . 640480 ( ). : Const // SCR_WIDTH=640; SCR_HEIGHT=480; // MainForm.Width := SCR_WIDTH; MainForm.Height := SCR_HEIGHT; // MainForm.BorderStyle:= bsNone; MainForm.Position := poDesktopCenter;

// //

( enable = false): OnTimer() ( ) Main_Update() Main_Draw(). ? . . , , / , : MainTimer.Interval MainTimer.Enabled := 40; := true; Scene: (sMenu, sGame); if Scene = sMenu then Menu_Draw; if Scene = sGame then Main_Draw; , ...

, . . Canvas , . () , , . , . , . . . scr_Buffer Tbitmap. , : // scr_Buffer := TBitmap.Create; scr_Buffer.Width := SCR_WIDTH; scr_buffer.Height:= SCR_HEIGHT;

31

. DELPHI

^

[

2010

GAMEDEV DELPHI.

Main_Draw() ( ): MainForm.Canvas.Draw(0, 0, scr_Buffer); // scr_Buffer.Canvas.Rectangle(0, 0, SCR_WIDTH, SCR_HEIGHT); // // , , . BackImage: // BackImage:= Tbitmap.Create; BackImage.LoadFromFile('fon.bmp'); // scr_Buffer.Canvas.Draw(0 ,0, BackImage); // BackImage.Free; (. 1):

. 1.

. , , . , ? , , 32

. DELPHI

^

[

2010

GAMEDEV DELPHI.

. , . , : ( TSnake) (TGameObject). , : , . . , ( , ). CAGE_SIZE = 40. , . . , c (5, 6). , (200, 240) . : Function G_X(x:integer):integer; begin result:= x*CAGE_SIZE end; Function G_Y(Y:integer):integer; begin result:= Y*CAGE_SIZE end;

, . . () , (, ), ... , . , . . : type TSnake=class Sprite:TBitmap; // len:integer; // ( - ) BodyPos: array of vect2D; // (!) Speed:vect2D; // ( ) MoveTo:(left,right,up,down); // // , Constructor Create(spr_name:string;pos:vect2D;size:integer); Procedure SetSize(size:integer); // Procedure Drive; // Procedure Update; // Procedure Draw; // Destructor Free; // end; , . Vect2D :

33

. DELPHI

^

[

2010

GAMEDEV DELPHI.

type vect2D = record X,Y: integer; end; Function v2(x,y:integer):vect2D; begin result.X:= X; result.Y:= Y end; //

Function v2ident(v1,v2:vect2D):boolean; // begin result:= false; if (v1.x=v2.x) and (v1.y=v2.y) then result:=true end; Function v2add(v1,v2:vect2D):vect2D; begin result.X:= v1.x+v2.x; result.Y:= v1.y+v2.y end; : // Constructor TSnake.Create(spr_name:string;pos:vect2D;size:integer); Begin Sprite:= TBitmap.create; // Sprite.LoadFromFile(spr_name); Sprite.Transparent:= true; SetSize(size); // BodyPos[0]:= pos; // MoveTo:= left; // end; // Procedure TSnake.SetSize(size:integer); begin len:=size; SetLength(BodyPos, len) end; // // MoveTo // procedure TSnake.Update; var i: integer; begin //

34

. DELPHI

^

[

2010

GAMEDEV DELPHI.

if if if if

MoveTo=Up MoveTo=Down MoveTo=Left MoveTo=right

then then then then

Speed:=v2( 0,-1); Speed:=v2( 0, 1); Speed:=v2(-1, 0); Speed:=v2( 1, 0);

// (downto , ) for i:= len-1 downto 1 do BodyPos[i]:= BodyPos[i-1]; // () BodyPos[0]:= v2add(BodyPos[0], Speed); // for i:=1 to len-1 do if v2Ident(BodyPos[0],BodyPos[i]) then TryAgain; end; TryAgain() . . , MoveTo(). Tsnake.Update , Update() , . , . Key_Press(): function Key_Press(key: byte): boolean; var keys: TKeyboardState; begin result:=false; GetKeyboardState(keys); If (keys[key] = 128) or (keys[key] = 129) then result:= true end; [2]. , , : KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT KEY_ESC = = = = = 38; 40; 37; 39; 27;

, 180 , v2Ident(v2(BodyPos[0].x,BodyPos[0].y-1),BodyPos[1])=false, : procedure TSnake.Drive; begin if Key_Press(KEY_UP) then if v2Ident(v2(BodyPos[0].x,BodyPos[0].y-1),BodyPos[1])=false then MoveTo:= Up; if Key_Press(KEY_DOWN) then35

. DELPHI

^

[

2010

GAMEDEV DELPHI.

if v2Ident(v2(BodyPos[0].x,BodyPos[0].y+1),BodyPos[1])=false then MoveTo:= Down; if Key_Press(KEY_LEFT) then if v2Ident(v2(BodyPos[0].x-1,BodyPos[0].y),BodyPos[1])=false then MoveTo:= Left; if Key_Press(KEY_RIGHT) then if v2Ident(v2(BodyPos[0].x+1,BodyPos[0].y),BodyPos[1])=false then MoveTo:= Right; end; . ( ): procedure TSnake.Draw; var i: integer; begin for i:=0 to len-1 do if not v2Ident(BodyPos[i],v2(0,0)) then begin // , // if i=0 then scr_Buffer.Canvas.draw(G_X(BodyPos[i].x)+ Speed.x*5,G_Y(BodyPos[i].y)+Speed.y*5,sprite); scr_Buffer.Canvas.draw(G_X(BodyPos[i].x),G_Y(BodyPos[i].y),sprite); end end; // destructor TSnake.Free; begin Sprite.Free; end; TryAgain() . , . (. 2). ...

. 2.

. . :36

. DELPHI

^

[

2010

GAMEDEV DELPHI.

Type TObjType=(oWall,oFood); type TgameObject = class ObjType:TObjType; Sprite:TBitmap; Pos:vect2D; Constructor procedure procedure destructor end;

//

// // //

Create(spr_name:string;oType:TObjType;p:vect2D); // Update(Snake:TSnake); // ( ) Draw; // Free; //

. : Constructor TGameObject.Create(spr_name:string;oType:TObjType;p:vect2D); begin Sprite:=TBitmap.create; Sprite.LoadFromFile(spr_name); Sprite.Transparent:=true; pos:= p; ObjType:= oType end; Procedure TGameObject.Update(Snake:TSnake); begin if v2Ident(Snake.BodyPos[0],pos) then begin // if ObjType = oWall then TryAgain; if ObjType = oFood then begin Snake.SetSize(Snake.len+1); pos:= RandomFieldPos end; // , // // RandomFieldPos . end; end; Procedure TGameObject.Draw; begin scr_Buffer.Canvas.Draw(G_X(pos.x),G_Y(pos.y),sprite) end; Destructor TGameObject.Free; begin Sprite.Free end;

37

. DELPHI

^

[

2010

GAMEDEV DELPHI.

, . , Main_Update() Main_Draw(). . : MySnake:TSnake; Wall: array of TGameObject; WallNum:integer; Food:TGameObject; // // // // -

: // MySnake MySnake:= TSnake.Create('snake.bmp',v2(7,7),2); // . Food:=TGameObject.Create('food.bmp',oFood,RandomFieldPos); , , for: WallNum:= 54; SetLength(Wall,WallNum); // for i:=0 to 15 do Wall[i] := // for i:=16 to 31 do Wall[i]:= // for i:=32 to 42 do Wall[i]:= // for i:=43 to 53 do Wall[i]:=

TGameObject.Create('wall.bmp', oWall, v2(i,0)); TGameObject.Create('wall.bmp', oWall, v2(i-16,11)); TGameObject.Create('wall.bmp', oWall, v2(0,i-32)); TGameObject.Create('wall.bmp', oWall, v2(15,i-43));

RandomFieldPos(), , . OnCreate() randomize() : function RandomFieldPos:vect2D; begin // result:=v2(random(13)+1,random(9)) // X 1 14, Y 1 10 // end;

C , . , - WaitTime. 5 0. , MySnake.Update() 5 . , 38

. DELPHI

^

[

2010

GAMEDEV DELPHI.

. , : procedure Main_Update; var i: integer; begin MySnake.Drive; for i:=0 to WallNum-1 do wall[i].Update(MySnake); Food.Update(MySnake); if WaitTime>5 then begin MySnake.Update; WaitTime:= 0; end else inc(WaitTime); if Key_Press(KEY_ESC) then Application.Terminate end; procedure Main_Draw; var i: integer; begin scr_Buffer.Canvas.Draw(0, 0, BackImage); MySnake.Draw; for i:=0 to WallNum-1 do Wall[i].Draw; Food.Draw; MainForm.Canvas.Draw(0, 0, scr_Buffer); scr_Buffer.Canvas.Rectangle(0, 0, SCR_WIDTH, SCR_HEIGHT); end; : procedure TMainForm.FormDestroy(Sender: TObject); var i: integer; begin scr_Buffer.Free; BackImage.Free; MySnake.Free; for i:=0 to wallnum-1 do wall[i].Free end; TryAgain(). , : procedure TryAgain; // begin MySnake.SetSize(0); MySnake.SetSize(2); MySnake.BodyPos[0]:= v2(7,7); MySnake.MoveTo:= left; Food.Pos:=RandomFieldPos end;

39

. DELPHI

^

[

2010

GAMEDEV DELPHI.

: , , . (. 3):

. 3. .

. , - . 2-3 . , , http://www.programmersforum.ru . .

40

. DELPHI

^

[

2010

DELPHI

, . ..

by DeKot [email protected] dX dY. . - ?

( ). 3 , , , . . (. .1), : ,

. 1. , . , , , , . ( TBitMap), . .41

. DELPHI

^

[

2010

DELPHI

: ( ) (. .2): , 2 ( ). , ( ) , . 2. dX dY ( ) . . , . , 3, . , (. .4). , 3, , . dx dy. : . 3. if if if if dx>0 dy>0, dx>0 dy0) and (dy