Posicion de imagenes (ayuda)
Publicado por Manuel Enrique (1 intervención) el 14/10/2019 01:54:55
Tengo este codigo y me gustaria que al momento que la image3 toque a la image2 no pierda uno.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var
Form3: TForm3;
x,contador:integer;
Sonido:TMediaplayer;
implementation
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
begin
Image3.left:=Random(image1.Width-Image3.Width -6);
end;
procedure TForm3.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if image4.Enabled=false then begin
case Key of
37: image2.Left := image2.Left - 10;
39: image2.Left := image2.Left + 10;
end;
if image2.Left>= image1.Width-image2.Width-8 then begin
image2.Left:=IMAGE2.Left-10;
end;
if image2.Left<= 0 then begin
image2.Left:=image2.Left+10;
end;
end;
end;
procedure TForm3.Image1Click(Sender: TObject);
begin
end;
procedure TForm3.Image4Click(Sender: TObject);
begin
Sonido.FileName:=ExtractFilePath(application.ExeName)+ 'Sonido/1.mp3';
Sonido.Open;
Sonido.Play;
image3.Visible:=true;
image4.enabled:=false;
Timer1.Enabled:=True;
end;
procedure TForm3.Timer1Timer(Sender: TObject);
var k,contador:integer;
begin
if image4.Enabled=true then begin
Timer1.Enabled:=False;
end;
if Image3.Top >=Form3.Height - Image3.Height - 55 then Begin
Timer1.Enabled:=False;
image4.Enabled:=true;
Sonido.Close;
Image.Picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'Spiderman/CAE.png');
End
else begin
image3.top:=image3.top+10;
end;
end;
end.
Valora esta pregunta


0