Fixed critical bugs

This commit is contained in:
2025-10-29 10:40:58 +03:00
parent 5ea00cbd30
commit 29bf133a6c
6 changed files with 24 additions and 18 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ var position : Vector2:
get:
return ship.position
func _physics_process(delta: float) -> void:
var input_direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
ship.accelerate(input_direction, delta)
+5 -4
View File
@@ -8,11 +8,12 @@ extends CharacterBody2D
@export var size : Vector2:
set(value):
size = value
if sprite.texture:
if sprite and sprite.texture:
sprite.texture.size = value
colision.shape.radius = 0.9 * minf(size.x, size.y)/2
colision.shape.height = 0.9 * maxf(size.x, size.y)
colision.rotation = 0.0 if size.x < size.y else PI/2
if colision:
colision.shape.radius = 0.9 * minf(size.x, size.y)/2
colision.shape.height = 0.9 * maxf(size.x, size.y)
colision.rotation = 0.0 if size.x < size.y else PI/2
get:
return size
+1 -1
View File
@@ -3,5 +3,5 @@ extends Node
func _ready() -> void:
var player : Node = load("res://game/entities/player.tscn").instantiate()
player.position = Vector2(100, 100)
add_child(player)
player.position = Vector2(100, 100)