Description

📖 Godot 4 book: https://filiprachunek.gumroad.com/l/godot4💡 Get exclusive content on Patreon: https://www.patreon.com/FencerDevLog🚀 Space Shooter tutorial…

My Notes

  • 00:36:
    • A game is composed of scenes
    • scenes are created using a tree of nodes that define logic in our game and everything that should happen
  • 00:57: _ underscore methods like: _ready()
    • These are virtual functions, provided by the library.
    • By default they do nothing.
    • they are designed to be overridden by you and the engine will call them at the appropriate time.
  • _init()02:14:
    • Called when the node is initialized.
    • called with MyNodeType.new()
  • _enter_tree()02:55:
    • Called when the node is added to the scene tree
    • We are guaranteed that the node has been added to the tree, but it may not be ready for use yet.
  • 03:23 _ready()
    • called when all child nodes have been initialized and are ready
    • 04:17:
      • _enter_tree() is called on each node from trunk to leaf
      • _ready() is called from leaf to trunk
        • This is the opposite order from _enter_tree()
  • 04:52: _exit_tree():
    • called when a node exits the tree, for example:
      • after remove_child()
      • after change_scene_to_file("res://scene.tscn")
      • after queue_free()
    • 06:34 how to ensure that a thread is terminated correctly:
func _exit_tree():
	if thread.is_alive():
		thread.wait_to_finish()
  • 05:20: _process(delta):
    • called once every frame:
    • delta is the elapsed time since the last frame
  • 05:51: _physics_process(delta):
    • called a fixed number of times per second. Usually 60 times per second
  • 06:59 _input(_event):
    • this will be invoked for each input received.
    • It’s usually better to use _unhandled_input(event)
  • 08:06_notification(what):
    • Use this to respond to miscellaneous, less common notifications
    • Here is how to pause the game when the player clicks outside the window:
func _notification(what):
	if what == MainLoop.NOTIFICATION_APPLICATION_FOCUS_OUT:
		pause_game()