Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolasan/godot-recipes
GDScript code snippets
https://github.com/mikolasan/godot-recipes
gdscript godot-engine
Last synced: about 1 month ago
JSON representation
GDScript code snippets
- Host: GitHub
- URL: https://github.com/mikolasan/godot-recipes
- Owner: mikolasan
- Created: 2024-07-31T16:27:03.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-21T18:36:26.000Z (about 2 months ago)
- Last Synced: 2024-09-29T05:51:24.927Z (about 2 months ago)
- Topics: gdscript, godot-engine
- Homepage: https://neupokoev-n.gitbook.io/godot-recipes
- Size: 123 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GDScript Language
### Check type
```gdscript
if typeof(data.selected_card.one_time_effect) == TYPE_OBJECT:
pass
```### Iterate over array
```gdscript
# no index
for item in array:
pass# with index
for i in range(array.size()):
var item = array[i]
```### Iterate over dictionary
```gdscript
# with keys
for key in dict:
var value = dict[key]# or
for key in dict.keys():
var value = dict[key]# no keys, only values
for value in dict.values():
pass
```### Multiline string
```gdscript
var stats = """
Move: {move}
Energy: {energy}
Skills: {skills}
Equipment: {equipment}
"""
```