This commit is contained in:
Torsten 2024-12-22 14:02:54 +01:00
parent 1e22d28754
commit 6b926d3afe
126 changed files with 128562 additions and 104297 deletions

View file

@ -0,0 +1,61 @@
```python
var inventory: Array[Dictionary] = [
{
"name": "sword",
"amount": 1,
},
{
"name": "potion",
"amount": 5,
},
{
"name": "potion",
"amount": 3,
},
{
"name": "coins",
"amount": 65,
},
]
```
[]
```python
var expressions := {
"happy" : preload("res://assets/emotion_happy.png"),
"regular" : preload("res://assets/emotion_regular.png"),
"sad" : preload("res://assets/emotion_sad.png"),
}
var dialogue_items: Array[Dictionary]= [
{
"expression": expressions["regular"],
"text": "I'm learning about Arrays..."
},
{
"expression": expressions["sad"],
"text": "... and it is a little bit complicated."
},
{
"expression": expressions["happy"],
"text": "Let's see if I got it right: an array is a list of values!",
},
{
"expression": expressions["regular"],
"text": "Did I get it right? Did I?",
},
{
"expression": expressions["happy"],
"text": "Hehe! Bye bye~!",
},
]
func show_text() -> void:
var current_item := dialogue_items[current_item_index]
rich_text_label.text = current_item["text"]
expression.texture = current_item["expression"]
```