Reworked for tabs. Added Player

This commit is contained in:
2025-10-20 18:25:45 +03:00
parent fb037f58a7
commit be3db76fe2
17 changed files with 281 additions and 189 deletions
+10
View File
@@ -0,0 +1,10 @@
extends Node2D
func _process(delta: float) -> void:
var speed := 100
var input_direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
var velocity := input_direction * speed
position += velocity * delta
var screen_size := get_viewport_rect().size
position = position.clamp(Vector2.ZERO, screen_size)
+1
View File
@@ -0,0 +1 @@
uid://c2uf62j1im13p
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://xpj7f3l1l51l"]
[ext_resource type="Script" uid="uid://c2uf62j1im13p" path="res://game/entities/player.gd" id="1_xkeht"]
[ext_resource type="PackedScene" uid="uid://dn44qgg4coedd" path="res://game/entities/ship.tscn" id="2_3a8sv"]
[node name="Player" type="Node2D"]
script = ExtResource("1_xkeht")
[node name="Ship" parent="." instance=ExtResource("2_3a8sv")]
+9
View File
@@ -0,0 +1,9 @@
extends Node2D
@export var size : Vector2
func _ready() -> void:
var texture := PlaceholderTexture2D.new()
texture.size = size
$Sprite2D.texture = texture
+1
View File
@@ -0,0 +1 @@
uid://cesibaqtrgotl
+12
View File
@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://dn44qgg4coedd"]
[sub_resource type="GDScript" id="GDScript_3a8sv"]
script/source = "class_name Ship
extends Node2D
"
[node name="Ship" type="Node2D"]
script = SubResource("GDScript_3a8sv")
[node name="Sprite2D" type="Sprite2D" parent="."]