![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#31
|
||||
|
||||
|
Код:
Procedure TPlayerSprite1.DoMove(MoveCount: Integer);
begin
inherited DoMove(MoveCount);
// ïðè íàæàòèè äâèãàåì îáúåêò âëåâî
if isLeft in MainForm.DXInput.States then
begin
x:=x-15;
Image := MainForm.DXImageListAnime1.Items.Find('obichniy');
end;
// ïðè íàæàòèè äâèãàåì îáúåêò âïðàâî
if isRight in MainForm.DXInput.States then
begin
x:=x+15;
Image := MainForm.DXImageListAnime1.Items.Find('obichniy');
end;
// íèæíèé áëîê
if isButton1 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('BottomBlock');
// âåðõíèé áëîê
if isButton2 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('TopBlock');
// âåðõíèé óäàð
if isButton3 in MainForm.DXInput.States then
begin
PixelCheck := True;
Image:=MainForm.DXImageListAnime1.Items.Find('TopUdar');
Width := Image.Width;
Height := Image.Height;
end;
if maxPrig<300 then
begin
Y:=Y+5;
X:=X+1;
end
else
begin
if y=10 then exit;
Y:=Y-5;
end;
AnimSpeed := 10 / 1000; //ñêîðîñòü àíèìàöèè
// óäàð ëåâîé
if isButton4 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('UdarLevoy');
// óäàð ïðàâîé
if isButton5 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('UdarPravoy');
// íèæíÿÿ ïîäíîæêà
if isButton5 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('UdarNiz');
// óäàð ëåâîé íîãîé
if isButton5 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('UdarNogoyZemlyaLevo');
// óäàð ïðàâîé íîãîé
if isButton5 in MainForm.DXInput.States then
Image := MainForm.DXImageListAnime1.Items.Find('UdarNogoyZemlyaPravo');
if y >= MainForm.DXDraw.SurfaceHeight-image.Height then //íå ïóñêàåì
y := MainForm.DXDraw.SurfaceHeight-image.Height; //îáúåêò
if x >= MainForm.DXDraw.SurfaceWidth -image.Width then //çà ãðàíèöû
x := MainForm.DXDraw.SurfaceWidth -image.Width; //ôîðìû
if y <= 0 then
y := 1;
if x <= 0 then
x:=1;
end;Так? у меня че-то не робит прога, компилируется, создает фон, а потом ничего не происходит... |
|
#32
|
|||
|
|||
|
Помог бы, да DelphiX не знаю.
------------------------------ Никак не могу понять зачем вы создаете два экземпляра класса TPlayerSprite1 (ну и TPlayerSprite2 тоже) в FormCreate? Код:
//вначале: PlayerSprite1 := TPlayerSprite1.Create(Dxspriteengine.Engine); //потом with TPlayerSprite1.Create(Dxspriteengine.Engine) do ... Последний раз редактировалось san-46, 19.06.2008 в 14:07. |
|
#33
|
||||
|
||||
|
Я убрал...
|