Chaosforge Forum

  • November 15, 2019, 18:41
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: math.pas  (Read 6541 times)

volos314

  • Private FC
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
    • mazecrawl.com
math.pas
« on: May 17, 2007, 16:05 »

It's not a bug, but likely thing that makes people think you are not a math addict ))

function RealDistance(x1,y1,x2,y2 : Double): Double;
begin
  RealDistance := Sqrt(Sqr(Abs(x2-x1)) + Sqr(Abs(y2-y1)));
end;

function TriDistance(x1,y1,x2,y2 : Integer): Byte;
begin
  TriDistance := Round(Sqrt(Sqr(Abs(x2-x1)) + Sqr(Abs(y2-y1))));
end;

Abs is not necessary here.
Logged
MazeCrawl Roguelike
http://mazecrawl.com

Kornel Kisielewicz

  • God Hand
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 4470
    • View Profile
    • http://chaosforge.org/
Re: math.pas
« Reply #1 on: May 17, 2007, 22:12 »

This is one of the oldest if not *the* oldest Valkyrie unit :P. Anyway, next valkyrie release will have a proper math unit :P
Logged
at your service,
Kornel Kisielewicz

Igor Savin

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 180
    • View Profile
Re: math.pas
« Reply #2 on: May 21, 2007, 13:36 »

And when is that?
Logged

Kornel Kisielewicz

  • God Hand
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 4470
    • View Profile
    • http://chaosforge.org/
Re: math.pas
« Reply #3 on: May 22, 2007, 09:32 »

Probably with the next Berserk! version :)
Logged
at your service,
Kornel Kisielewicz

Igor Savin

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 180
    • View Profile
Re: math.pas
« Reply #4 on: May 27, 2007, 11:54 »

Will it be updated for 2.2.0, since Valk. seems to be incompatible already?
Logged

Kornel Kisielewicz

  • God Hand
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 4470
    • View Profile
    • http://chaosforge.org/
Re: math.pas
« Reply #5 on: May 27, 2007, 13:35 »

Actually some units will be 2.2.0 exclusive -- vdata will use generics now :)
Logged
at your service,
Kornel Kisielewicz
Pages: [1]