Показать сообщение отдельно
  #31  
Старый 19.06.2008, 13:56
Аватар для Genry
Genry Genry вне форума
Начинающий
 
Регистрация: 14.04.2008
Адрес: с. Россия, г. Курган
Сообщения: 160
Версия Delphi: 7
Репутация: 10
По умолчанию

Код:
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;

Так? у меня че-то не робит прога, компилируется, создает фон, а потом ничего не происходит...
Изображения
Тип файла: jpg screen.jpg (25.1 Кбайт, 2 просмотров)
Тип файла: jpg screen2.jpg (56.4 Кбайт, 2 просмотров)
Вложения
Тип файла: txt UnitMainForm.txt (15.6 Кбайт, 2 просмотров)
__________________
http://forceway.ru/
Ответить с цитированием