Posts

Showing posts from September, 2019

Godot Tutorial: How to read all files in EVERY sub directory (Breadth/Depth first Search)

Image
Godot Tutorial: How to read all files in EVERY sub directory (Breadth/Depth first Search)     Hey all, So I was thinking of writing some automated smoke tests in Godot for a project I'm working on and I realized, I don't think I've ever done directory I/O in Godot. - The tools is so well integrated that I've never really had to mess with it yet. - I'm willing to bet many of you guys haven't either. - Don't worry it's easy, lets get into it. You'll learn: - How to read all files in a directory to process however you'd like - How to use Depth First Search - How to use Breadth First Search - The order that both search styles will traverse a tree Code From Tutorial: How to use: - Create a "Node" type of Godot Node    - Note in Video I used Node2D which is OK, but slighly better to use plain Node since no 2D coords etc are needed - Attach this script to that Node: https://gist.github.com/Razzlegames/28dcb74ba

Programming Tutorial Bits: Kotlin Data Classes

Image
Programming Tutorial Bits: Kotlin Data Classes https://www.youtube.com/watch?v=Telif4fZtrs This is a great place to start learning Kotlin if you have even basic Java experience.  More videos to come. In this video we will learn:  How to use data classes in Kotlin.   How to decompile Kotlin code to understand what it provides  What Kotlin improves on from Java with data classes   We will also touch on Nullable and Non-Nullable types and what happens when we try to call a non Nullable type with null form Java (Oh noes!!!) Clarifications:  Auto Get and Set generation:   If the member is declared with var and is accessible to class users (not private etc) you have access to setters and getters - If it is declared with "val" this NO SETTERS are generated. "val" is essentially like declaring "final" in Java the world.   EXPERIMENT AND TRY IT OUT! :) !! Not-Null assertion operator I touched a little the not null assertion