Godot Learning - Part 2

Lunchtime video: Platform Game Tutorial

Game planning

I’m now thinking the game will be a walking simulator with QTE. No items, no stats, no tight action stuff, just dialog choices, exploration, and QTE. Should be pretty straightforward.

Solution to “Pixel size of Scene for Camera2D clamping”

This doesn’t take into account transforms on the Map or the MapContainer.

func get_map_max_size():
  var maxSize = Rect2(0,0,0,0)

  for node in $MapContainer/Map.get_children():
    # Object#is_class is like Ruby Object#is_a?.
    # if I used instances in the tree whose classes subclassed TileMap,
    # is_class will return true for those instances.
    if node.is_class("TileMap"):
      var mapSize = Transform2D(
        Vector2(node.cell_size.x, 0),
        Vector2(0, node.cell_size.y),
      ) * node.get_used_rect().size

      maxSize = maxSize.expand(Vector2(mapSize.x, mapSize.y))

  return maxSize