mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-07 02:12:07 +03:00
Add missing variable from code examples
Ball direction variable definition was missing in the code examples, making the game avoided collision. All credits to my friend @Nixsm who helped me with this.
(cherry picked from commit 1eb6750a04)
This commit is contained in:
committed by
Rémi Verschelde
parent
6f87572d67
commit
05f20f80b3
@@ -97,8 +97,8 @@ in :ref:`doc_scripting-adding_a_script`). This script inherits Node2D:
|
||||
|
||||
|
||||
First things first, we need to define some members for our script so it
|
||||
can store useful values. Such values are the dimensions of the screen
|
||||
and the pad.
|
||||
can store useful values. Such values are the dimensions of the screen, the pad
|
||||
and the initial direction of the ball.
|
||||
|
||||
::
|
||||
|
||||
@@ -107,6 +107,7 @@ and the pad.
|
||||
# Member variables
|
||||
var screen_size
|
||||
var pad_size
|
||||
var direction = Vector2(1.0, 0.0)
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user