add random rotation to bullets
This commit is contained in:
parent
bb831426b7
commit
3e77aca3e9
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,11 @@ var player : Player
|
||||||
@export var flash : PackedScene = preload("res://effects/flash.tscn")
|
@export var flash : PackedScene = preload("res://effects/flash.tscn")
|
||||||
var pref : int = 0
|
var pref : int = 0
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
rotation = randf_range(0, 2*PI)
|
||||||
|
await get_tree().create_timer(0.05).timeout
|
||||||
|
apply_torque_impulse(randf_range(-100, 100))
|
||||||
|
|
||||||
func _integrate_forces(state) -> void:
|
func _integrate_forces(state) -> void:
|
||||||
pref += 1
|
pref += 1
|
||||||
if state.get_contact_count() > 0 && pref > 10:
|
if state.get_contact_count() > 0 && pref > 10:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue