From 79231b6302ea7c5e41562710be71e8a549dced96 Mon Sep 17 00:00:00 2001 From: reduz Date: Sat, 20 Sep 2014 08:43:56 -0700 Subject: [PATCH] Updated tutorial_gdscript_efficiently (markdown) --- tutorial_gdscript_efficiently.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tutorial_gdscript_efficiently.md b/tutorial_gdscript_efficiently.md index fc3f915..58588bd 100644 --- a/tutorial_gdscript_efficiently.md +++ b/tutorial_gdscript_efficiently.md @@ -236,6 +236,22 @@ func game(): ``` +Dictionaries can also be used as data markup or quick structures. While GDScript dictionaries resemble python dictionaries, it also supports Lua style syntax an indexing, which makes it very useful for writing initial states and quick structs: + +``` +# same example, lua-style +# this syntax is a lot more readable and usable + +var d = { + name="john", + age:22 +} + +print("Name: ", d.name, " Age: ", d.age ) # used "." based indexing + +``` + +