ScriptFunc.tscn 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [gd_scene load_steps=6 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://3i6oj4q3qeam" path="res://slides/272/VisualShaderNodeFloatFunc.svg" id="2_kg7eu"]
  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. [ext_resource type="PackedScene" uid="uid://b811jddpttnt4" path="res://common/components/subtitle/subtitle.tscn" id="5_g5ffp"]
  7. [node name="ScriptFunc" type="Node2D"]
  8. script = ExtResource("1_orknp")
  9. [node name="Sprite2D" type="Sprite2D" parent="."]
  10. position = Vector2(1607, 612)
  11. scale = Vector2(2, 2)
  12. texture = ExtResource("2_kg7eu")
  13. [node name="Title" parent="." instance=ExtResource("3_erhoj")]
  14. offset_left = 85.0
  15. offset_top = 26.0
  16. offset_right = 1847.0
  17. offset_bottom = 194.0
  18. text = "Les fonctions"
  19. [node name="GdScriptEdit" parent="." instance=ExtResource("4_ai8iv")]
  20. offset_left = 52.0
  21. offset_top = 207.0
  22. offset_right = 1346.0
  23. offset_bottom = 942.0
  24. text = "func _ready():
  25. var penguin_speed: float = 40.0 # km/h
  26. penguin_speed = accelerate(penguin_speed)
  27. penguin_speed = accelerate(penguin_speed)
  28. print(\"Tux runs at \", penguin_speed)
  29. func accelerate(initial_speed: float) -> float:
  30. var new_speed: float = initial_speed + 2.0
  31. return new_speed"
  32. [node name="Subtitle" parent="." instance=ExtResource("5_g5ffp")]
  33. offset_left = 57.0
  34. offset_top = 952.0
  35. offset_right = 1326.0
  36. offset_bottom = 1083.0
  37. text = "Tux runs at 44"