Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Moving to a free space in 1 tile distance

Ask for help
Post Reply
nyce
Neophyte
Neophyte
Posts: 17
Joined: 16.06.2016 19:48

Moving to a free space in 1 tile distance

Post by nyce »

Hey guys,

It my character is at 0,0
Image
and facing 3 (SE)
Image
how i can make sure he walks into a free (non-blocked) tile in green area (1 tile max range).

what ive tried is:

Code: Select all

if myBools then
    begin
      StepQ (PredictedDirection, True);
      myBools := False;
    end;
that works fine if the tile in front of character isnt blocked (in example, 1.0).

thanks
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Moving to a free space in 1 tile distance

Post by Vizit0r »

"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply