mirror of
https://github.com/godotengine/godot.git
synced 2025-02-16 15:50:45 +00:00
Updated tutorial_gdscript_efficiently (markdown)
parent
79231b6302
commit
7781274852
@ -238,13 +238,13 @@ 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:
|
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:
|
||||||
|
|
||||||
```
|
```python
|
||||||
# same example, lua-style
|
# same example, lua-style
|
||||||
# this syntax is a lot more readable and usable
|
# this syntax is a lot more readable and usable
|
||||||
|
|
||||||
var d = {
|
var d = {
|
||||||
name="john",
|
name="john",
|
||||||
age:22
|
age=22
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Name: ", d.name, " Age: ", d.age ) # used "." based indexing
|
print("Name: ", d.name, " Age: ", d.age ) # used "." based indexing
|
||||||
|
Loading…
Reference in New Issue
Block a user