ScriptFunc.tscn 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. [gd_scene load_steps=5 format=3 uid="uid://b56og44flraar"]
  2. [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_orknp"]
  3. [ext_resource type="Texture2D" uid="uid://jjrdfilvox4o" path="res://icon.svg" id="2_ahfhc"]
  4. [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_erhoj"]
  5. [ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_ai8iv"]
  6. [node name="ScriptFunc" type="Node2D"]
  7. script = ExtResource("1_orknp")
  8. [node name="Sprite2D" type="Sprite2D" parent="."]
  9. position = Vector2(1607, 612)
  10. scale = Vector2(2, 2)
  11. texture = ExtResource("2_ahfhc")
  12. [node name="Title" parent="." instance=ExtResource("3_erhoj")]
  13. offset_left = 85.0
  14. offset_top = 26.0
  15. offset_right = 1847.0
  16. offset_bottom = 194.0
  17. text = "Les fonctions"
  18. [node name="GdScriptEdit" parent="." instance=ExtResource("4_ai8iv")]
  19. offset_right = 1403.0
  20. offset_bottom = 1033.0
  21. text = "func _ready():
  22. var penguin_speed: float = 40.0 # km/h
  23. penguin_speed = accelerate(penguin_speed)
  24. penguin_speed = accelerate(penguin_speed)
  25. func accelerate(initial_speed: float) -> float:
  26. var new_speed: float = initial_speed + 2.0
  27. return new_speed"