Перейти к содержанию
Fire Monkey от А до Я

VDK

Пользователи
  • Постов

    3
  • Зарегистрирован

  • Посещение

Информация

  • Пол
    Не определился

Посетители профиля

1 095 просмотров профиля

Достижения VDK

  1. Спасибо за помощь, решил проблему через "костыли"
  2. Двигаю image opponent к image hero и проверяю касается ли край opponent середины hero procedure TMainForm.MoveOpponentTimerTimer(Sender: TObject); var PosX,PosY:integer; begin PosX:=round(Hero.Width) div 2; PosY:=round(Opponent.Width ) ; IF (Opponent.Position.X + PosY) <> (Hero.Position.X + PosX ) then begin if (Opponent.Position.X + PosY) > (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X - PosY * 0.01; if (Opponent.Position.X + PosY) < (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X + PosY * 0.01; end else HPIndicator.Value:= HPIndicator.Value - 10; end
  3. VDK

    Не работает код с TProgressBar

    Собственно не работает следующий код IF (Opponent.Position.X + PosY) <> (Hero.Position.X + PosX ) then begin if (Opponent.Position.X + PosY) > (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X - PosY * 0.01; if (Opponent.Position.X + PosY) < (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X + PosY * 0.01; end else HPIndicator.Value:= HPIndicator.Value - 10; Однако, если сделать вот так: IF (Opponent.Position.X + PosY) <> (Hero.Position.X + PosX ) then begin if (Opponent.Position.X + PosY) > (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X - PosY * 0.01; if (Opponent.Position.X + PosY) < (Hero.Position.X + PosX)then Opponent.Position.X:=Opponent.Position.X + PosY * 0.01; HPIndicator.Value:= HPIndicator.Value - 10; end то все прекрасно работает. В чем подвох?
×
×
  • Создать...