Godot Learning - Part 6

Odds and Ends

  class_name Kitten

  static func forCharacter(char):
    var kitten = new()
    kitten.setupCharacter(char)
    return kitten

Instead, load the file from res:// and run new from that. This is to get around multithreading issues it seems:

  class_name Kitten

  static func forCharacter(char):
    var kitten = load('res://classes/Kittens.gd').new()
    kitten.setupCharacter(char)
    return kitten
  const MOVES = [
    ["ui_down", "y", WALK_SPEED],
    ["ui_up", "y", -WALK_SPEED],
    ["ui_left", "x", -WALK_SPEED],
    ["ui_right", "x", +WALK_SPEED],
  ]

  func _process(delta):
    var vector = Vector2(0,0)
    for move in MOVES:
      if Input.is_action_pressed(move[0]):
        vector[move[1]] += move[2]

Making Pixel Art

Krita is my art tool of choice anyway, so let’s see what the Internets have to say about using it for stills and animations: