![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#3
|
|||
|
|||
|
Re::
Al avion lo hice con TImage y el misil con un TLabel.
me ayudarias un poco??? gracias... si el misil es uno magic que sale derecho... te muestro mi codigo unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Avion: TImage; RDisparo: TTimer; Misil: TLabel; procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormCreate(Sender: TObject); procedure MisilClick(Sender: TObject); procedure RDisparoTimer(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1 : TForm1; //A_Arriba : boolean; //A_Abajo : boolean; //A_Izq : boolean; //A_Der : boolean; X_Avion : integer; Y_Avion : integer; Disparo : boolean; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin ShowCursor(True); VertScrollBar.Visible := False; HorzScrollBar.Visible := False; Color := clAqua; //BorderStyle := bsNone; //Ubicar Avion Y_Avion := (ClientWidth div 2) - (Avion.Width div 2); Avion.Top := Y_Avion; avion.Left := 0; end; procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin case Key of vk_up : Avion.Top := Avion.Top -5; vk_down : Avion.Top := Avion.Top +5; vk_left : Avion.left := Avion.left -5; vk_right : Avion.left := Avion.left +5; vk_escape : Close; vk_space : disparo := true; end; end; procedure TForm1.RDisparoTimer(Sender: TObject); begin if disparo then begin Misil.Visible := True; Misil.Left := Misil.Left +5; end; end; procedure TForm1.MisilClick(Sender: TObject); begin Misil.Top := Avion.Top +20; Misil.Left := Avion.Left +100; end; end. |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| programa de juego en delphi | sanchez_bc02 | OOP | 1 | 08-10-2007 00:15:36 |
| Juego de la Oca en delphi | james_dean | OOP | 3 | 10-06-2005 10:09:28 |
| ¡¡ ayuda a un novato en mysql+zeos+delphi !! | miguelogm | Conexión con bases de datos | 1 | 14-03-2005 18:04:12 |
| Novato en php? solicita ayuda? | danytorres | PHP | 5 | 02-12-2003 09:47:11 |
|