diff --git a/scripts/player.gd b/scripts/player.gd index 2a60b25..d6a7180 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -34,18 +34,19 @@ func _process(delta): position = position.clamp(Vector2(12,12), screensize - Vector2(12,12)) # Update velocity based on input - var direction = Vector2.ZERO - if Input.is_action_pressed("down"): - direction.y += 1 - if Input.is_action_pressed("up"): - direction.y -= 1 - - # Normalize direction and apply speed - if direction.length() > 0: - velocity = direction.normalized() * speed + #var direction = Vector2.ZERO + #if Input.is_action_pressed("down"): + #direction.y += 1 + #if Input.is_action_pressed("up"): + #direction.y -= 1 +# + ## Normalize direction and apply speed + #if direction.length() > 0: + #velocity = direction.normalized() * speed # Update velocity - velocity += velocity * delta + #velocity += velocity * delta + velocity = input * speed if Input.is_action_pressed("shoot"): diff --git a/scripts/stock_weapon.gd b/scripts/stock_weapon.gd index c1ffc1a..f1fbbc8 100644 --- a/scripts/stock_weapon.gd +++ b/scripts/stock_weapon.gd @@ -7,7 +7,7 @@ extends Area2D func _process(delta): - position += transform.y * (shot_data.speed - player.velocity.y) * delta #This works normally + position += transform.y * (shot_data.speed + player.velocity.y) * delta #This works normally #position += (transform.y + player.velocity) * shot_data.speed * delta #This doesn'tt func _on_visible_on_screen_notifier_2d_screen_exited() -> void: queue_free()