Configure project settings and import assets
This commit sets up the initial project configuration including: - Window size and scaling settings - Input mappings for player controls - Default texture filtering settings - Import of game asset pack with sprites and UI elements - Set of signals for tracking player bullets
This commit is contained in:
parent
17ec371068
commit
8501c18dd1
61 changed files with 1234 additions and 0 deletions
18
scenes/bullet.gd
Normal file
18
scenes/bullet.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
extends Area2D
|
||||
@export var speed = -250
|
||||
|
||||
|
||||
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("enemies"):
|
||||
area.explode()
|
||||
queue_free()
|
||||
|
||||
func start(pos):
|
||||
position = pos
|
||||
|
||||
func _process(delta):
|
||||
position.y += speed * delta
|
||||
1
scenes/bullet.gd.uid
Normal file
1
scenes/bullet.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://byl2w624w0lpb
|
||||
93
scenes/gameplay.tscn
Normal file
93
scenes/gameplay.tscn
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://brutkgnx73onj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c7fe5pl54gkem" path="res://scenes/player.gd" id="1_ocj2s"]
|
||||
[ext_resource type="Texture2D" uid="uid://di2xhcwcdbhxg" path="res://resources/Mini Pixel Pack 3/Player ship/Player_ship (16 x 16).png" id="2_din8e"]
|
||||
[ext_resource type="Texture2D" uid="uid://ces8fm7lxh574" path="res://resources/Mini Pixel Pack 3/Player ship/Boosters (16 x 16).png" id="3_4bh5q"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjdhq42ummgky" path="res://resources/Mini Pixel Pack 3/Player ship/Boosters_left (16 x 16).png" id="4_e124b"]
|
||||
[ext_resource type="Texture2D" uid="uid://cjv3xbuj65pav" path="res://resources/Mini Pixel Pack 3/Player ship/Boosters_right (16 x 16).png" id="5_101mb"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hbo4f"]
|
||||
atlas = ExtResource("3_4bh5q")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ctvyo"]
|
||||
atlas = ExtResource("3_4bh5q")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qixtg"]
|
||||
atlas = ExtResource("4_e124b")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nt65e"]
|
||||
atlas = ExtResource("4_e124b")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bhmdk"]
|
||||
atlas = ExtResource("5_101mb")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s5y6v"]
|
||||
atlas = ExtResource("5_101mb")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_407ns"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hbo4f")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ctvyo")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"forward",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qixtg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nt65e")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"left",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bhmdk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s5y6v")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"right",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w3w6i"]
|
||||
size = Vector2(14, 14)
|
||||
|
||||
[node name="Gameplay" type="Node2D"]
|
||||
|
||||
[node name="Player" type="Area2D" parent="."]
|
||||
position = Vector2(-10, 0)
|
||||
script = ExtResource("1_ocj2s")
|
||||
|
||||
[node name="Ship" type="Sprite2D" parent="Player"]
|
||||
texture = ExtResource("2_din8e")
|
||||
hframes = 3
|
||||
frame = 1
|
||||
|
||||
[node name="Boosters" type="AnimatedSprite2D" parent="Player/Ship"]
|
||||
position = Vector2(0, 15)
|
||||
sprite_frames = SubResource("SpriteFrames_407ns")
|
||||
animation = &"right"
|
||||
autoplay = "forward"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||
shape = SubResource("RectangleShape2D_w3w6i")
|
||||
|
||||
[node name="GunCoolDown" type="Timer" parent="Player"]
|
||||
one_shot = true
|
||||
10
scenes/main.tscn
Normal file
10
scenes/main.tscn
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://oq85kpt7a853"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ssdtocwmj0wj" path="res://scenes/start.tscn" id="1_0wfyh"]
|
||||
[ext_resource type="PackedScene" uid="uid://brutkgnx73onj" path="res://scenes/gameplay.tscn" id="2_sugp2"]
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
|
||||
[node name="Start" parent="." instance=ExtResource("1_0wfyh")]
|
||||
|
||||
[node name="Gameplay" parent="." instance=ExtResource("2_sugp2")]
|
||||
19
scenes/player.gd
Normal file
19
scenes/player.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Area2D
|
||||
|
||||
@export var speed = 150
|
||||
@onready var screensize = get_viewport_rect().size
|
||||
|
||||
func _process(delta):
|
||||
var input = Input.get_vector("left", "right", "up", "down")
|
||||
if input.x > 0:
|
||||
$Ship.frame = 2
|
||||
$Ship/Boosters.animation = "right"
|
||||
elif input.x < 0:
|
||||
$Ship.frame = 0
|
||||
$Ship/Boosters.animation = "left"
|
||||
else:
|
||||
$Ship.frame = 1
|
||||
$Ship/Boosters.animation = "forward"
|
||||
position += input * speed * delta
|
||||
position = position.clamp(Vector2(8, 8), screensize-Vector2(8, 8))
|
||||
|
||||
1
scenes/player.gd.uid
Normal file
1
scenes/player.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c7fe5pl54gkem
|
||||
9
scenes/start.tscn
Normal file
9
scenes/start.tscn
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[gd_scene format=3 uid="uid://ssdtocwmj0wj"]
|
||||
|
||||
[node name="Start" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue