Initial commit.
This commit is contained in:
commit
142bf87eca
24 changed files with 356 additions and 0 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
||||||
BIN
graphics/ship.png
Normal file
BIN
graphics/ship.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 935 B |
40
graphics/ship.png.import
Normal file
40
graphics/ship.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cq4we1m1yv22s"
|
||||||
|
path="res://.godot/imported/ship.png-e398fa390058251cc1af127a02bfbb4d.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/ship.png"
|
||||||
|
dest_files=["res://.godot/imported/ship.png-e398fa390058251cc1af127a02bfbb4d.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
graphics/shot.png
Normal file
BIN
graphics/shot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 B |
40
graphics/shot.png.import
Normal file
40
graphics/shot.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ti1uy42vnnhw"
|
||||||
|
path="res://.godot/imported/shot.png-93dd8e23e063a652efaf74a48064083f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/shot.png"
|
||||||
|
dest_files=["res://.godot/imported/shot.png-93dd8e23e063a652efaf74a48064083f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
1
icon.svg
Normal file
1
icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 995 B |
43
icon.svg.import
Normal file
43
icon.svg.import
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cllikc7pyqgf0"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
61
project.godot
Normal file
61
project.godot
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Facsimile Wing"
|
||||||
|
config/features=PackedStringArray("4.6", "Forward Plus")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=216
|
||||||
|
window/size/viewport_height=384
|
||||||
|
window/size/window_width_override=648
|
||||||
|
window/size/window_height_override=1152
|
||||||
|
window/stretch/mode="viewport"
|
||||||
|
window/stretch/aspect="keep_width"
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
right={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
left={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
up={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [null, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
down={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
shoot={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[physics]
|
||||||
|
|
||||||
|
3d/physics_engine="Jolt Physics"
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
textures/canvas_textures/default_texture_filter=0
|
||||||
|
rendering_device/driver.windows="d3d12"
|
||||||
11
resources/shot_stock.tres
Normal file
11
resources/shot_stock.tres
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
[gd_resource type="Resource" script_class="PlayerShot" format=3 uid="uid://cels8t3hqjtsu"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://ccdohs4gduee5" path="res://scripts/player_shot.gd" id="1_dpne1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ti1uy42vnnhw" path="res://graphics/shot.png" id="2_fu23f"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_dpne1")
|
||||||
|
shot_name = "Stock"
|
||||||
|
speed = -300
|
||||||
|
cooldown = 0.0
|
||||||
|
metadata/_custom_type_script = "uid://ccdohs4gduee5"
|
||||||
7
scenes/game.tscn
Normal file
7
scenes/game.tscn
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_scene format=3 uid="uid://dqd8cxe7aj3b4"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bj4fytc3sy482" path="res://scenes/world.tscn" id="1_uwrxv"]
|
||||||
|
|
||||||
|
[node name="Game" type="Node2D" unique_id=1673976895]
|
||||||
|
|
||||||
|
[node name="World" parent="." unique_id=1317852169 instance=ExtResource("1_uwrxv")]
|
||||||
20
scenes/player.tscn
Normal file
20
scenes/player.tscn
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
[gd_scene format=3 uid="uid://coix5dqblmu7r"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://otm88638j7f8" path="res://scripts/player.gd" id="1_g2els"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cq4we1m1yv22s" path="res://graphics/ship.png" id="2_qhqgy"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dqkch"]
|
||||||
|
|
||||||
|
[node name="Player" type="Area2D" unique_id=652131079]
|
||||||
|
script = ExtResource("1_g2els")
|
||||||
|
|
||||||
|
[node name="Ship" type="Sprite2D" parent="." unique_id=1155866924]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
texture = ExtResource("2_qhqgy")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=485826453]
|
||||||
|
shape = SubResource("RectangleShape2D_dqkch")
|
||||||
|
|
||||||
|
[node name="WeaponCooldown" type="Timer" parent="." unique_id=269678170]
|
||||||
|
|
||||||
|
[connection signal="timeout" from="WeaponCooldown" to="." method="_on_weapon_cooldown_timeout"]
|
||||||
12
scenes/stock_weapon.tscn
Normal file
12
scenes/stock_weapon.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[gd_scene format=3 uid="uid://ddpclu2vdy2ve"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://d1rwqotmrag1r" path="res://scripts/stock_weapon.gd" id="1_hsma2"]
|
||||||
|
[ext_resource type="Resource" uid="uid://cels8t3hqjtsu" path="res://resources/shot_stock.tres" id="2_ckjv1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ti1uy42vnnhw" path="res://graphics/shot.png" id="3_mvdrj"]
|
||||||
|
|
||||||
|
[node name="StockWeapon" type="Area2D" unique_id=1832200900]
|
||||||
|
script = ExtResource("1_hsma2")
|
||||||
|
shot_data = ExtResource("2_ckjv1")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=2134507225]
|
||||||
|
texture = ExtResource("3_mvdrj")
|
||||||
9
scenes/ui.tscn
Normal file
9
scenes/ui.tscn
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[gd_scene format=3 uid="uid://14fhj8834pkq"]
|
||||||
|
|
||||||
|
[node name="UI" type="Control" unique_id=480295610]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
3
scenes/world.tscn
Normal file
3
scenes/world.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[gd_scene format=3 uid="uid://bj4fytc3sy482"]
|
||||||
|
|
||||||
|
[node name="World" type="Node2D" unique_id=1317852169]
|
||||||
6
scripts/event_bus.gd
Normal file
6
scripts/event_bus.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@warning_ignore_start("unused_signal") # since otherwise Godot will throw a warning that the signal is unused in current scope
|
||||||
|
|
||||||
|
|
||||||
|
@warning_ignore_restore("unused_signal") # put any future signals you add between the two ignore annotations
|
||||||
1
scripts/event_bus.gd.uid
Normal file
1
scripts/event_bus.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bv56i5pud2p3x
|
||||||
72
scripts/player.gd
Normal file
72
scripts/player.gd
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
extends Area2D
|
||||||
|
|
||||||
|
@export var speed: int = 150
|
||||||
|
@export var shield_max: int = 10
|
||||||
|
|
||||||
|
var shield: int = 0: set = shield_set
|
||||||
|
var can_shoot: bool = true
|
||||||
|
var is_shooting: bool = false
|
||||||
|
|
||||||
|
var weapon_current = load("res://scenes/stock_weapon.tscn")
|
||||||
|
var weapon_cooldown = Timer
|
||||||
|
var weapon_rate: float = 0.1
|
||||||
|
var weapon_timer: float = 0.0
|
||||||
|
|
||||||
|
@onready var screensize = get_viewport_rect().size
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
var input = Input.get_vector("left", "right", "up","down")
|
||||||
|
|
||||||
|
#TODO: sprite frame change on x axis
|
||||||
|
#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(12,12), screensize - Vector2(12,12))
|
||||||
|
|
||||||
|
if Input.is_action_pressed("shoot"):
|
||||||
|
print("Spacebar pressed!")
|
||||||
|
is_shooting = true
|
||||||
|
else:
|
||||||
|
is_shooting = false
|
||||||
|
|
||||||
|
if is_shooting == true:
|
||||||
|
weapon_timer += delta
|
||||||
|
print(weapon_timer)
|
||||||
|
if weapon_timer >= weapon_rate:
|
||||||
|
shoot()
|
||||||
|
weapon_timer = 0.0
|
||||||
|
|
||||||
|
if is_shooting == false: return
|
||||||
|
|
||||||
|
func shield_set(_sdvalue: int):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
func _on_weapon_cooldown_timeout() -> void:
|
||||||
|
#print("You can shoot again!")
|
||||||
|
#can_shoot = true
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
func shoot():
|
||||||
|
|
||||||
|
#if not can_shoot: return
|
||||||
|
#if can_shoot:
|
||||||
|
var bullet = weapon_current.instantiate()
|
||||||
|
bullet.position = self.position + Vector2(0,-12)
|
||||||
|
get_tree().root.add_child(bullet)
|
||||||
|
weapon_rate = bullet.shot_data.rate
|
||||||
|
print(bullet.shot_data.shot_name, " weapon fired") #Print which weapon is firing
|
||||||
|
#weapon_cooldown = $WeaponCooldown
|
||||||
|
#weapon_cooldown.wait_time = bullet.shot_data.cooldown
|
||||||
|
#weapon_cooldown.start()
|
||||||
|
#can_shoot = not can_shoot
|
||||||
|
|
||||||
1
scripts/player.gd.uid
Normal file
1
scripts/player.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://otm88638j7f8
|
||||||
9
scripts/player_shot.gd
Normal file
9
scripts/player_shot.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
class_name PlayerShot
|
||||||
|
extends Resource
|
||||||
|
|
||||||
|
@export var shot_name: String
|
||||||
|
@export var damage: int = 1
|
||||||
|
@export var speed: int = 100
|
||||||
|
@export var rate: float = 0.1
|
||||||
|
@export var cooldown: float = 0.25
|
||||||
|
@export var sprite: Texture2D = preload("res://graphics/shot.png")
|
||||||
1
scripts/player_shot.gd.uid
Normal file
1
scripts/player_shot.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://ccdohs4gduee5
|
||||||
9
scripts/stock_weapon.gd
Normal file
9
scripts/stock_weapon.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
extends Area2D
|
||||||
|
|
||||||
|
@onready var bullet = load("res://scenes/stock_weapon.tscn")
|
||||||
|
|
||||||
|
@export var shot_data: PlayerShot
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
position.y += shot_data.speed * delta
|
||||||
1
scripts/stock_weapon.gd.uid
Normal file
1
scripts/stock_weapon.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://d1rwqotmrag1r
|
||||||
Loading…
Add table
Add a link
Reference in a new issue