Fixed white space *for real*; updated Godot settings not to "correct"
whitespace.
This commit is contained in:
parent
9cd7629023
commit
4eba01e61b
1 changed files with 5 additions and 5 deletions
10
ball.gd
10
ball.gd
|
|
@ -5,15 +5,15 @@ const SPEED : float = 300.0
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
initialize()
|
initialize()
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
var collision = move_and_collide(velocity * _delta)
|
var collision = move_and_collide(velocity * _delta)
|
||||||
if collision:
|
if collision:
|
||||||
velocity = velocity.bounce(collision.get_normal())
|
velocity = velocity.bounce(collision.get_normal())
|
||||||
|
|
||||||
func initialize():
|
func initialize():
|
||||||
var extra_offset = 0.0 if randf() < 0.5 else PI
|
var extra_offset = 0.0 if randf() < 0.5 else PI
|
||||||
var angle = extra_offset + randf_range(-PI/3.0, PI/3.0)
|
var angle = extra_offset + randf_range(-PI/3.0, PI/3.0)
|
||||||
velocity = Vector2(cos(angle), sin(angle)).normalized() * SPEED
|
velocity = Vector2(cos(angle), sin(angle)).normalized() * SPEED
|
||||||
position = get_viewport_rect().size / 2.0
|
position = get_viewport_rect().size / 2.0
|
||||||
|
|
||||||
func _on_screen_exited() -> void:
|
func _on_screen_exited() -> void:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue