made bullet with a camera on the end. other tweaks

This commit is contained in:
derek
2024-11-26 17:07:36 -06:00
parent 86a05335e7
commit 86b084f694
17 changed files with 484 additions and 158 deletions

View File

@@ -12,6 +12,7 @@ var player_position
var bounces = 0
var start_time
var end_time
var start_velocity
const EMISSION_MAX : float = 200
const EMISSION_LIFETIME : float = 1.75 #in seconds
@@ -22,7 +23,8 @@ func _ready() -> void:
visible = false
start_time = Time.get_ticks_msec()
end_time = start_time + (EMISSION_LIFETIME * 1000)
start_velocity = linear_velocity.length()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var current_time = (Time.get_ticks_msec())/end_time
@@ -30,6 +32,7 @@ func _process(delta: float) -> void:
var distance_from_player = abs(self.global_position - player_position)
if distance_from_player.length() > 1.5:
visible = true