samples/99_genre_arcade/twinstick/app/main.rb
def move_directional_vector args
  dx = 0
  dx += 1 if args.inputs.keyboard.d
  dx -= 1 if args.inputs.keyboard.a
  dy = 0
  dy += 1 if args.inputs.keyboard.w
  dy -= 1 if args.inputs.keyboard.s
  if dx != 0 && dy != 0
    dx *= 0.7071
    dy *= 0.7071
  end
  [dx, dy]
end
# Custom function for getting a directional vector just for movement using WASD
Custom function for getting a directional vector just for movement using WASD
Custom function for getting a directional vector just for movement using WASD
def move_directional_vector args
  dx = 0
  dx += 1 if args.inputs.keyboard.d
  dx -= 1 if args.inputs.keyboard.a
  dy = 0
  dy += 1 if args.inputs.keyboard.w
  dy -= 1 if args.inputs.keyboard.s
  if dx != 0 && dy != 0
    dx *= 0.7071
    dy *= 0.7071
  end
  [dx, dy]
end
def move_directional_vector args dx = 0 dx += 1 if args . inputs . keyboard . d dx -= 1 if args . inputs . keyboard . a dy = 0 dy += 1 if args . inputs . keyboard . w dy -= 1 if args . inputs . keyboard . s if dx != 0 && dy != 0 dx *= 0.7071 dy *= 0.7071 end [ dx , dy ] end
Custom function for getting a directional vector just for movement using WASD
Custom function for getting a directional vector just for movement using WASD
args