diff --git a/README.md b/README.md index ee75c1b..93aa77e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # gmtk2025 -# gmtkGameJam2025 - -This is a Game made for the 2025 GMTK Game Jam: https://itch.io/jam/gmtk-2025 - +# gmtkGameJam2025 + +This is a Game made for the 2025 GMTK Game Jam: https://itch.io/jam/gmtk-2025 diff --git a/addons/virtual_joystick/plugin.cfg b/addons/virtual_joystick/plugin.cfg new file mode 100644 index 0000000..9ae5585 --- /dev/null +++ b/addons/virtual_joystick/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Virtual Joystick" +description="A simple virtual joystick for touchscreens, with useful options." +author="Marco Fazio" +version="1.0" +script="virtual_joystick_plugin.gd" diff --git a/addons/virtual_joystick/previews/CoverPreview.svg b/addons/virtual_joystick/previews/CoverPreview.svg new file mode 100644 index 0000000..a6676a6 --- /dev/null +++ b/addons/virtual_joystick/previews/CoverPreview.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/virtual_joystick/previews/CoverPreview.svg.import b/addons/virtual_joystick/previews/CoverPreview.svg.import new file mode 100644 index 0000000..c145d98 --- /dev/null +++ b/addons/virtual_joystick/previews/CoverPreview.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://r76fqukn2kv2" +path="res://.godot/imported/CoverPreview.svg-7c17dc7ed6007b5f94a5e30c30227a42.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/previews/CoverPreview.svg" +dest_files=["res://.godot/imported/CoverPreview.svg-7c17dc7ed6007b5f94a5e30c30227a42.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/previews/Logo.svg b/addons/virtual_joystick/previews/Logo.svg new file mode 100644 index 0000000..5953fdc --- /dev/null +++ b/addons/virtual_joystick/previews/Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/virtual_joystick/previews/Logo.svg.import b/addons/virtual_joystick/previews/Logo.svg.import new file mode 100644 index 0000000..cfbfde7 --- /dev/null +++ b/addons/virtual_joystick/previews/Logo.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6o1dthinonqh" +path="res://.godot/imported/Logo.svg-ff6e2b43579b0b50d493f1bf1feaff55.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/previews/Logo.svg" +dest_files=["res://.godot/imported/Logo.svg-ff6e2b43579b0b50d493f1bf1feaff55.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/previews/ShowcasePreview.png b/addons/virtual_joystick/previews/ShowcasePreview.png new file mode 100644 index 0000000..c332ceb Binary files /dev/null and b/addons/virtual_joystick/previews/ShowcasePreview.png differ diff --git a/addons/virtual_joystick/previews/ShowcasePreview.png.import b/addons/virtual_joystick/previews/ShowcasePreview.png.import new file mode 100644 index 0000000..cb98d3c --- /dev/null +++ b/addons/virtual_joystick/previews/ShowcasePreview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://gwkutlaoa4ob" +path="res://.godot/imported/ShowcasePreview.png-70f7a50f53e5fc814a0e306c3f1e556a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/previews/ShowcasePreview.png" +dest_files=["res://.godot/imported/ShowcasePreview.png-70f7a50f53e5fc814a0e306c3f1e556a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/previews/joystick_icon.png b/addons/virtual_joystick/previews/joystick_icon.png new file mode 100644 index 0000000..9f32dd2 Binary files /dev/null and b/addons/virtual_joystick/previews/joystick_icon.png differ diff --git a/addons/virtual_joystick/previews/joystick_icon.png.import b/addons/virtual_joystick/previews/joystick_icon.png.import new file mode 100644 index 0000000..e8b4c02 --- /dev/null +++ b/addons/virtual_joystick/previews/joystick_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bymijumptci7p" +path="res://.godot/imported/joystick_icon.png-6e8744e631946e765d6836c0ecb27227.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/previews/joystick_icon.png" +dest_files=["res://.godot/imported/joystick_icon.png-6e8744e631946e765d6836c0ecb27227.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/test/player.gd b/addons/virtual_joystick/test/player.gd new file mode 100644 index 0000000..d9b3be1 --- /dev/null +++ b/addons/virtual_joystick/test/player.gd @@ -0,0 +1,23 @@ +extends Sprite2D + +@export var speed : float = 100 + +@export var joystick_left : VirtualJoystick + +@export var joystick_right : VirtualJoystick + +var move_vector := Vector2.ZERO + +func _process(delta: float) -> void: + ## Movement using the joystick output: +# if joystick_left and joystick_left.is_pressed: +# position += joystick_left.output * speed * delta + + ## Movement using Input functions: + move_vector = Vector2.ZERO + move_vector = Input.get_vector("ui_left","ui_right","ui_up","ui_down") + position += move_vector * speed * delta + + # Rotation: + if joystick_right and joystick_right.is_pressed: + rotation = joystick_right.output.angle() diff --git a/addons/virtual_joystick/test/player.gd.uid b/addons/virtual_joystick/test/player.gd.uid new file mode 100644 index 0000000..e6ed725 --- /dev/null +++ b/addons/virtual_joystick/test/player.gd.uid @@ -0,0 +1 @@ +uid://ufwwnqosvu6d diff --git a/addons/virtual_joystick/test/test.tscn b/addons/virtual_joystick/test/test.tscn new file mode 100644 index 0000000..5e6ffb4 --- /dev/null +++ b/addons/virtual_joystick/test/test.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=4 format=3 uid="uid://bq2sqb1u1l5ve"] + +[ext_resource type="PackedScene" uid="uid://dmr0fcamx7t56" path="res://addons/virtual_joystick/virtual_joystick_scene.tscn" id="1_4k4lh"] +[ext_resource type="Texture2D" uid="uid://kq1h264n0gxs" path="res://icon.svg" id="2_44wa8"] +[ext_resource type="Script" path="res://addons/virtual_joystick/test/player.gd" id="3_dsmxw"] + +[node name="Test" type="Node2D"] + +[node name="UI" type="CanvasLayer" parent="."] + +[node name="Virtual joystick left" parent="UI" instance=ExtResource("1_4k4lh")] + +[node name="Virtual joystick right" parent="UI" instance=ExtResource("1_4k4lh")] +anchors_preset = 3 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -300.0 +offset_top = -300.0 +offset_right = 0.0 +offset_bottom = 0.0 +grow_horizontal = 0 +joystick_mode = 1 +use_input_actions = false + +[node name="Player" type="Sprite2D" parent="." node_paths=PackedStringArray("joystick_left", "joystick_right")] +position = Vector2(600, 300) +texture = ExtResource("2_44wa8") +script = ExtResource("3_dsmxw") +joystick_left = NodePath("../UI/Virtual joystick left") +joystick_right = NodePath("../UI/Virtual joystick right") diff --git a/addons/virtual_joystick/textures/joystick_base_outline.png b/addons/virtual_joystick/textures/joystick_base_outline.png new file mode 100644 index 0000000..7cae462 Binary files /dev/null and b/addons/virtual_joystick/textures/joystick_base_outline.png differ diff --git a/addons/virtual_joystick/textures/joystick_base_outline.png.import b/addons/virtual_joystick/textures/joystick_base_outline.png.import new file mode 100644 index 0000000..5cd627a --- /dev/null +++ b/addons/virtual_joystick/textures/joystick_base_outline.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bm30au8mjfc2f" +path="res://.godot/imported/joystick_base_outline.png-1529fbc0a23b5af9e961e1a3d047aa0b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/textures/joystick_base_outline.png" +dest_files=["res://.godot/imported/joystick_base_outline.png-1529fbc0a23b5af9e961e1a3d047aa0b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/textures/joystick_tip.png b/addons/virtual_joystick/textures/joystick_tip.png new file mode 100644 index 0000000..28c57ac Binary files /dev/null and b/addons/virtual_joystick/textures/joystick_tip.png differ diff --git a/addons/virtual_joystick/textures/joystick_tip.png.import b/addons/virtual_joystick/textures/joystick_tip.png.import new file mode 100644 index 0000000..9b1ddfe --- /dev/null +++ b/addons/virtual_joystick/textures/joystick_tip.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkvmydfn5saxg" +path="res://.godot/imported/joystick_tip.png-95989d4495f4fb8387b93ac5f53ed669.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/textures/joystick_tip.png" +dest_files=["res://.godot/imported/joystick_tip.png-95989d4495f4fb8387b93ac5f53ed669.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/textures/joystick_tip_arrows.png b/addons/virtual_joystick/textures/joystick_tip_arrows.png new file mode 100644 index 0000000..b4caa99 Binary files /dev/null and b/addons/virtual_joystick/textures/joystick_tip_arrows.png differ diff --git a/addons/virtual_joystick/textures/joystick_tip_arrows.png.import b/addons/virtual_joystick/textures/joystick_tip_arrows.png.import new file mode 100644 index 0000000..84399a9 --- /dev/null +++ b/addons/virtual_joystick/textures/joystick_tip_arrows.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dt13r06u87fib" +path="res://.godot/imported/joystick_tip_arrows.png-cd5fb367005f4e3e79a192d69a489560.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/textures/joystick_tip_arrows.png" +dest_files=["res://.godot/imported/joystick_tip_arrows.png-cd5fb367005f4e3e79a192d69a489560.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/virtual_joystick.gd b/addons/virtual_joystick/virtual_joystick.gd new file mode 100644 index 0000000..19cf917 --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick.gd @@ -0,0 +1,174 @@ +class_name VirtualJoystick + +extends Control + +## A simple virtual joystick for touchscreens, with useful options. +## Github: https://github.com/MarcoFazioRandom/Virtual-Joystick-Godot + +# EXPORTED VARIABLE + +## The color of the button when the joystick is pressed. +@export var pressed_color := Color.GRAY + +## If the input is inside this range, the output is zero. +@export_range(0, 200, 1) var deadzone_size : float = 10 + +## The max distance the tip can reach. +@export_range(0, 500, 1) var clampzone_size : float = 75 + +enum Joystick_mode { + FIXED, ## The joystick doesn't move. + DYNAMIC, ## Every time the joystick area is pressed, the joystick position is set on the touched position. + FOLLOWING ## When the finger moves outside the joystick area, the joystick will follow it. +} + +## If the joystick stays in the same position or appears on the touched position when touch is started +@export var joystick_mode := Joystick_mode.FIXED + +enum Visibility_mode { + ALWAYS, ## Always visible + TOUCHSCREEN_ONLY, ## Visible on touch screens only + WHEN_TOUCHED ## Visible only when touched +} + +## If the joystick is always visible, or is shown only if there is a touchscreen +@export var visibility_mode := Visibility_mode.ALWAYS + +## If true, the joystick uses Input Actions (Project -> Project Settings -> Input Map) +@export var use_input_actions := true + +@export var action_left := "lookLeft" +@export var action_right := "lookRight" +@export var action_up := "lookForward" +@export var action_down := "lookDown" + +# PUBLIC VARIABLES + +## If the joystick is receiving inputs. +var is_pressed := false + +# The joystick output. +var output := Vector2.ZERO + +# PRIVATE VARIABLES + +var _touch_index : int = -1 + +@onready var _base := $Base +@onready var _tip := $Base/Tip + +@onready var _base_default_position : Vector2 = _base.position +@onready var _tip_default_position : Vector2 = _tip.position + +@onready var _default_color : Color = _tip.modulate + +# FUNCTIONS + +func _ready() -> void: + if ProjectSettings.get_setting("input_devices/pointing/emulate_mouse_from_touch"): + printerr("The Project Setting 'emulate_mouse_from_touch' should be set to False") + if not ProjectSettings.get_setting("input_devices/pointing/emulate_touch_from_mouse"): + printerr("The Project Setting 'emulate_touch_from_mouse' should be set to True") + + if not DisplayServer.is_touchscreen_available() and visibility_mode == Visibility_mode.TOUCHSCREEN_ONLY : + hide() + + if visibility_mode == Visibility_mode.WHEN_TOUCHED: + hide() + +func _input(event: InputEvent) -> void: + if event is InputEventScreenTouch: + if event.pressed: + if _is_point_inside_joystick_area(event.position) and _touch_index == -1: + if joystick_mode == Joystick_mode.DYNAMIC or joystick_mode == Joystick_mode.FOLLOWING or (joystick_mode == Joystick_mode.FIXED and _is_point_inside_base(event.position)): + if joystick_mode == Joystick_mode.DYNAMIC or joystick_mode == Joystick_mode.FOLLOWING: + _move_base(event.position) + if visibility_mode == Visibility_mode.WHEN_TOUCHED: + show() + _touch_index = event.index + _tip.modulate = pressed_color + _update_joystick(event.position) + get_viewport().set_input_as_handled() + elif event.index == _touch_index: + _reset() + if visibility_mode == Visibility_mode.WHEN_TOUCHED: + hide() + get_viewport().set_input_as_handled() + elif event is InputEventScreenDrag: + if event.index == _touch_index: + _update_joystick(event.position) + get_viewport().set_input_as_handled() + +func _move_base(new_position: Vector2) -> void: + _base.global_position = new_position - _base.pivot_offset * get_global_transform_with_canvas().get_scale() + +func _move_tip(new_position: Vector2) -> void: + _tip.global_position = new_position - _tip.pivot_offset * _base.get_global_transform_with_canvas().get_scale() + +func _is_point_inside_joystick_area(point: Vector2) -> bool: + var x: bool = point.x >= global_position.x and point.x <= global_position.x + (size.x * get_global_transform_with_canvas().get_scale().x) + var y: bool = point.y >= global_position.y and point.y <= global_position.y + (size.y * get_global_transform_with_canvas().get_scale().y) + return x and y + +func _get_base_radius() -> Vector2: + return _base.size * _base.get_global_transform_with_canvas().get_scale() / 2 + +func _is_point_inside_base(point: Vector2) -> bool: + var _base_radius = _get_base_radius() + var center : Vector2 = _base.global_position + _base_radius + var vector : Vector2 = point - center + if vector.length_squared() <= _base_radius.x * _base_radius.x: + return true + else: + return false + +func _update_joystick(touch_position: Vector2) -> void: + var _base_radius = _get_base_radius() + var center : Vector2 = _base.global_position + _base_radius + var vector : Vector2 = touch_position - center + vector = vector.limit_length(clampzone_size) + + if joystick_mode == Joystick_mode.FOLLOWING and touch_position.distance_to(center) > clampzone_size: + _move_base(touch_position - vector) + + _move_tip(center + vector) + + if vector.length_squared() > deadzone_size * deadzone_size: + is_pressed = true + output = (vector - (vector.normalized() * deadzone_size)) / (clampzone_size - deadzone_size) + else: + is_pressed = false + output = Vector2.ZERO + + if use_input_actions: + # Release actions + if output.x >= 0 and Input.is_action_pressed(action_left): + Input.action_release(action_left) + if output.x <= 0 and Input.is_action_pressed(action_right): + Input.action_release(action_right) + if output.y >= 0 and Input.is_action_pressed(action_up): + Input.action_release(action_up) + if output.y <= 0 and Input.is_action_pressed(action_down): + Input.action_release(action_down) + # Press actions + if output.x < 0: + Input.action_press(action_left, -output.x) + if output.x > 0: + Input.action_press(action_right, output.x) + if output.y < 0: + Input.action_press(action_up, -output.y) + if output.y > 0: + Input.action_press(action_down, output.y) + +func _reset(): + is_pressed = false + output = Vector2.ZERO + _touch_index = -1 + _tip.modulate = _default_color + _base.position = _base_default_position + _tip.position = _tip_default_position + # Release actions + if use_input_actions: + for action in [action_left, action_right, action_down, action_up]: + if Input.is_action_pressed(action): + Input.action_release(action) diff --git a/addons/virtual_joystick/virtual_joystick.gd.uid b/addons/virtual_joystick/virtual_joystick.gd.uid new file mode 100644 index 0000000..0dfca34 --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick.gd.uid @@ -0,0 +1 @@ +uid://3iyxvgyi5bth diff --git a/addons/virtual_joystick/virtual_joystick_icon.png b/addons/virtual_joystick/virtual_joystick_icon.png new file mode 100644 index 0000000..9f32dd2 Binary files /dev/null and b/addons/virtual_joystick/virtual_joystick_icon.png differ diff --git a/addons/virtual_joystick/virtual_joystick_icon.png.import b/addons/virtual_joystick/virtual_joystick_icon.png.import new file mode 100644 index 0000000..3ba0532 --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dyngdl4xiinc" +path="res://.godot/imported/virtual_joystick_icon.png-de46b24999f9aaea71ffaa7771da41e6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/virtual_joystick/virtual_joystick_icon.png" +dest_files=["res://.godot/imported/virtual_joystick_icon.png-de46b24999f9aaea71ffaa7771da41e6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/addons/virtual_joystick/virtual_joystick_instantiator.gd b/addons/virtual_joystick/virtual_joystick_instantiator.gd new file mode 100644 index 0000000..858fb1a --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_instantiator.gd @@ -0,0 +1,17 @@ +@tool +extends Control + +var scene + +func _enter_tree(): + scene = preload("res://addons/virtual_joystick/virtual_joystick_scene.tscn").instantiate() + add_child(scene) + + if ProjectSettings.get_setting("input_devices/pointing/emulate_mouse_from_touch"): + printerr("The Project Setting 'emulate_mouse_from_touch' should be set to False") + if not ProjectSettings.get_setting("input_devices/pointing/emulate_touch_from_mouse"): + printerr("The Project Setting 'emulate_touch_from_mouse' should be set to True") + + +func _exit_tree(): + scene.free() diff --git a/addons/virtual_joystick/virtual_joystick_instantiator.gd.uid b/addons/virtual_joystick/virtual_joystick_instantiator.gd.uid new file mode 100644 index 0000000..3424ef3 --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_instantiator.gd.uid @@ -0,0 +1 @@ +uid://bqykrbwxdktxk diff --git a/addons/virtual_joystick/virtual_joystick_plugin.gd b/addons/virtual_joystick/virtual_joystick_plugin.gd new file mode 100644 index 0000000..5a11aca --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_plugin.gd @@ -0,0 +1,10 @@ +@tool +extends EditorPlugin + + +func _enter_tree(): + add_custom_type("Virtual Joystick", "Control", preload("virtual_joystick_instantiator.gd"), preload("virtual_joystick_icon.png")) + + +func _exit_tree(): + remove_custom_type("Virtual Joystick") diff --git a/addons/virtual_joystick/virtual_joystick_plugin.gd.uid b/addons/virtual_joystick/virtual_joystick_plugin.gd.uid new file mode 100644 index 0000000..f2343e4 --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_plugin.gd.uid @@ -0,0 +1 @@ +uid://dairt8d4i1xo1 diff --git a/addons/virtual_joystick/virtual_joystick_scene.tscn b/addons/virtual_joystick/virtual_joystick_scene.tscn new file mode 100644 index 0000000..d7e85fd --- /dev/null +++ b/addons/virtual_joystick/virtual_joystick_scene.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=4 format=3 uid="uid://dmr0fcamx7t56"] + +[ext_resource type="Script" uid="uid://3iyxvgyi5bth" path="res://addons/virtual_joystick/virtual_joystick.gd" id="1_8x4dy"] +[ext_resource type="Texture2D" uid="uid://bm30au8mjfc2f" path="res://addons/virtual_joystick/textures/joystick_base_outline.png" id="2_jhjs2"] +[ext_resource type="Texture2D" uid="uid://dt13r06u87fib" path="res://addons/virtual_joystick/textures/joystick_tip_arrows.png" id="3_3etdg"] + +[node name="Virtual Joystick" type="Control"] +layout_mode = 3 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -308.0 +offset_right = 300.0 +offset_bottom = -8.0 +grow_vertical = 0 +script = ExtResource("1_8x4dy") + +[node name="Base" type="TextureRect" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -100.0 +offset_top = -100.0 +offset_right = 100.0 +offset_bottom = 100.0 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset = Vector2(100, 100) +mouse_force_pass_scroll_events = false +texture = ExtResource("2_jhjs2") +stretch_mode = 5 + +[node name="Tip" type="TextureRect" parent="Base"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -50.0 +offset_top = -50.0 +offset_right = 50.0 +offset_bottom = 50.0 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset = Vector2(50, 50) +texture = ExtResource("3_3etdg") +stretch_mode = 5 diff --git a/assets/bullets/minigunBullet.ase b/assets/bullets/minigunBullet.ase new file mode 100644 index 0000000..455df88 Binary files /dev/null and b/assets/bullets/minigunBullet.ase differ diff --git a/assets/bullets/minigunBullet.aseprite b/assets/bullets/minigunBullet.aseprite new file mode 100644 index 0000000..455df88 Binary files /dev/null and b/assets/bullets/minigunBullet.aseprite differ diff --git a/assets/bullets/minigunBullet.png b/assets/bullets/minigunBullet.png new file mode 100644 index 0000000..b78047f Binary files /dev/null and b/assets/bullets/minigunBullet.png differ diff --git a/assets/bullets/minigunBullet.png.import b/assets/bullets/minigunBullet.png.import new file mode 100644 index 0000000..326035b --- /dev/null +++ b/assets/bullets/minigunBullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2h1eyb147j7t" +path="res://.godot/imported/minigunBullet.png-03cee61e8d92e16bdccd3ba3f482071b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/bullets/minigunBullet.png" +dest_files=["res://.godot/imported/minigunBullet.png-03cee61e8d92e16bdccd3ba3f482071b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/bullets/railgunBullet.ase b/assets/bullets/railgunBullet.ase new file mode 100644 index 0000000..e3fd122 Binary files /dev/null and b/assets/bullets/railgunBullet.ase differ diff --git a/assets/bullets/railgunBullet.png b/assets/bullets/railgunBullet.png new file mode 100644 index 0000000..bd8f5a1 Binary files /dev/null and b/assets/bullets/railgunBullet.png differ diff --git a/assets/bullets/railgunBullet.png.import b/assets/bullets/railgunBullet.png.import new file mode 100644 index 0000000..4e1808b --- /dev/null +++ b/assets/bullets/railgunBullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xj1r10s5lg48" +path="res://.godot/imported/railgunBullet.png-14afbe48770bed019965e4f26fda7902.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/bullets/railgunBullet.png" +dest_files=["res://.godot/imported/railgunBullet.png-14afbe48770bed019965e4f26fda7902.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/bullets/shotgunBullet.ase b/assets/bullets/shotgunBullet.ase new file mode 100644 index 0000000..5a9b6de Binary files /dev/null and b/assets/bullets/shotgunBullet.ase differ diff --git a/assets/bullets/shotgunBullet.png b/assets/bullets/shotgunBullet.png new file mode 100644 index 0000000..551d907 Binary files /dev/null and b/assets/bullets/shotgunBullet.png differ diff --git a/assets/bullets/shotgunBullet.png.import b/assets/bullets/shotgunBullet.png.import new file mode 100644 index 0000000..c761ab3 --- /dev/null +++ b/assets/bullets/shotgunBullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8y5bc5ntygd8" +path="res://.godot/imported/shotgunBullet.png-bfe8d42b3e211de725a4f2e8b31a62bb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/bullets/shotgunBullet.png" +dest_files=["res://.godot/imported/shotgunBullet.png-bfe8d42b3e211de725a4f2e8b31a62bb.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/cover.ase b/assets/cover.ase new file mode 100644 index 0000000..60cd8c5 Binary files /dev/null and b/assets/cover.ase differ diff --git a/assets/cover.png b/assets/cover.png new file mode 100644 index 0000000..7f43b42 Binary files /dev/null and b/assets/cover.png differ diff --git a/assets/cover.png.import b/assets/cover.png.import new file mode 100644 index 0000000..8c32b81 --- /dev/null +++ b/assets/cover.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bubv4fj8mwu46" +path="res://.godot/imported/cover.png-a54a6cb34ab8b6028826d2209ff06e38.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/cover.png" +dest_files=["res://.godot/imported/cover.png-a54a6cb34ab8b6028826d2209ff06e38.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/enemy/RailgunEnemy.ase b/assets/enemy/RailgunEnemy.ase new file mode 100644 index 0000000..e8aff36 Binary files /dev/null and b/assets/enemy/RailgunEnemy.ase differ diff --git a/assets/enemy/RailgunEnemy.png b/assets/enemy/RailgunEnemy.png new file mode 100644 index 0000000..f16abdb Binary files /dev/null and b/assets/enemy/RailgunEnemy.png differ diff --git a/assets/enemy/RailgunEnemy.png.import b/assets/enemy/RailgunEnemy.png.import new file mode 100644 index 0000000..5a9ae9d --- /dev/null +++ b/assets/enemy/RailgunEnemy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://iddqk6g00rku" +path="res://.godot/imported/RailgunEnemy.png-ffd7b2d4cfff77affe77e7dafd02e510.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/enemy/RailgunEnemy.png" +dest_files=["res://.godot/imported/RailgunEnemy.png-ffd7b2d4cfff77affe77e7dafd02e510.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/enemy/enemy.ase b/assets/enemy/enemy.ase new file mode 100644 index 0000000..2ed1745 Binary files /dev/null and b/assets/enemy/enemy.ase differ diff --git a/assets/enemy/enemy.png b/assets/enemy/enemy.png new file mode 100644 index 0000000..be60454 Binary files /dev/null and b/assets/enemy/enemy.png differ diff --git a/assets/enemy/enemy.png.import b/assets/enemy/enemy.png.import new file mode 100644 index 0000000..97ca081 --- /dev/null +++ b/assets/enemy/enemy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkc8av1vbis4r" +path="res://.godot/imported/enemy.png-2ffb8cc70f5f247be0a6a03142f8f850.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/enemy/enemy.png" +dest_files=["res://.godot/imported/enemy.png-2ffb8cc70f5f247be0a6a03142f8f850.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/enemy/minigunEnemy.ase b/assets/enemy/minigunEnemy.ase new file mode 100644 index 0000000..f1e10ed Binary files /dev/null and b/assets/enemy/minigunEnemy.ase differ diff --git a/assets/enemy/minigunEnemy.png b/assets/enemy/minigunEnemy.png new file mode 100644 index 0000000..03a24f3 Binary files /dev/null and b/assets/enemy/minigunEnemy.png differ diff --git a/assets/enemy/minigunEnemy.png.import b/assets/enemy/minigunEnemy.png.import new file mode 100644 index 0000000..f61848b --- /dev/null +++ b/assets/enemy/minigunEnemy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://mftd7366eymt" +path="res://.godot/imported/minigunEnemy.png-e58b9333214931d75d229f85addeb24c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/enemy/minigunEnemy.png" +dest_files=["res://.godot/imported/minigunEnemy.png-e58b9333214931d75d229f85addeb24c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/enemy/shotgunEnemy.ase b/assets/enemy/shotgunEnemy.ase new file mode 100644 index 0000000..b1b0204 Binary files /dev/null and b/assets/enemy/shotgunEnemy.ase differ diff --git a/assets/enemy/shotgunEnemy.png b/assets/enemy/shotgunEnemy.png new file mode 100644 index 0000000..2ff046f Binary files /dev/null and b/assets/enemy/shotgunEnemy.png differ diff --git a/assets/enemy/shotgunEnemy.png.import b/assets/enemy/shotgunEnemy.png.import new file mode 100644 index 0000000..505e7bf --- /dev/null +++ b/assets/enemy/shotgunEnemy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dansb0wnm00vb" +path="res://.godot/imported/shotgunEnemy.png-932a4c16e0c23ead3de70854d7424c9b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/enemy/shotgunEnemy.png" +dest_files=["res://.godot/imported/shotgunEnemy.png-932a4c16e0c23ead3de70854d7424c9b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/logo.aseprite b/assets/logo.aseprite new file mode 100644 index 0000000..0d3ebcf Binary files /dev/null and b/assets/logo.aseprite differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..d813e62 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/logo.png.import b/assets/logo.png.import new file mode 100644 index 0000000..b0e00ab --- /dev/null +++ b/assets/logo.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://db2bohfy0hq2l" +path="res://.godot/imported/logo.png-e2220799298e3631eb0e245316e0501a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/logo.png" +dest_files=["res://.godot/imported/logo.png-e2220799298e3631eb0e245316e0501a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/mouse.aseprite b/assets/mouse.aseprite new file mode 100644 index 0000000..6948b9a Binary files /dev/null and b/assets/mouse.aseprite differ diff --git a/assets/mouse.png b/assets/mouse.png new file mode 100644 index 0000000..6907d9b Binary files /dev/null and b/assets/mouse.png differ diff --git a/assets/mouse.png.import b/assets/mouse.png.import new file mode 100644 index 0000000..79352ac --- /dev/null +++ b/assets/mouse.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bil3xgn75nb2f" +path="res://.godot/imported/mouse.png-86a36c525f5fbb80016971cea1008f71.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/mouse.png" +dest_files=["res://.godot/imported/mouse.png-86a36c525f5fbb80016971cea1008f71.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/obstacles/Meteroit-export.png.import b/assets/obstacles/Meteroit-export.png.import new file mode 100644 index 0000000..96665ae --- /dev/null +++ b/assets/obstacles/Meteroit-export.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jba2qov2n764" +path="res://.godot/imported/Meteroit-export.png-df18459cbac0c15eec0730f3c837d6ff.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/obstacles/Meteroit-export.png" +dest_files=["res://.godot/imported/Meteroit-export.png-df18459cbac0c15eec0730f3c837d6ff.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/obstacles/Meteroitt.png.import b/assets/obstacles/Meteroitt.png.import new file mode 100644 index 0000000..58ef5f6 --- /dev/null +++ b/assets/obstacles/Meteroitt.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkaiv0hhh4lfv" +path="res://.godot/imported/Meteroitt.png-bac7afdf372013e56ee700bae1b719e1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/obstacles/Meteroitt.png" +dest_files=["res://.godot/imported/Meteroitt.png-bac7afdf372013e56ee700bae1b719e1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/obstacles/meteor.png b/assets/obstacles/meteor.png new file mode 100644 index 0000000..76729d0 Binary files /dev/null and b/assets/obstacles/meteor.png differ diff --git a/assets/obstacles/meteor.png.import b/assets/obstacles/meteor.png.import new file mode 100644 index 0000000..8eea280 --- /dev/null +++ b/assets/obstacles/meteor.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drk4xkhlq00x3" +path="res://.godot/imported/meteor.png-b9628390ec56bd027f1772f1488c1294.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/obstacles/meteor.png" +dest_files=["res://.godot/imported/meteor.png-b9628390ec56bd027f1772f1488c1294.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/player/minigunShip.ase b/assets/player/minigunShip.ase new file mode 100644 index 0000000..78d4316 Binary files /dev/null and b/assets/player/minigunShip.ase differ diff --git a/assets/player/minigunShip.png b/assets/player/minigunShip.png new file mode 100644 index 0000000..659dde7 Binary files /dev/null and b/assets/player/minigunShip.png differ diff --git a/assets/player/minigunShip.png.import b/assets/player/minigunShip.png.import new file mode 100644 index 0000000..e3a3c73 --- /dev/null +++ b/assets/player/minigunShip.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dlahm782n0awk" +path="res://.godot/imported/minigunShip.png-ad08c34de51c709d90508c2aceca8200.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/minigunShip.png" +dest_files=["res://.godot/imported/minigunShip.png-ad08c34de51c709d90508c2aceca8200.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/player/railgunShip.ase b/assets/player/railgunShip.ase new file mode 100644 index 0000000..94ba619 Binary files /dev/null and b/assets/player/railgunShip.ase differ diff --git a/assets/player/railgunShip.png b/assets/player/railgunShip.png new file mode 100644 index 0000000..e9e2a71 Binary files /dev/null and b/assets/player/railgunShip.png differ diff --git a/assets/player/railgunShip.png.import b/assets/player/railgunShip.png.import new file mode 100644 index 0000000..def8b7b --- /dev/null +++ b/assets/player/railgunShip.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhbn4acw1a6eu" +path="res://.godot/imported/railgunShip.png-4a011109d4032da60e0f6ceebec12a40.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/railgunShip.png" +dest_files=["res://.godot/imported/railgunShip.png-4a011109d4032da60e0f6ceebec12a40.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/player/ship.ase b/assets/player/ship.ase new file mode 100644 index 0000000..9aa6efc Binary files /dev/null and b/assets/player/ship.ase differ diff --git a/assets/player/ship.png b/assets/player/ship.png new file mode 100644 index 0000000..1d0273a Binary files /dev/null and b/assets/player/ship.png differ diff --git a/assets/player/ship.png.import b/assets/player/ship.png.import new file mode 100644 index 0000000..ef25dbe --- /dev/null +++ b/assets/player/ship.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dui4247bmksrc" +path="res://.godot/imported/ship.png-1b7d3f608b849e4bab6ad7f2edd28e1f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/ship.png" +dest_files=["res://.godot/imported/ship.png-1b7d3f608b849e4bab6ad7f2edd28e1f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/player/shotgunShip.ase b/assets/player/shotgunShip.ase new file mode 100644 index 0000000..cb87054 Binary files /dev/null and b/assets/player/shotgunShip.ase differ diff --git a/assets/player/shotgunShip.png b/assets/player/shotgunShip.png new file mode 100644 index 0000000..1fff207 Binary files /dev/null and b/assets/player/shotgunShip.png differ diff --git a/assets/player/shotgunShip.png.import b/assets/player/shotgunShip.png.import new file mode 100644 index 0000000..2bce2b4 --- /dev/null +++ b/assets/player/shotgunShip.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cd5anydes4tv3" +path="res://.godot/imported/shotgunShip.png-55767d1fa1b8dd3bc6c96cdfcaae9872.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/shotgunShip.png" +dest_files=["res://.godot/imported/shotgunShip.png-55767d1fa1b8dd3bc6c96cdfcaae9872.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/radiation.aseprite b/assets/radiation.aseprite new file mode 100644 index 0000000..a7dd4df Binary files /dev/null and b/assets/radiation.aseprite differ diff --git a/assets/radiation.png b/assets/radiation.png new file mode 100644 index 0000000..dfb13c5 Binary files /dev/null and b/assets/radiation.png differ diff --git a/assets/radiation.png.import b/assets/radiation.png.import new file mode 100644 index 0000000..7f5c587 --- /dev/null +++ b/assets/radiation.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwnpsmrwskrgh" +path="res://.godot/imported/radiation.png-769274c65971b80d9da86145d503b267.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/radiation.png" +dest_files=["res://.godot/imported/radiation.png-769274c65971b80d9da86145d503b267.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/sound/hit.wav b/assets/sound/hit.wav new file mode 100644 index 0000000..0c736c4 Binary files /dev/null and b/assets/sound/hit.wav differ diff --git a/assets/sound/hit.wav.import b/assets/sound/hit.wav.import new file mode 100644 index 0000000..662a0d9 --- /dev/null +++ b/assets/sound/hit.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://xldfu6srikfp" +path="res://.godot/imported/hit.wav-c13e9903e7cd0f7c60a3e2eb42ffb10f.sample" + +[deps] + +source_file="res://assets/sound/hit.wav" +dest_files=["res://.godot/imported/hit.wav-c13e9903e7cd0f7c60a3e2eb42ffb10f.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/hit2.wav b/assets/sound/hit2.wav new file mode 100644 index 0000000..47f1f91 Binary files /dev/null and b/assets/sound/hit2.wav differ diff --git a/assets/sound/hit2.wav.import b/assets/sound/hit2.wav.import new file mode 100644 index 0000000..d56893b --- /dev/null +++ b/assets/sound/hit2.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://vjxm7ay4t2ju" +path="res://.godot/imported/hit2.wav-1c5f75cefc166534c19c77121997252e.sample" + +[deps] + +source_file="res://assets/sound/hit2.wav" +dest_files=["res://.godot/imported/hit2.wav-1c5f75cefc166534c19c77121997252e.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/radiation.wav b/assets/sound/radiation.wav new file mode 100644 index 0000000..31d74fd Binary files /dev/null and b/assets/sound/radiation.wav differ diff --git a/assets/sound/radiation.wav.import b/assets/sound/radiation.wav.import new file mode 100644 index 0000000..a33475a --- /dev/null +++ b/assets/sound/radiation.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://decf2fp3ve2v8" +path="res://.godot/imported/radiation.wav-0b46c551fa7a6fb50d085ddedfe75d20.sample" + +[deps] + +source_file="res://assets/sound/radiation.wav" +dest_files=["res://.godot/imported/radiation.wav-0b46c551fa7a6fb50d085ddedfe75d20.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/select.wav b/assets/sound/select.wav new file mode 100644 index 0000000..ccb58de Binary files /dev/null and b/assets/sound/select.wav differ diff --git a/assets/sound/select.wav.import b/assets/sound/select.wav.import new file mode 100644 index 0000000..924a51f --- /dev/null +++ b/assets/sound/select.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bkq48kq6qu4u2" +path="res://.godot/imported/select.wav-f16e41e71bc8075b5db7a820752aa53b.sample" + +[deps] + +source_file="res://assets/sound/select.wav" +dest_files=["res://.godot/imported/select.wav-f16e41e71bc8075b5db7a820752aa53b.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/shooot2.wav b/assets/sound/shooot2.wav new file mode 100644 index 0000000..abbdb05 Binary files /dev/null and b/assets/sound/shooot2.wav differ diff --git a/assets/sound/shooot2.wav.import b/assets/sound/shooot2.wav.import new file mode 100644 index 0000000..c19c921 --- /dev/null +++ b/assets/sound/shooot2.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bi2ee654gcg2y" +path="res://.godot/imported/shooot2.wav-2e6c186cae5fe7cb14086db1f43ecdc1.sample" + +[deps] + +source_file="res://assets/sound/shooot2.wav" +dest_files=["res://.godot/imported/shooot2.wav-2e6c186cae5fe7cb14086db1f43ecdc1.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/shoot.wav b/assets/sound/shoot.wav new file mode 100644 index 0000000..dbbbc9a Binary files /dev/null and b/assets/sound/shoot.wav differ diff --git a/assets/sound/shoot.wav.import b/assets/sound/shoot.wav.import new file mode 100644 index 0000000..7646c04 --- /dev/null +++ b/assets/sound/shoot.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bhovgop026jpb" +path="res://.godot/imported/shoot.wav-b3df5285297a80da474f59090cab32c2.sample" + +[deps] + +source_file="res://assets/sound/shoot.wav" +dest_files=["res://.godot/imported/shoot.wav-b3df5285297a80da474f59090cab32c2.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/sound/upgrade.wav b/assets/sound/upgrade.wav new file mode 100644 index 0000000..6923c23 Binary files /dev/null and b/assets/sound/upgrade.wav differ diff --git a/assets/sound/upgrade.wav.import b/assets/sound/upgrade.wav.import new file mode 100644 index 0000000..83c8f7b --- /dev/null +++ b/assets/sound/upgrade.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bspgis3hy5scl" +path="res://.godot/imported/upgrade.wav-765ba46e9f3407fab81eb6105142ab6f.sample" + +[deps] + +source_file="res://assets/sound/upgrade.wav" +dest_files=["res://.godot/imported/upgrade.wav-765ba46e9f3407fab81eb6105142ab6f.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/assets/space-small.png b/assets/space-small.png new file mode 100644 index 0000000..5692125 Binary files /dev/null and b/assets/space-small.png differ diff --git a/assets/space-small.png.import b/assets/space-small.png.import new file mode 100644 index 0000000..11ebf54 --- /dev/null +++ b/assets/space-small.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ga64icehjgv2" +path="res://.godot/imported/space-small.png-df594c4f4411bd94bf405ad31629c3ce.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/space-small.png" +dest_files=["res://.godot/imported/space-small.png-df594c4f4411bd94bf405ad31629c3ce.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/space.ase b/assets/space.ase new file mode 100644 index 0000000..9f55e0b Binary files /dev/null and b/assets/space.ase differ diff --git a/assets/space.png b/assets/space.png new file mode 100644 index 0000000..2143561 Binary files /dev/null and b/assets/space.png differ diff --git a/assets/space.png.import b/assets/space.png.import new file mode 100644 index 0000000..22d15a3 --- /dev/null +++ b/assets/space.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://beyhkcr2uvmc7" +path="res://.godot/imported/space.png-e9b3b12e959cbbecef69e1a8ce5816dd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/space.png" +dest_files=["res://.godot/imported/space.png-e9b3b12e959cbbecef69e1a8ce5816dd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/symbols/heart.aseprite b/assets/symbols/heart.aseprite new file mode 100644 index 0000000..44d9c1d Binary files /dev/null and b/assets/symbols/heart.aseprite differ diff --git a/assets/symbols/heart.png b/assets/symbols/heart.png new file mode 100644 index 0000000..9f25b04 Binary files /dev/null and b/assets/symbols/heart.png differ diff --git a/assets/symbols/heart.png.import b/assets/symbols/heart.png.import new file mode 100644 index 0000000..07d3c20 --- /dev/null +++ b/assets/symbols/heart.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwtb3m00d1gu2" +path="res://.godot/imported/heart.png-b584f13654dd78e3e3a87c0193a3ef96.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/symbols/heart.png" +dest_files=["res://.godot/imported/heart.png-b584f13654dd78e3e3a87c0193a3ef96.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/ui/attack.aseprite b/assets/ui/attack.aseprite new file mode 100644 index 0000000..663377f Binary files /dev/null and b/assets/ui/attack.aseprite differ diff --git a/assets/ui/attack.png b/assets/ui/attack.png new file mode 100644 index 0000000..9dcaab5 Binary files /dev/null and b/assets/ui/attack.png differ diff --git a/assets/ui/attack.png.import b/assets/ui/attack.png.import new file mode 100644 index 0000000..74c251b --- /dev/null +++ b/assets/ui/attack.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bgqfuj6p3h5ad" +path="res://.godot/imported/attack.png-2bbbc8a5f73e2cac30c0025af7b53823.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/attack.png" +dest_files=["res://.godot/imported/attack.png-2bbbc8a5f73e2cac30c0025af7b53823.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/ui/button.aseprite b/assets/ui/button.aseprite new file mode 100644 index 0000000..7c1e36d Binary files /dev/null and b/assets/ui/button.aseprite differ diff --git a/assets/ui/button.png b/assets/ui/button.png new file mode 100644 index 0000000..81501e3 Binary files /dev/null and b/assets/ui/button.png differ diff --git a/assets/ui/button.png.import b/assets/ui/button.png.import new file mode 100644 index 0000000..8c9615d --- /dev/null +++ b/assets/ui/button.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmc50277gb4iw" +path="res://.godot/imported/button.png-473760ec7449fb30c95f607492aecb17.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/button.png" +dest_files=["res://.godot/imported/button.png-473760ec7449fb30c95f607492aecb17.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/ui/dash.aseprite b/assets/ui/dash.aseprite new file mode 100644 index 0000000..8b6ee6a Binary files /dev/null and b/assets/ui/dash.aseprite differ diff --git a/assets/ui/dash.png b/assets/ui/dash.png new file mode 100644 index 0000000..5426265 Binary files /dev/null and b/assets/ui/dash.png differ diff --git a/assets/ui/dash.png.import b/assets/ui/dash.png.import new file mode 100644 index 0000000..aa176a4 --- /dev/null +++ b/assets/ui/dash.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmb78bi27e2jl" +path="res://.godot/imported/dash.png-c8a9350270df9861041182e17d843d61.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/dash.png" +dest_files=["res://.godot/imported/dash.png-c8a9350270df9861041182e17d843d61.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/ui/move.aseprite b/assets/ui/move.aseprite new file mode 100644 index 0000000..84dcde9 Binary files /dev/null and b/assets/ui/move.aseprite differ diff --git a/assets/ui/move.png b/assets/ui/move.png new file mode 100644 index 0000000..29b6843 Binary files /dev/null and b/assets/ui/move.png differ diff --git a/assets/ui/move.png.import b/assets/ui/move.png.import new file mode 100644 index 0000000..3681d87 --- /dev/null +++ b/assets/ui/move.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0qub1plvyt4x" +path="res://.godot/imported/move.png-80a455607b945e92849694285c52aba8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/move.png" +dest_files=["res://.godot/imported/move.png-80a455607b945e92849694285c52aba8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/assets/ui/reload.aseprite b/assets/ui/reload.aseprite new file mode 100644 index 0000000..6d004e0 Binary files /dev/null and b/assets/ui/reload.aseprite differ diff --git a/assets/ui/reload.png b/assets/ui/reload.png new file mode 100644 index 0000000..ce97001 Binary files /dev/null and b/assets/ui/reload.png differ diff --git a/assets/ui/reload.png.import b/assets/ui/reload.png.import new file mode 100644 index 0000000..aeab302 --- /dev/null +++ b/assets/ui/reload.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://vxl26x3xc8ms" +path="res://.godot/imported/reload.png-895e9da378108f9c18a7d0b0ef2cc4bf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/reload.png" +dest_files=["res://.godot/imported/reload.png-895e9da378108f9c18a7d0b0ef2cc4bf.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/project.godot b/project.godot index 994e7ea..fd98e1c 100644 --- a/project.godot +++ b/project.godot @@ -10,27 +10,41 @@ config_version=5 [application] -config/name="GMTK Game Jam 2025" +config/name="ChronoSpace" config/tags=PackedStringArray("gamedev") -run/main_scene="uid://cfculwiy7mtdc" +run/main_scene="uid://cx1lvrbofx0je" config/features=PackedStringArray("4.4", "GL Compatibility") boot_splash/image="uid://dwjegx0mvirsg" -config/icon="res://icon.svg" +config/icon="uid://db2bohfy0hq2l" [autoload] Globals="*res://scenes/globals/globals.gd" +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/stretch/mode="viewport" +window/stretch/aspect="keep_height" +window/stretch/scale=0.6 +mouse_cursor/custom_image="uid://bil3xgn75nb2f" + [editor] version_control/plugin_name="GitPlugin" version_control/autoload_on_startup=true +[editor_plugins] + +enabled=PackedStringArray("res://addons/virtual_joystick/plugin.cfg") + [file_customization] folder_colors={ "res://assets/": "red", -"res://scenes/": "green" +"res://scenes/": "green", +"res://theme/": "blue" } [global_group] @@ -41,57 +55,92 @@ player="player" weapon="Weapon" bulletPool="bulletPool" damageArea="damageArea" -healthArea="healthArea" bullet="bullet" obstacle="obstacle" enemy="enemy" +hurtArea="healthArea" +enemyPool="enemyPool" +timeGhostPool="timeGhostPool" +obstaclePool="obstaclePool" [input] moveForward={ "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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":true,"script":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":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":true,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) +, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(167, 18),"global_position":Vector2(176, 66),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":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) ] } +touchscreenForward={ +"deadzone": 0.2, +"events": [] +} moveRight={ "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) , 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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) ] } moveBackward={ "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) -, 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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":true,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) -] +"events": [] } moveLeft={ "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) , 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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":true,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) ] } attack={ "deadzone": 0.2, "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(188, 26),"global_position":Vector2(197, 74),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null) , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null) ] } dash={ "deadzone": 0.2, -"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(40, 22),"global_position":Vector2(49, 70),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) +"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":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +fullscreen={ +"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":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":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":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +lookForward={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) +] +} +lookRight={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) +] +} +lookDown={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) +] +} +lookLeft={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) +] +} + +[input_devices] + +pointing/emulate_touch_from_mouse=true [layer_names] @@ -109,6 +158,8 @@ dash={ 3d_render/layer_6="enemy" 2d_render/layer_7="visionArea" 3d_render/layer_7="visionArea" +2d_render/layer_8="radiation" +3d_render/layer_8="radiation" 2d_render/layer_19="hurtArea" 3d_render/layer_19="hurtArea" 2d_render/layer_20="damageArea" @@ -141,6 +192,10 @@ dash={ 2d_navigation/layer_7="visionArea" 3d_physics/layer_7="visionArea" 3d_navigation/layer_7="visionArea" +2d_physics/layer_8="radiation" +2d_navigation/layer_8="radiation" +3d_physics/layer_8="radiation" +3d_navigation/layer_8="radiation" 2d_physics/layer_31="hurtArea" 2d_navigation/layer_31="hurtArea" 3d_physics/layer_31="hurtArea" @@ -156,11 +211,17 @@ avoidance/layer_4="player" avoidance/layer_5="timeghost" avoidance/layer_6="enemy" avoidance/layer_7="visionArea" +avoidance/layer_8="radiation" avoidance/layer_31="hurtArea" avoidance/layer_32="damageArea" +[physics] + +common/physics_interpolation=true + [rendering] +textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" textures/vram_compression/import_etc2_astc=true diff --git a/scenes/UI/loseScreen/endScreen.gd b/scenes/UI/loseScreen/endScreen.gd new file mode 100644 index 0000000..aa17a0a --- /dev/null +++ b/scenes/UI/loseScreen/endScreen.gd @@ -0,0 +1,19 @@ +extends Control + +@onready var waveInfo = $CenterContainer/VBoxContainer/HBoxContainer/WaveInfo +@onready var destroyedInfo = $CenterContainer/VBoxContainer/HBoxContainer2/DestroyedInfo + +@onready var mainMenu = preload("res://scenes/UI/mainMenu/mainMenu.tscn") + +func _ready() -> void: + waveInfo.text = str(Globals.currentWave) + destroyedInfo.text = str(Globals.destroyedShips) + + +func _on_button_pressed() -> void: + loadMainMenu() + +func loadMainMenu(): + get_tree().get_root().add_child(load("res://scenes/UI/mainMenu/mainMenu.tscn").instantiate()) + queue_free() + diff --git a/scenes/UI/loseScreen/endScreen.gd.uid b/scenes/UI/loseScreen/endScreen.gd.uid new file mode 100644 index 0000000..2724487 --- /dev/null +++ b/scenes/UI/loseScreen/endScreen.gd.uid @@ -0,0 +1 @@ +uid://bj337ebonpkf8 diff --git a/scenes/UI/loseScreen/endScreen.tscn b/scenes/UI/loseScreen/endScreen.tscn new file mode 100644 index 0000000..6eaa275 --- /dev/null +++ b/scenes/UI/loseScreen/endScreen.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=4 format=3 uid="uid://jiaqas4j8vty"] + +[ext_resource type="Script" uid="uid://bj337ebonpkf8" path="res://scenes/UI/loseScreen/endScreen.gd" id="1_dvdsp"] +[ext_resource type="Theme" uid="uid://bcbicfiflkrja" path="res://theme/interface.tres" id="1_hccji"] +[ext_resource type="Texture2D" uid="uid://beyhkcr2uvmc7" path="res://assets/space.png" id="2_hccji"] + +[node name="EndScreen" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_hccji") +script = ExtResource("1_dvdsp") + +[node name="TextureRect" type="TextureRect" parent="."] +layout_mode = 0 +offset_left = -2160.0 +offset_top = -2624.0 +offset_right = 3984.0 +offset_bottom = 3520.0 +texture = ExtResource("2_hccji") +stretch_mode = 1 + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 + +[node name="WaveLabel" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "Survided to Wave: " + +[node name="WaveInfo" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 + +[node name="DestroyedLabel" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Destroyed Ships: " + +[node name="DestroyedInfo" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Button" type="Button" parent="CenterContainer/VBoxContainer/MarginContainer"] +layout_mode = 2 +text = "Back to Menu" + +[connection signal="pressed" from="CenterContainer/VBoxContainer/MarginContainer/Button" to="." method="_on_button_pressed"] diff --git a/scenes/UI/mainMenu/mainMenu.gd b/scenes/UI/mainMenu/mainMenu.gd new file mode 100644 index 0000000..6d75a2e --- /dev/null +++ b/scenes/UI/mainMenu/mainMenu.gd @@ -0,0 +1,16 @@ +extends Control + +@onready var game = preload("res://scenes/main/main.tscn") + +func _on_button_start_pressed() -> void: + laodGame() + Globals.touchscreen = false + +func laodGame(): + get_tree().get_root().add_child(game.instantiate()) + queue_free() + + +func _on_button_start_touch_pressed() -> void: + Globals.touchscreen = true + laodGame() diff --git a/scenes/UI/mainMenu/mainMenu.gd.uid b/scenes/UI/mainMenu/mainMenu.gd.uid new file mode 100644 index 0000000..ec4b883 --- /dev/null +++ b/scenes/UI/mainMenu/mainMenu.gd.uid @@ -0,0 +1 @@ +uid://b1rw7bmvcl11o diff --git a/scenes/UI/mainMenu/mainMenu.tscn b/scenes/UI/mainMenu/mainMenu.tscn new file mode 100644 index 0000000..ec1b87b --- /dev/null +++ b/scenes/UI/mainMenu/mainMenu.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=5 format=3 uid="uid://cx1lvrbofx0je"] + +[ext_resource type="Texture2D" uid="uid://beyhkcr2uvmc7" path="res://assets/space.png" id="1_l1ky1"] +[ext_resource type="Theme" uid="uid://bcbicfiflkrja" path="res://theme/interface.tres" id="1_yi36i"] +[ext_resource type="Script" uid="uid://b1rw7bmvcl11o" path="res://scenes/UI/mainMenu/mainMenu.gd" id="2_dwrcc"] +[ext_resource type="Texture2D" uid="uid://cd5anydes4tv3" path="res://assets/player/shotgunShip.png" id="4_u55jd"] + +[node name="mainMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_yi36i") +script = ExtResource("2_dwrcc") + +[node name="TextureRect" type="TextureRect" parent="."] +offset_left = -2160.0 +offset_top = -2624.0 +offset_right = 3984.0 +offset_bottom = 3520.0 +texture = ExtResource("1_l1ky1") +stretch_mode = 1 + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 +texture = ExtResource("4_u55jd") +stretch_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 + +[node name="ButtonStart" type="Button" parent="CenterContainer/VBoxContainer/MarginContainer"] +layout_mode = 2 +text = "Play" + +[node name="MarginContainer3" type="MarginContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 + +[node name="ButtonStartTouch" type="Button" parent="CenterContainer/VBoxContainer/MarginContainer3"] +layout_mode = 2 +text = "Play +Touchscreen" + +[connection signal="pressed" from="CenterContainer/VBoxContainer/MarginContainer/ButtonStart" to="." method="_on_button_start_pressed"] +[connection signal="pressed" from="CenterContainer/VBoxContainer/MarginContainer3/ButtonStartTouch" to="." method="_on_button_start_touch_pressed"] diff --git a/scenes/areas/damageArea/damageArea.gd b/scenes/areas/damageArea/damageArea.gd index 53c7565..6721d5b 100644 --- a/scenes/areas/damageArea/damageArea.gd +++ b/scenes/areas/damageArea/damageArea.gd @@ -1,8 +1,15 @@ extends Area2D +# +#@export var damage: int +# -@export var damage: int +#func _on_area_entered(area: Area2D) -> void: + #if area.is_in_group("hurtArea"): + #area.hurt.emit(damage) - -func _on_area_entered(area: Area2D) -> void: - if area.is_in_group("healthArea"): - area.hurt.emit(damage) +func damageHurtArea(_area: Area2D, _damage: int): + if get_parent().is_in_group("timeGhost") and _area.get_parent() == Globals.getPlayer(): + print("time") + return + if _area.is_in_group("hurtArea"): + _area.hurt.emit(_damage) diff --git a/scenes/areas/damageArea/damageArea.tscn b/scenes/areas/damageArea/damageArea.tscn index faaca62..cee4617 100644 --- a/scenes/areas/damageArea/damageArea.tscn +++ b/scenes/areas/damageArea/damageArea.tscn @@ -8,5 +8,3 @@ collision_mask = 1073741824 script = ExtResource("1_jlldj") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] - -[connection signal="area_entered" from="." to="." method="_on_area_entered"] diff --git a/scenes/areas/hurtArea/hurtArea.tscn b/scenes/areas/hurtArea/hurtArea.tscn index 5afccf6..e23927d 100644 --- a/scenes/areas/hurtArea/hurtArea.tscn +++ b/scenes/areas/hurtArea/hurtArea.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" uid="uid://1a30h315e73b" path="res://scenes/areas/hurtArea/hurt_area.gd" id="1_c51ym"] -[node name="hurtArea" type="Area2D" groups=["healthArea"]] +[node name="hurtArea" type="Area2D" groups=["hurtArea"]] collision_layer = 1073741824 collision_mask = 2147483648 script = ExtResource("1_c51ym") diff --git a/scenes/areas/hurtArea/hurt_area.gd b/scenes/areas/hurtArea/hurt_area.gd index 8f201aa..98d17a6 100644 --- a/scenes/areas/hurtArea/hurt_area.gd +++ b/scenes/areas/hurtArea/hurt_area.gd @@ -1,8 +1,3 @@ extends Area2D signal hurt(amount: int) - -# -#func _on_area_entered(area: Area2D) -> void: - #print(area.name) -# diff --git a/scenes/bullet/bullet.gd b/scenes/bullet/bullet.gd index 860541a..e4175a1 100644 --- a/scenes/bullet/bullet.gd +++ b/scenes/bullet/bullet.gd @@ -10,15 +10,15 @@ var penetration: int = 1 var penetratedCount: int = 0 var range: float = 1.0 +var fromTimeGhost = false + func _ready() -> void: - damageArea.damage = damage rangeTimer.start(range) func spawn(_positon: Vector2, _rotation: float, _damage: int, _range: float = 8.0, _penetration: int = 1, _speed: int = 10) -> void: global_position = _positon rotation = _rotation damage = _damage - $DamageArea.damage = _damage penetration = _penetration range = _range speed = _speed * 10000 @@ -29,6 +29,12 @@ func _physics_process(delta: float) -> void: move_and_slide() func _on_damage_area_area_entered(area: Area2D) -> void: + if fromTimeGhost: + #print(area.get_parent()) + #print(Globals.getPlayer()) + if area.get_parent() == Globals.getPlayer(): + return + damageArea.damageHurtArea(area, damage) penetratedCount += 1 checkPenetration() diff --git a/scenes/bullet/bullet.tscn b/scenes/bullet/bullet.tscn index 5f7d79e..30711fe 100644 --- a/scenes/bullet/bullet.tscn +++ b/scenes/bullet/bullet.tscn @@ -4,6 +4,7 @@ [ext_resource type="Script" uid="uid://w5vknsebe1yd" path="res://scenes/bullet/bullet.gd" id="1_mkndb"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_mkndb"] +size = Vector2(16, 48) [node name="Bullet" type="CharacterBody2D" groups=["bullet"]] collision_layer = 0 @@ -14,7 +15,6 @@ script = ExtResource("1_mkndb") [node name="Sprite2D" type="Sprite2D" parent="."] position = Vector2(0, -9.53674e-07) -scale = Vector2(0.125, 0.25) [node name="rangeTimer" type="Timer" parent="."] one_shot = true diff --git a/scenes/bullet/bulletMinigun/bulletMinigun.tscn b/scenes/bullet/bulletMinigun/bulletMinigun.tscn index d0f272b..17fd834 100644 --- a/scenes/bullet/bulletMinigun/bulletMinigun.tscn +++ b/scenes/bullet/bulletMinigun/bulletMinigun.tscn @@ -2,14 +2,16 @@ [ext_resource type="PackedScene" uid="uid://0ndix1r8v6i1" path="res://scenes/bullet/bullet.tscn" id="1_a54uy"] [ext_resource type="Script" uid="uid://58udf4vhqogw" path="res://scenes/bullet/bulletMinigun/bulletMinigun.gd" id="2_4u8er"] -[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="3_xaefx"] +[ext_resource type="Texture2D" uid="uid://d2h1eyb147j7t" path="res://assets/bullets/minigunBullet.png" id="3_xaefx"] [node name="BulletMinigun" instance=ExtResource("1_a54uy")] script = ExtResource("2_4u8er") [node name="Sprite2D" parent="." index="1"] -position = Vector2(4.76837e-07, 3.41061e-13) -scale = Vector2(0.25, 0.25) +position = Vector2(0, 0) texture = ExtResource("3_xaefx") +[node name="CollisionShape2D" parent="DamageArea" index="0"] +position = Vector2(0, 4) + [editable path="DamageArea"] diff --git a/scenes/bullet/bulletPool.tscn b/scenes/bullet/bulletPool.tscn deleted file mode 100644 index bf5745d..0000000 --- a/scenes/bullet/bulletPool.tscn +++ /dev/null @@ -1,3 +0,0 @@ -[gd_scene format=3 uid="uid://dm0rd88xd5m7k"] - -[node name="bulletPool" type="Node2D" groups=["bulletPool"]] diff --git a/scenes/bullet/bulletRailgun/bulletRailgun.tscn b/scenes/bullet/bulletRailgun/bulletRailgun.tscn index 44ab2a8..e8091c6 100644 --- a/scenes/bullet/bulletRailgun/bulletRailgun.tscn +++ b/scenes/bullet/bulletRailgun/bulletRailgun.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=3 format=3 uid="uid://y7lohopyn6bw"] +[gd_scene load_steps=4 format=3 uid="uid://y7lohopyn6bw"] [ext_resource type="PackedScene" uid="uid://0ndix1r8v6i1" path="res://scenes/bullet/bullet.tscn" id="1_0cdtm"] [ext_resource type="Script" uid="uid://b884kxhja5sib" path="res://scenes/bullet/bulletRailgun/bulletRailgun.gd" id="2_pmqys"] +[ext_resource type="Texture2D" uid="uid://xj1r10s5lg48" path="res://assets/bullets/railgunBullet.png" id="3_5rfgl"] [node name="BulletRailgun" instance=ExtResource("1_0cdtm")] script = ExtResource("2_pmqys") +[node name="Sprite2D" parent="." index="1"] +texture = ExtResource("3_5rfgl") + [editable path="DamageArea"] diff --git a/scenes/bullet/bulletShotgun/bulletShotgun.tscn b/scenes/bullet/bulletShotgun/bulletShotgun.tscn index 3677fbf..3159bdd 100644 --- a/scenes/bullet/bulletShotgun/bulletShotgun.tscn +++ b/scenes/bullet/bulletShotgun/bulletShotgun.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=3 format=3 uid="uid://bye43kihfl72l"] +[gd_scene load_steps=4 format=3 uid="uid://bye43kihfl72l"] [ext_resource type="PackedScene" uid="uid://0ndix1r8v6i1" path="res://scenes/bullet/bullet.tscn" id="1_shfn0"] [ext_resource type="Script" uid="uid://ddbv5kpk32diu" path="res://scenes/bullet/bulletShotgun/bulletShotgun.gd" id="2_mk7vs"] +[ext_resource type="Texture2D" uid="uid://b8y5bc5ntygd8" path="res://assets/bullets/shotgunBullet.png" id="3_uxgou"] [node name="BulletShotgun" instance=ExtResource("1_shfn0")] script = ExtResource("2_mk7vs") +[node name="Sprite2D" parent="." index="1"] +texture = ExtResource("3_uxgou") + [editable path="DamageArea"] diff --git a/scenes/globals/globals.gd b/scenes/globals/globals.gd index 04e9231..dace884 100644 --- a/scenes/globals/globals.gd +++ b/scenes/globals/globals.gd @@ -1,14 +1,80 @@ extends Node +var destroyedShips: int = 0 + var currentDelay: float = 1.0 var player: Player = null +var currentWave: int = 0 +var enemyCount: int = 0 +var touchscreen: bool = false + +var UPGRADES: Array[Upgrade] = [ + TimeGhostUpgrade.new(), + SpeedUpgrade.new(), + SelfHealUpgrade.new(), + MinigunUpgrade.new(), + ShotgunUpgrade.new(), + RailgunUpgrade.new(), + Heal50Upgrade.new(), + Heal100Upgrade.new(), + HealthUpgrade.new(), + #DashUpgrade.new(), + #StrafeUpgrade.new(), + #DamageUpgrade.new() +] + +var currentUpgrades: Array[Upgrade] = UPGRADES + +signal waveComplete func _ready() -> void: - pass - - + process_mode = Node.PROCESS_MODE_ALWAYS + reset() + +func _physics_process(delta: float) -> void: + if Input.is_action_just_pressed("fullscreen"): + if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + elif DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + func setPlayer(_player: Player): player = _player func getPlayer() -> Player: return player + +func reset(): + currentDelay = 1.0 + currentWave = 0 + enemyCount = 0 + destroyedShips = 0 + currentUpgrades = UPGRADES + touchscreen = false + + +#func nextWave(): + #currentWave += 1 + #enemyCount = 0 + #waveComplete.emit() + +func enemyDestroyed(): + destroyedShips += 1 + enemyCount -= 1 + if enemyCount <= 0: + await get_tree().create_timer(1).timeout + waveComplete.emit() + +func getUpgrades() -> Array[Upgrade]: + return currentUpgrades + +func getUpgrade(upgrade: int): + return currentUpgrades[upgrade] + +func removeUpgrade(upgrade: int): + currentUpgrades.pop_at(upgrade) + +func removeSpeedUPgrade(): + for i in currentUpgrades: + if i is SpeedUpgrade: + currentUpgrades.erase(i) diff --git a/scenes/main/galaxy.gdshader b/scenes/main/galaxy.gdshader new file mode 100644 index 0000000..806fd24 --- /dev/null +++ b/scenes/main/galaxy.gdshader @@ -0,0 +1,90 @@ +shader_type canvas_item; +render_mode unshaded; + +uniform int iterations = 20; +uniform float formuparam = 1.00; + +uniform int volsteps = 20; +uniform float stepsize = 0.1; + +uniform float zoom = 0.800; +uniform float tile = 0.5; +uniform float speed = 0.001; + +uniform float brightness = 0.002; +uniform float darkmatter = 0.100; +uniform float distfading = 0.650; +uniform float saturation = 0.750; + +uniform vec2 iResolution = vec2(192, 192); +uniform vec2 iMouse = vec2(0,0); + +float SCurve (float value) { + + if (value < 0.5) + { + return value * value * value * value * value * 16.0; + } + + value -= 1.0; + + return value * value * value * value * value * 16.0 + 1.0; +} + +void fragment() +{ + //get coords and direction + vec2 uv=FRAGCOORD.xy/iResolution.xy-.5; + uv.y*=iResolution.y/iResolution.x; + vec3 dir=vec3(uv*zoom,1.); + float time=TIME*speed+.25; + + //mouse rotation + float a1=0.5+iMouse.x/iResolution.x*2.; + float a2=0.8+iMouse.y/iResolution.y*2.; + mat2 rot1=mat2(vec2(cos(a1),sin(a1)),vec2(-sin(a1),cos(a1))); + mat2 rot2=mat2(vec2(cos(a2),sin(a2)),vec2(-sin(a2),cos(a2))); + dir.xy*=rot1; + dir.xz*=rot2; + vec3 from=vec3(1.0,0.5,0.5); + from-=vec3(0.0,time,0.0); + from.xz*=rot1; + from.xy*=rot2; + + //volumetric rendering + float s=0.1,fade=1.; + vec3 v=vec3(0.); + for (int r=0; r6) fade*=1.-dm; // dark matter, don't render near + //v+=vec3(dm,dm*.5,0.); + v+=fade; + v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade; // coloring based on distance + fade*=distfading; // distance fading + s+=stepsize; + } + + v=mix(vec3(length(v)),v,saturation); //color adjust + + vec4 C = vec4(v*.01,1.); + + C.r = pow(C.r, 0.35); + C.g = pow(C.g, 0.36); + C.b = pow(C.b, 0.38); + + vec4 L = C; + + COLOR.r = mix(L.r, SCurve(C.r), 0.7); + COLOR.g = mix(L.g, SCurve(C.g), 1.0); + COLOR.b = mix(L.b, SCurve(C.b), 0.2); + +} \ No newline at end of file diff --git a/scenes/main/galaxy.gdshader.uid b/scenes/main/galaxy.gdshader.uid new file mode 100644 index 0000000..b240961 --- /dev/null +++ b/scenes/main/galaxy.gdshader.uid @@ -0,0 +1 @@ +uid://b23078hfmmpc8 diff --git a/scenes/main/main.gd b/scenes/main/main.gd index 41b039f..ebf1dfa 100644 --- a/scenes/main/main.gd +++ b/scenes/main/main.gd @@ -1,50 +1,69 @@ extends Node2D +@onready var obstaclesSpawnTimer = $obstaclesSpawnTimer -@onready var timeGhost = preload("res://scenes/spaceShip/timeGhost/timeghost.tscn") -@onready var minigun = preload("res://scenes/weapon/minigun/minigun.tscn") -@onready var railgun = preload("res://scenes/weapon/railgun/railgun.tscn") -@onready var shotgun = preload("res://scenes/weapon/shotgun/shotgun.tscn") +@onready var shotgunEnemy: PackedScene = preload("res://scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.tscn") +@onready var minigunEnemy: PackedScene = preload("res://scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.tscn") +@onready var railgunEnemy: PackedScene = preload("res://scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.tscn") +@onready var meteor: PackedScene = preload("res://scenes/obstacle/meteor/meteor.tscn") +@onready var radiation: PackedScene = preload("res://scenes/obstacle/radiation/radiation.tscn") -@onready var obstaclePool = $obstaclePool -@onready var enemyPool = $enemyPool -@onready var enemySpawnTimer = $spawnTimer/enemySpawnTimer -@onready var obstaclesSpawnTimer = $spawnTimer/obstaclesSpawnTimer - -@onready var enemy: PackedScene = preload("res://scenes/spaceShip/enemy/enemy.tscn") -@onready var obstacle: PackedScene = preload("res://scenes/obstacle/meteor/meteor.tscn") +@onready var endScreen: PackedScene = preload("res://scenes/UI/loseScreen/endScreen.tscn") +var minigunRatio = 5 +var railgunRatio = 10 +var endedRound = false @onready var player = $Player func _ready() -> void: + obstaclesSpawnTimer.autostart = true + obstaclesSpawnTimer.start() Globals.setPlayer(player) - player.changeWeapon(shotgun) + Globals.waveComplete.connect(nextWave) + player.destroyed.connect(endRound) + nextWave() - for i in range(1, 10): - addGhost() - - - - -func addGhost(): - var ghost = timeGhost.instantiate() - add_child(ghost) - player.addTimeGhost(ghost) func spawnObstacle(_obstacle: PackedScene, _position: Vector2): var newObstacle = _obstacle.instantiate() newObstacle.global_position = _position - obstaclePool.add_child(newObstacle) + if get_tree().get_first_node_in_group("obstaclePool") != null: + get_tree().get_first_node_in_group("obstaclePool").add_child(newObstacle) func spawnEnemy(_enemy: PackedScene, _position: Vector2): + Globals.enemyCount += 1 var newEnemy = _enemy.instantiate() newEnemy.global_position = _position - enemyPool.add_child(newEnemy) + if get_tree().get_first_node_in_group("enemyPool") != null: + get_tree().get_first_node_in_group("enemyPool").add_child(newEnemy) -func _on_enemy_spawn_timer_timeout() -> void: - spawnEnemy(enemy, Globals.getPlayer().getRandomSpawnPointPosition()) - for i in enemyPool.get_children(): - i.changeWeapon(shotgun) + #newEnemy.destroyed.connect(startEnemySpawnTimer) func _on_obstacles_spawn_timer_timeout() -> void: - spawnObstacle(obstacle, Globals.getPlayer().getRandomSpawnPointPosition()) + var rng = RandomNumberGenerator.new() + var number = rng.randi_range(0, 10) + if number == 10: + if Globals.getPlayer() != null: + spawnObstacle(radiation, Globals.getPlayer().getRandomSpawnPointPosition()) + else: + if Globals.getPlayer() != null: + spawnObstacle(meteor, Globals.getPlayer().getRandomSpawnPointPosition()) + + +func nextWave(): + Globals.enemyCount = 0 + Globals.currentWave += 1 + if Globals.getPlayer() != null: + for i in range(1, Globals.currentWave+1): + if i % railgunRatio == 0: + spawnEnemy(railgunEnemy, Globals.getPlayer().getRandomSpawnPointPosition()) + elif i % minigunRatio == 0: + spawnEnemy(minigunEnemy, Globals.getPlayer().getRandomSpawnPointPosition()) + else: + spawnEnemy(shotgunEnemy, Globals.getPlayer().getRandomSpawnPointPosition()) + +func endRound(): + if not endedRound: + endedRound = true + get_tree().get_root().add_child(endScreen.instantiate()) + self.queue_free() diff --git a/scenes/main/main.tscn b/scenes/main/main.tscn index a941c96..cdc92f0 100644 --- a/scenes/main/main.tscn +++ b/scenes/main/main.tscn @@ -2,38 +2,26 @@ [ext_resource type="Script" uid="uid://cvoco1axom40" path="res://scenes/main/main.gd" id="1_kdt4m"] [ext_resource type="PackedScene" uid="uid://bmc2exqutt6vu" path="res://scenes/spaceShip/player/player.tscn" id="2_ia3nl"] -[ext_resource type="PackedScene" uid="uid://dm0rd88xd5m7k" path="res://scenes/bullet/bulletPool.tscn" id="3_2s0fe"] -[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="4_r8qeh"] +[ext_resource type="Texture2D" uid="uid://beyhkcr2uvmc7" path="res://assets/space.png" id="2_l3cfh"] +[ext_resource type="PackedScene" uid="uid://dm0rd88xd5m7k" path="res://scenes/pools/pools.tscn" id="3_2s0fe"] [node name="main" type="Node2D"] script = ExtResource("1_kdt4m") +[node name="obstaclesSpawnTimer" type="Timer" parent="."] +autostart = true + [node name="TextureRect" type="TextureRect" parent="."] modulate = Color(0.605274, 0.605274, 0.605274, 1) -offset_left = -11272.0 -offset_top = -6736.0 -offset_right = 12152.0 -offset_bottom = 7008.0 -texture = ExtResource("4_r8qeh") +offset_left = -147424.0 +offset_top = -96136.0 +offset_right = 176160.0 +offset_bottom = 137080.0 +texture = ExtResource("2_l3cfh") stretch_mode = 1 +[node name="Pools" parent="." instance=ExtResource("3_2s0fe")] + [node name="Player" parent="." instance=ExtResource("2_ia3nl")] -spawnDistance = 1000 -[node name="bulletPool" parent="." instance=ExtResource("3_2s0fe")] - -[node name="obstaclePool" type="Node2D" parent="."] - -[node name="enemyPool" type="Node2D" parent="."] - -[node name="spawnTimer" type="Node" parent="."] - -[node name="enemySpawnTimer" type="Timer" parent="spawnTimer"] -wait_time = 10.0 -autostart = true - -[node name="obstaclesSpawnTimer" type="Timer" parent="spawnTimer"] -autostart = true - -[connection signal="timeout" from="spawnTimer/enemySpawnTimer" to="." method="_on_enemy_spawn_timer_timeout"] -[connection signal="timeout" from="spawnTimer/obstaclesSpawnTimer" to="." method="_on_obstacles_spawn_timer_timeout"] +[connection signal="timeout" from="obstaclesSpawnTimer" to="." method="_on_obstacles_spawn_timer_timeout"] diff --git a/scenes/obstacle/meteor/animation_player.gd b/scenes/obstacle/meteor/animation_player.gd new file mode 100644 index 0000000..6a33394 --- /dev/null +++ b/scenes/obstacle/meteor/animation_player.gd @@ -0,0 +1,4 @@ +extends AnimationPlayer + +func _ready() -> void: + play("spin") diff --git a/scenes/obstacle/meteor/animation_player.gd.uid b/scenes/obstacle/meteor/animation_player.gd.uid new file mode 100644 index 0000000..cbdbce5 --- /dev/null +++ b/scenes/obstacle/meteor/animation_player.gd.uid @@ -0,0 +1 @@ +uid://mnl62nrp3ffi diff --git a/scenes/obstacle/meteor/meteor.gd b/scenes/obstacle/meteor/meteor.gd index d2f3813..949d586 100644 --- a/scenes/obstacle/meteor/meteor.gd +++ b/scenes/obstacle/meteor/meteor.gd @@ -1,18 +1,36 @@ class_name Meteor extends "res://scenes/obstacle/obstacle.gd" +@onready var animationPlayer = $AnimationPlayer + @export var minSpeed: int = 100 @export var maxSpeed: int = 1000 +@export var minScale: float = 0.5 +@export var maxScale: float = 2 + +var rotated = false var speed: int = 1000 +var offset: int = 0 var direction: int func _init() -> void: var rng = RandomNumberGenerator.new() - direction = rng.randi_range(0, 360) + var newScale = rng.randf_range(minScale, maxScale) + scale = Vector2(newScale, newScale) + + var direction = Vector2.UP.rotated(rotation) + direction = rng.randi_range(0, 20) speed = rng.randi_range(minSpeed, maxSpeed) - rotation = direction + #rotation = direction func _physics_process(delta: float) -> void: - velocity = Vector2.UP.rotated(direction).normalized() * speed + if not rotated: + rotated = true + if Globals.getPlayer() != null: + look_at(Globals.getPlayer().global_position) + var rng = RandomNumberGenerator.new() + + + velocity = Vector2.RIGHT.rotated(rotation+offset).normalized() * speed move_and_slide() diff --git a/scenes/obstacle/meteor/meteor.tscn b/scenes/obstacle/meteor/meteor.tscn index b003844..63b3306 100644 --- a/scenes/obstacle/meteor/meteor.tscn +++ b/scenes/obstacle/meteor/meteor.tscn @@ -1,36 +1,83 @@ -[gd_scene load_steps=7 format=3 uid="uid://vl8duuwwrpqm"] +[gd_scene load_steps=11 format=3 uid="uid://vl8duuwwrpqm"] -[ext_resource type="PackedScene" uid="uid://cgqo1nxq6xprm" path="res://scenes/obstacle/obstacle.tscn" id="1_skd46"] +[ext_resource type="PackedScene" uid="uid://cgqo1nxq6xprm" path="res://scenes/obstacle/obstacle.tscn" id="1_8c34n"] [ext_resource type="Script" uid="uid://b82cnxsh4mn0f" path="res://scenes/obstacle/meteor/meteor.gd" id="2_8c34n"] -[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="3_jb48p"] - -[sub_resource type="CircleShape2D" id="CircleShape2D_8c34n"] -radius = 56.0 +[ext_resource type="Texture2D" uid="uid://drk4xkhlq00x3" path="res://assets/obstacles/meteor.png" id="3_jb48p"] +[ext_resource type="Script" uid="uid://mnl62nrp3ffi" path="res://scenes/obstacle/meteor/animation_player.gd" id="4_pganv"] [sub_resource type="CircleShape2D" id="CircleShape2D_jb48p"] -radius = 64.0 +radius = 128.0 [sub_resource type="CircleShape2D" id="CircleShape2D_pganv"] -radius = 64.0 +radius = 144.0 -[node name="Meteor" instance=ExtResource("1_skd46")] -modulate = Color(1, 0, 0, 1) +[sub_resource type="CircleShape2D" id="CircleShape2D_22u22"] +radius = 128.25 + +[sub_resource type="Animation" id="Animation_22u22"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_pganv"] +resource_name = "spin" +length = 5.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/keys = { +"times": PackedFloat32Array(0, 5), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 6.28319] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_b3sfu"] +_data = { +&"RESET": SubResource("Animation_22u22"), +&"spin": SubResource("Animation_pganv") +} + +[node name="Meteor" instance=ExtResource("1_8c34n")] script = ExtResource("2_8c34n") minSpeed = 100 maxSpeed = 1000 -health = 10 +minScale = 0.5 +maxScale = 2.0 [node name="CollisionShape2D" parent="." index="0"] -shape = SubResource("CircleShape2D_8c34n") - -[node name="CollisionShape2D" parent="DamageArea" index="0"] shape = SubResource("CircleShape2D_jb48p") -[node name="CollisionShape2D" parent="hurtArea" index="0"] +[node name="CollisionShape2D" parent="DamageArea" index="0"] shape = SubResource("CircleShape2D_pganv") +[node name="CollisionShape2D" parent="hurtArea" index="0"] +shape = SubResource("CircleShape2D_22u22") + [node name="Sprite2D" parent="." index="3"] +position = Vector2(5.72205e-06, 5.72205e-06) +scale = Vector2(0.666667, 0.666667) texture = ExtResource("3_jb48p") +[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="6"] +libraries = { +&"": SubResource("AnimationLibrary_b3sfu") +} +script = ExtResource("4_pganv") + [editable path="DamageArea"] [editable path="hurtArea"] diff --git a/scenes/obstacle/obstacle.gd b/scenes/obstacle/obstacle.gd index 9abbf4e..dd4ecbc 100644 --- a/scenes/obstacle/obstacle.gd +++ b/scenes/obstacle/obstacle.gd @@ -2,22 +2,25 @@ class_name Obstacle extends CharacterBody2D @onready var sprite = $Sprite2D @onready var lifeTimeTimer = $lifeTimeTimer +@onready var damageArea = $DamageArea +@onready var hit = $hit -@export var damage: int = 10 -@export var health: int = 1 +@export var damage: int = 100 @export var minHealth: int = 1 -@export var maxHealth: int = 1 +@export var maxHealth: int = 100 +@export var health: int @export var lifeTime: int = 600 func _ready() -> void: + health = maxHealth + damage + 1 lifeTimeTimer.start(lifeTime) - health += damage func spawn(damage: int): pass func _on_hurt_area_hurt(amount: int) -> void: + hit.play() hurt(amount) func hurt(amount: int): @@ -29,3 +32,7 @@ func hurt(amount: int): func _on_life_time_timer_timeout() -> void: queue_free() + + +func _on_damage_area_area_entered(area: Area2D) -> void: + damageArea.damageHurtArea(area, damage) diff --git a/scenes/obstacle/obstacle.tscn b/scenes/obstacle/obstacle.tscn index e4dda7f..ce3740e 100644 --- a/scenes/obstacle/obstacle.tscn +++ b/scenes/obstacle/obstacle.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=3 uid="uid://cgqo1nxq6xprm"] +[gd_scene load_steps=5 format=3 uid="uid://cgqo1nxq6xprm"] [ext_resource type="PackedScene" uid="uid://eqo7k2ronf8k" path="res://scenes/areas/damageArea/damageArea.tscn" id="1_1ys07"] [ext_resource type="Script" uid="uid://iu7hvfpevs65" path="res://scenes/obstacle/obstacle.gd" id="1_osovj"] [ext_resource type="PackedScene" uid="uid://cglnd1ekr5u6r" path="res://scenes/areas/hurtArea/hurtArea.tscn" id="2_osovj"] +[ext_resource type="AudioStream" uid="uid://vjxm7ay4t2ju" path="res://assets/sound/hit2.wav" id="4_ckc2h"] [node name="Obstacle" type="CharacterBody2D" groups=["obstacle"]] collision_layer = 2 @@ -20,6 +21,10 @@ script = ExtResource("1_osovj") [node name="lifeTimeTimer" type="Timer" parent="."] one_shot = true +[node name="hit" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("4_ckc2h") + +[connection signal="area_entered" from="DamageArea" to="." method="_on_damage_area_area_entered"] [connection signal="hurt" from="hurtArea" to="." method="_on_hurt_area_hurt"] [connection signal="timeout" from="lifeTimeTimer" to="." method="_on_life_time_timer_timeout"] diff --git a/scenes/obstacle/radiation/radiation.gd b/scenes/obstacle/radiation/radiation.gd new file mode 100644 index 0000000..a8783c1 --- /dev/null +++ b/scenes/obstacle/radiation/radiation.gd @@ -0,0 +1,6 @@ +class_name Radiation extends "res://scenes/obstacle/obstacle.gd" + + +func _physics_process(delta: float) -> void: + for i: Spaceship in $range.get_overlapping_bodies(): + i.applyRadiation(damage) diff --git a/scenes/obstacle/radiation/radiation.gd.uid b/scenes/obstacle/radiation/radiation.gd.uid new file mode 100644 index 0000000..68868a1 --- /dev/null +++ b/scenes/obstacle/radiation/radiation.gd.uid @@ -0,0 +1 @@ +uid://cf6le506yx5kl diff --git a/scenes/obstacle/radiation/radiation.gdshader b/scenes/obstacle/radiation/radiation.gdshader new file mode 100644 index 0000000..c398526 --- /dev/null +++ b/scenes/obstacle/radiation/radiation.gdshader @@ -0,0 +1,49 @@ +shader_type canvas_item; + +uniform float time : hint_range(0.0, 10.0); + +float snoise(vec3 uv, float res) +{ + const vec3 s = vec3(1e0, 1e2, 1e3); + uv *= res; + + vec3 uv0 = floor(mod(uv, res)) * s; + vec3 uv1 = floor(mod(uv + vec3(1.0), res)) * s; + + vec3 f = fract(uv); + f = f * f * (3.0 - 2.0 * f); + + vec4 v = vec4(uv0.x + uv0.y + uv0.z, uv1.x + uv0.y + uv0.z, + uv0.x + uv1.y + uv0.z, uv1.x + uv1.y + uv0.z); + + vec4 r = fract(sin(v * 1e-1) * 1e3); + float r0 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y); + + r = fract(sin((v + uv1.z - uv0.z) * 1e-1) * 1e3); + float r1 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y); + + return mix(r0, r1, f.z) * 2.0 - 1.0; +} + +void fragment() +{ + // Calcular las coordenadas de la pantalla usando SCREEN_PIXEL_SIZE + vec2 screen_size = vec2(1.0 / SCREEN_PIXEL_SIZE.x, 1.0 / SCREEN_PIXEL_SIZE.y); + vec2 fragCoord = FRAGCOORD.xy; + + vec2 p = -0.5 + fragCoord.xy / screen_size; + p.x *= screen_size.x / screen_size.y; + + float color = 3.0 - (3.0 * length(2.0 * p)); + + vec3 coord = vec3(atan(p.x, p.y) / 6.2832 + 0.5, length(p) * 0.4, 0.5); + + // if you dont want use gdscript to animate you can replace the 'time' to 'TIME' + for (int i = 1; i <= 7; i++) + { + float power = pow(2.0, float(i)); + color += (1.5 / power) * snoise(coord + vec3(0.0, -time * 0.05, time * 0.01), power * 16.0); + } + + COLOR = vec4(color, pow(max(color, 0.0), 2.0) * 0.4, pow(max(color, 0.0), 3.0) * 0.15, 1.0); +} diff --git a/scenes/obstacle/radiation/radiation.gdshader.uid b/scenes/obstacle/radiation/radiation.gdshader.uid new file mode 100644 index 0000000..bdcf9ab --- /dev/null +++ b/scenes/obstacle/radiation/radiation.gdshader.uid @@ -0,0 +1 @@ +uid://bqato6xoe08xd diff --git a/scenes/obstacle/radiation/radiation.tscn b/scenes/obstacle/radiation/radiation.tscn new file mode 100644 index 0000000..60601d0 --- /dev/null +++ b/scenes/obstacle/radiation/radiation.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=8 format=3 uid="uid://dhkcgxwakdha7"] + +[ext_resource type="PackedScene" uid="uid://cgqo1nxq6xprm" path="res://scenes/obstacle/obstacle.tscn" id="1_0jyim"] +[ext_resource type="Script" uid="uid://cf6le506yx5kl" path="res://scenes/obstacle/radiation/radiation.gd" id="2_7r84j"] +[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="3_o6dqs"] +[ext_resource type="Texture2D" uid="uid://bwnpsmrwskrgh" path="res://assets/radiation.png" id="4_pc435"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_7r84j"] +radius = 64.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_as1jp"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_pc435"] +radius = 192.0 + +[node name="Radiation" instance=ExtResource("1_0jyim")] +collision_layer = 128 +collision_mask = 44 +script = ExtResource("2_7r84j") +damage = 1 +lifeTime = 180 + +[node name="CollisionShape2D" parent="DamageArea" index="0"] +shape = SubResource("CircleShape2D_7r84j") +disabled = true + +[node name="CollisionShape2D" parent="hurtArea" index="0"] +disabled = true + +[node name="Sprite2D" parent="." index="3"] +visible = false +material = SubResource("ShaderMaterial_as1jp") +texture = ExtResource("3_o6dqs") + +[node name="range" type="Area2D" parent="." index="6"] +collision_layer = 128 +collision_mask = 40 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="range" index="0"] +shape = SubResource("CircleShape2D_pc435") + +[node name="CPUParticles2D" type="CPUParticles2D" parent="." index="7"] +amount = 100 +texture = ExtResource("4_pc435") +lifetime = 1.8 +speed_scale = 0.1 +randomness = 1.0 +spread = 180.0 +gravity = Vector2(0, 0) +initial_velocity_min = 100.0 +initial_velocity_max = 100.0 +angle_max = 720.0 +scale_amount_min = 0.8 +scale_amount_max = 1.2 + +[editable path="DamageArea"] +[editable path="hurtArea"] diff --git a/scenes/pools/pools.tscn b/scenes/pools/pools.tscn new file mode 100644 index 0000000..b21e195 --- /dev/null +++ b/scenes/pools/pools.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://dm0rd88xd5m7k"] + +[node name="Pools" type="Node2D"] + +[node name="enemyPool" type="Node2D" parent="." groups=["enemyPool"]] + +[node name="timeGhostPool" type="Node2D" parent="." groups=["timeGhostPool"]] + +[node name="obstaclePool" type="Node2D" parent="." groups=["obstaclePool"]] + +[node name="bulletPool" type="Node2D" parent="." groups=["bulletPool"]] diff --git a/scenes/spaceShip/enemy/enemy.gd b/scenes/spaceShip/enemy/enemy.gd index 11ac94f..2f94efc 100644 --- a/scenes/spaceShip/enemy/enemy.gd +++ b/scenes/spaceShip/enemy/enemy.gd @@ -1,22 +1,67 @@ class_name Enemy extends "res://scenes/spaceShip/spaceShip.gd" +@onready var visionArea: VisionArea = $VisionAreas/VisionArea @onready var visionAreaStop: VisionArea = $VisionAreas/VisionAreaStop +@onready var visionAreaEnemy: VisionArea = $VisionAreas/VisionAreaEnemy @onready var raycast: RayCast2D = $RayCast2D +@onready var hit = $hit +@export var range: int = 800 +func _ready() -> void: + setVision() + +func setVision(): + visionArea.changeViewSize(range) + visionAreaStop.changeViewSize(range-50) + visionAreaEnemy.changeViewSize(200) + raycast.target_position.y = -range + func _physics_process(delta: float) -> void: + #print(name, " velocity: ", velocity," velocityMedian: ", getVelocityMedian(), " radius: ", $VisionAreas/VisionAreaStop/CollisionShape2D.shape.radius) + #if Globals.getPlayer() != null: + #if getVelocityMedian()*8 > range: + #visionAreaStop.changeViewSize(getVelocityMedian()*8) + #global_position.distance_to(Globals.getPlayer().global_position) + if Globals.getPlayer() != null: look_at(Globals.getPlayer().global_position) var direction = Vector2.RIGHT.rotated(rotation) - rotation += PI / 2 + if Globals.getPlayer() != null: + rotation += PI / 2 + + if visionArea.has_overlapping_bodies(): + if not raycast.is_colliding(): + attack() + #if getEnemyList() != []: + #for i in getEnemyList(): + ##print(global_position.distance_to(i.global_position)) + #direction -= Vector2.UP.rotated(rad_to_deg(global_position.angle_to(i.global_position))) * -10 + #break + #print(self) + #print(visionAreaEnemy.get_overlapping_bodies()) + #print(getEnemyList()) if not visionAreaStop.has_overlapping_bodies(): velocity = velocity.lerp(direction * speed, acceleration * delta) else: - if not raycast.is_colliding(): - attack() velocity = velocity.lerp(Vector2.ZERO, acceleration * delta) + move_and_slide() func _on_hurt_area_hurt(amount: int) -> void: + hit.play() damage(amount) + +func getVelocityMedian() -> float: + var _velocity = velocity + if _velocity.x < 0: + _velocity.x *= -1 + if _velocity.y < 0: + _velocity.y *= -1 + return (_velocity.x + _velocity.y) / 2 + +func getEnemyList() -> Array: + var enemies = visionAreaEnemy.get_overlapping_bodies() + enemies.erase(self) + return enemies diff --git a/scenes/spaceShip/enemy/enemy.tscn b/scenes/spaceShip/enemy/enemy.tscn index e57debc..7daa8b4 100644 --- a/scenes/spaceShip/enemy/enemy.tscn +++ b/scenes/spaceShip/enemy/enemy.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=8 format=3 uid="uid://bodpgjdjhfn4w"] +[gd_scene load_steps=11 format=3 uid="uid://bodpgjdjhfn4w"] [ext_resource type="PackedScene" uid="uid://csacin2gx2tum" path="res://scenes/spaceShip/spaceShip.tscn" id="1_5w6ng"] [ext_resource type="Script" uid="uid://djlqf2g8ho05r" path="res://scenes/spaceShip/enemy/enemy.gd" id="2_2erf0"] -[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="2_u13ds"] +[ext_resource type="Texture2D" uid="uid://dansb0wnm00vb" path="res://assets/enemy/shotgunEnemy.png" id="3_7vnn2"] +[ext_resource type="Texture2D" uid="uid://bkc8av1vbis4r" path="res://assets/enemy/enemy.png" id="3_hybmu"] [ext_resource type="PackedScene" uid="uid://k5fr6bfn6kkd" path="res://scenes/spaceShip/enemy/visionArea/visionArea.tscn" id="4_hybmu"] +[ext_resource type="Texture2D" uid="uid://mftd7366eymt" path="res://assets/enemy/minigunEnemy.png" id="4_ibucj"] +[ext_resource type="Texture2D" uid="uid://iddqk6g00rku" path="res://assets/enemy/RailgunEnemy.png" id="5_fmf0p"] +[ext_resource type="AudioStream" uid="uid://vjxm7ay4t2ju" path="res://assets/sound/hit2.wav" id="5_gid86"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_2erf0"] size = Vector2(112, 112) @@ -11,15 +15,16 @@ size = Vector2(112, 112) [sub_resource type="RectangleShape2D" id="RectangleShape2D_u13ds"] size = Vector2(112, 112) -[sub_resource type="CircleShape2D" id="CircleShape2D_hybmu"] -radius = 448.071 - [node name="Enemy" groups=["enemy"] instance=ExtResource("1_5w6ng")] -modulate = Color(1, 0, 1, 1) collision_layer = 36 -collision_mask = 35 +collision_mask = 67 script = ExtResource("2_2erf0") -speed = 700 +range = 800 +shotgunTexture = ExtResource("3_7vnn2") +minigunTexture = ExtResource("4_ibucj") +railgunTexture = ExtResource("5_fmf0p") +maxHealth = 10 +speed = 1000 [node name="CollisionShape2D" parent="." index="0"] shape = SubResource("RectangleShape2D_2erf0") @@ -28,19 +33,29 @@ shape = SubResource("RectangleShape2D_2erf0") shape = SubResource("RectangleShape2D_u13ds") [node name="Sprite2D" parent="." index="2"] -texture = ExtResource("2_u13ds") +position = Vector2(0, -24) +texture = ExtResource("3_hybmu") [node name="VisionAreas" type="Node2D" parent="." index="5"] -[node name="VisionAreaStop" parent="VisionAreas" index="0" instance=ExtResource("4_hybmu")] +[node name="VisionArea" parent="VisionAreas" index="0" instance=ExtResource("4_hybmu")] -[node name="CollisionShape2D" parent="VisionAreas/VisionAreaStop" index="0"] -shape = SubResource("CircleShape2D_hybmu") +[node name="VisionAreaStop" parent="VisionAreas" index="1" instance=ExtResource("4_hybmu")] + +[node name="VisionAreaEnemy" parent="VisionAreas" index="2" instance=ExtResource("4_hybmu")] +collision_mask = 32 [node name="RayCast2D" type="RayCast2D" parent="." index="6"] target_position = Vector2(0, -448) +collision_mask = 32 +hit_from_inside = true + +[node name="hit" type="AudioStreamPlayer2D" parent="." index="7"] +stream = ExtResource("5_gid86") [connection signal="hurt" from="hurtArea" to="." method="_on_hurt_area_hurt"] [editable path="hurtArea"] +[editable path="VisionAreas/VisionArea"] [editable path="VisionAreas/VisionAreaStop"] +[editable path="VisionAreas/VisionAreaEnemy"] diff --git a/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd new file mode 100644 index 0000000..3b78ed4 --- /dev/null +++ b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd @@ -0,0 +1,5 @@ +class_name MinigunEnemy extends "res://scenes/spaceShip/enemy/enemy.gd" + +func _ready() -> void: + changeWeapon(MINIGUN) + setVision() diff --git a/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd.uid b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd.uid new file mode 100644 index 0000000..0e61c8d --- /dev/null +++ b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd.uid @@ -0,0 +1 @@ +uid://dbxjdkvkkv5cm diff --git a/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.tscn b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.tscn new file mode 100644 index 0000000..b5e3072 --- /dev/null +++ b/scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=4 format=3 uid="uid://bydt20jefk35d"] + +[ext_resource type="PackedScene" uid="uid://bodpgjdjhfn4w" path="res://scenes/spaceShip/enemy/enemy.tscn" id="1_h0ios"] +[ext_resource type="Script" uid="uid://dbxjdkvkkv5cm" path="res://scenes/spaceShip/enemy/minigunEnemy/minigunEnemy.gd" id="2_ltdg3"] +[ext_resource type="Texture2D" uid="uid://mftd7366eymt" path="res://assets/enemy/minigunEnemy.png" id="3_ltdg3"] + +[node name="MinigunEnemy" instance=ExtResource("1_h0ios")] +script = ExtResource("2_ltdg3") + +[node name="Sprite2D" parent="." index="2"] +texture = ExtResource("3_ltdg3") + +[editable path="hurtArea"] +[editable path="VisionAreas/VisionArea"] +[editable path="VisionAreas/VisionAreaStop"] +[editable path="VisionAreas/VisionAreaEnemy"] diff --git a/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd new file mode 100644 index 0000000..c326a5b --- /dev/null +++ b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd @@ -0,0 +1,5 @@ +class_name RailgunEnemy extends "res://scenes/spaceShip/enemy/enemy.gd" + +func _ready() -> void: + changeWeapon(RAILGUN) + setVision() diff --git a/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd.uid b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd.uid new file mode 100644 index 0000000..f35ce59 --- /dev/null +++ b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd.uid @@ -0,0 +1 @@ +uid://cjge3ovdfjmdn diff --git a/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.tscn b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.tscn new file mode 100644 index 0000000..87c5aa1 --- /dev/null +++ b/scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://tvds0d2gclgg"] + +[ext_resource type="PackedScene" uid="uid://bodpgjdjhfn4w" path="res://scenes/spaceShip/enemy/enemy.tscn" id="1_0ankw"] +[ext_resource type="Script" uid="uid://cjge3ovdfjmdn" path="res://scenes/spaceShip/enemy/railgunEnemy/railgunEnemy.gd" id="2_s6fkk"] +[ext_resource type="Texture2D" uid="uid://iddqk6g00rku" path="res://assets/enemy/RailgunEnemy.png" id="3_k5wkg"] + +[node name="RailgunEnemy" instance=ExtResource("1_0ankw")] +script = ExtResource("2_s6fkk") +range = 1200 +speed = 500 + +[node name="Sprite2D" parent="." index="2"] +texture = ExtResource("3_k5wkg") + +[editable path="hurtArea"] +[editable path="VisionAreas/VisionArea"] +[editable path="VisionAreas/VisionAreaStop"] +[editable path="VisionAreas/VisionAreaEnemy"] diff --git a/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd new file mode 100644 index 0000000..e29586f --- /dev/null +++ b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd @@ -0,0 +1,6 @@ +class_name ShotgunEnemy extends "res://scenes/spaceShip/enemy/enemy.gd" + + +func _ready() -> void: + changeWeapon(SHOTGUN) + setVision() diff --git a/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd.uid b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd.uid new file mode 100644 index 0000000..b202036 --- /dev/null +++ b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd.uid @@ -0,0 +1 @@ +uid://bxd6hh53c3h4p diff --git a/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.tscn b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.tscn new file mode 100644 index 0000000..c183f2f --- /dev/null +++ b/scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://dcmfud0437rkx"] + +[ext_resource type="PackedScene" uid="uid://bodpgjdjhfn4w" path="res://scenes/spaceShip/enemy/enemy.tscn" id="1_lma5b"] +[ext_resource type="Script" uid="uid://bxd6hh53c3h4p" path="res://scenes/spaceShip/enemy/shotgunEnemy/shotgunEnemy.gd" id="2_3bd2j"] +[ext_resource type="Texture2D" uid="uid://dansb0wnm00vb" path="res://assets/enemy/shotgunEnemy.png" id="3_5lm6h"] + +[node name="ShotgunEnemy" instance=ExtResource("1_lma5b")] +script = ExtResource("2_3bd2j") +range = 400 +speed = 1200 + +[node name="Sprite2D" parent="." index="2"] +texture = ExtResource("3_5lm6h") + +[editable path="hurtArea"] +[editable path="VisionAreas/VisionArea"] +[editable path="VisionAreas/VisionAreaStop"] +[editable path="VisionAreas/VisionAreaEnemy"] diff --git a/scenes/spaceShip/enemy/visionArea/vision_area.gd b/scenes/spaceShip/enemy/visionArea/vision_area.gd index 20c1967..b7ae41d 100644 --- a/scenes/spaceShip/enemy/visionArea/vision_area.gd +++ b/scenes/spaceShip/enemy/visionArea/vision_area.gd @@ -1 +1,9 @@ class_name VisionArea extends Area2D + +@onready var collisionShape = $CollisionShape2D + +func _ready() -> void: + collisionShape.shape = CircleShape2D.new() + +func changeViewSize(size: int): + collisionShape.shape.radius = size diff --git a/scenes/spaceShip/player/Interface.gd b/scenes/spaceShip/player/Interface.gd new file mode 100644 index 0000000..b12f275 --- /dev/null +++ b/scenes/spaceShip/player/Interface.gd @@ -0,0 +1,8 @@ +extends Control + + + +func _ready() -> void: + progressBarHealth.max_value = Globals.getPlayer().maxHealthh + +func _physics_process(delta: float) -> void: diff --git a/scenes/spaceShip/player/Interface.gd.uid b/scenes/spaceShip/player/Interface.gd.uid new file mode 100644 index 0000000..ef1b4b9 --- /dev/null +++ b/scenes/spaceShip/player/Interface.gd.uid @@ -0,0 +1 @@ +uid://bgf71jqib5ck4 diff --git a/scenes/spaceShip/player/camera2d.gd b/scenes/spaceShip/player/camera2d.gd new file mode 100644 index 0000000..cd19eda --- /dev/null +++ b/scenes/spaceShip/player/camera2d.gd @@ -0,0 +1,22 @@ +extends Camera2D + +var shake_duration: float = 0.5 +var shake_magnitude: float = 10.0 +var shake_timer: float = 0.0 +var original_position: Vector2 + +func _ready(): + original_position = position + +func _process(delta: float) -> void: + if shake_timer > 0: + shake_timer -= delta + var offset = Vector2(randf_range(-shake_magnitude, shake_magnitude), randf_range(-shake_magnitude, shake_magnitude)) + position = original_position + offset + else: + position = original_position + +func shake(duration: float, magnitude: float) -> void: + shake_duration = duration + shake_magnitude = magnitude + shake_timer = shake_duration diff --git a/scenes/spaceShip/player/camera2d.gd.uid b/scenes/spaceShip/player/camera2d.gd.uid new file mode 100644 index 0000000..e23dd97 --- /dev/null +++ b/scenes/spaceShip/player/camera2d.gd.uid @@ -0,0 +1 @@ +uid://cb4i45ekmd2is diff --git a/scenes/spaceShip/player/input.gd b/scenes/spaceShip/player/input.gd new file mode 100644 index 0000000..4814c82 --- /dev/null +++ b/scenes/spaceShip/player/input.gd @@ -0,0 +1,10 @@ +extends Control + +@onready var moveButton = $MoveButton +@onready var shootButton = $ShootButton +@onready var shootButtonCorner = $ShootButtonCorner +@onready var moveButtonCorner = $MoveButtonCorner + +func _physics_process(delta: float) -> void: + shootButton.global_position = shootButtonCorner.global_position + moveButton.global_position = moveButtonCorner.global_position diff --git a/scenes/spaceShip/player/input.gd.uid b/scenes/spaceShip/player/input.gd.uid new file mode 100644 index 0000000..f1b326f --- /dev/null +++ b/scenes/spaceShip/player/input.gd.uid @@ -0,0 +1 @@ +uid://ds2moov3l1dyk diff --git a/scenes/spaceShip/player/player.gd b/scenes/spaceShip/player/player.gd index 3953c52..cff5dae 100644 --- a/scenes/spaceShip/player/player.gd +++ b/scenes/spaceShip/player/player.gd @@ -1,42 +1,178 @@ class_name Player extends "res://scenes/spaceShip/spaceShip.gd" -@onready var dashCooldown = $dashCooldown -@onready var spawnPointPool = $spawnPointPool +@onready var timeGhostScene = preload("res://scenes/spaceShip/timeGhost/timeghost.tscn") + +@onready var dashCooldown = $dashCooldown +@onready var selfHealTimer = $selfHealTimer +@onready var selfHealCountdownTimer = $selfHealCountdownTimer + +@onready var progressBarHealth = $Camera2D/CanvasLayer/Control/VBoxContainer/HealthUi/ProgressBarHealth +@onready var progressBarSpeed = $Camera2D/CanvasLayer/Control/VBoxContainer/SpeedUi/ProgressBarSpeed +@onready var progressBarDashCooldown = $Camera2D/CanvasLayer/Control/VBoxContainer/DashCooldownUi/ProgressBarDashCooldown +@onready var progressBarWeaponCooldown = $Camera2D/CanvasLayer/Control/VBoxContainer/WeaponCooldown/ProgressBarWeaponCooldown +@onready var labelWaveInfo = $Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer/LabelWaveInfo +@onready var labelWaveEnemiesInfo = $Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer2/LabelWaveEnemiesInfo +@onready var labelWaveDestroyedInfo = $Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer3/LabelWaveDestroyedInfo +@onready var upgradeChooser = $Camera2D/CanvasLayer/Control/UpgradeChooser + +@onready var hit = $hit +@onready var input = $Camera2D/CanvasLayer/Control/Input + +@export var spawnDistance: int = 5000 + +var maxSpeedMult: float = 3 +var maxAcceleration: float = 1 +var speedMult: float = 1 +var damageMult: float = 1 +var dashUnlocked: bool = false +var strifeUnlocked: bool = false +var selfHealUnlocked: bool = false -@export var spawnDistance: int = 1000 func _ready() -> void: + if Globals.touchscreen: + input.show() + progressBarHealth.max_value = maxHealth + progressBarSpeed.max_value = speed / 2 + progressBarDashCooldown.max_value = dashCooldown.wait_time randomize() - - -func _init() -> void: - pass + changeWeapon(SHOTGUN) + progressBarWeaponCooldown.max_value = weapon.cooldown + shortInvincibility() + await get_tree().create_timer(Globals.currentDelay).timeout + addGhost() + newUpgrade() + Globals.waveComplete.connect(newUpgrade) + func _physics_process(delta: float) -> void: + #if Input.is_action_pressed("attack"): + #attack() + # + #look_at(get_global_mouse_position()) + #rotation += PI / 2 + #var direction = Vector2.UP.normalized().rotated(rotation) * Input.get_action_strength("moveForward") + ##Input.get_vector("moveForward", "moveBackward").normalized().rotated(rotation) + #if Input.is_action_just_pressed("dash") and dashCooldown.is_stopped(): + #dash() + #velocity = velocity.lerp(direction * speed, acceleration * delta) + #move_and_slide() + #if timeGhost != null: + #moveTimeGhost(global_position, rotation) + if Input.is_action_pressed("attack"): attack() - - look_at(get_global_mouse_position()) + var controllerDirection = Input.get_vector("lookLeft", "lookRight", "lookForward", "lookDown") + controllerDirection + if controllerDirection == Vector2.ZERO: + look_at(get_global_mouse_position()) + else: + look_at(global_position+controllerDirection) rotation += PI / 2 - var direction = Input.get_vector("moveLeft", "moveRight", "moveForward", "moveBackward").normalized().rotated(rotation) - if Input.is_action_just_pressed("dash") and dashCooldown.is_stopped(): + var direction: Vector2 + #if strifeUnlocked: + #direction = Input.get_vector("moveLeft", "moveRight", "moveForward", "moveBackward").normalized().rotated(rotation) + if Globals.touchscreen: + if Input.is_action_pressed("touchscreenForward"): + direction = Vector2.UP.normalized().rotated(rotation) * Input.get_action_strength("touchscreenForward") + else: + direction = Vector2.UP.normalized().rotated(rotation) * Input.get_action_strength("moveForward") + if Input.is_action_just_pressed("dash") and dashCooldown.is_stopped() and dashUnlocked: dash() - velocity = velocity.lerp(direction * speed, acceleration * delta) + #if Input.is_action_pressed("moveForward") or Input.is_action_pressed("moveLeft") or Input.is_action_pressed("moveRight"): + if Input.is_action_pressed("moveForward") or Input.is_action_pressed("touchscreenForward"): + velocity = velocity.lerp(direction * speed * speedMult, 1 * delta) move_and_slide() if timeGhost != null: moveTimeGhost(global_position, rotation) - + + setInterface() func _on_hurt_area_hurt(amount: int) -> void: damage(amount) + hit.play() + $Camera2D.shake(0.5, 5.0) + if selfHealUnlocked: + selfHealTimer.stop() + selfHealCountdownTimer.start() func dash(): + shortInvincibility() dashCooldown.start() global_position += Vector2.UP.rotated(rotation) * 1000 func getRandomSpawnPointPosition() -> Vector2: var rng = RandomNumberGenerator.new() - print(deg_to_rad(rng.randi_range(0, 360))) - print(Vector2.UP.rotated(deg_to_rad(rng.randi_range(0, 360))) * spawnDistance) return global_position + Vector2.UP.rotated(deg_to_rad(rng.randi_range(0, 360))) * spawnDistance - #return spawnPointPool.get_children()[rng.randi_range(0, spawnPointPool.get_children().size()-1)].global_position + +func addGhost(): + var _timeGhost = timeGhostScene.instantiate() + get_tree().get_first_node_in_group("timeGhostPool").add_child(_timeGhost) + addTimeGhost(_timeGhost) + +func unlockDash(): + dashUnlocked = true + +func unlockStrife(): + strifeUnlocked = true + + + +func _on_self_heal_countdown_timeout() -> void: + selfHealTimer.start() + +func _on_self_heal_timer_timeout() -> void: + if health >= maxHealth: + selfHealTimer.stop() + else: + heal(1) + selfHealTimer.start() + + +func setInterface(): + if dashUnlocked: + $Camera2D/CanvasLayer/Control/VBoxContainer/DashCooldownUi.visible = true + progressBarHealth.value = Globals.getPlayer().health + progressBarSpeed.value = getVelocityMedian() + if dashCooldown.is_stopped(): + progressBarDashCooldown.value = 0 + else: + progressBarDashCooldown.value = dashCooldown.wait_time - dashCooldown.time_left + + if weapon != null: + progressBarWeaponCooldown.value = weapon.cooldownTimer.wait_time - weapon.cooldownTimer.time_left + labelWaveInfo.text = str(Globals.currentWave) + labelWaveEnemiesInfo.text = str(Globals.enemyCount) + labelWaveDestroyedInfo.text = str(Globals.destroyedShips) + +func getVelocityMedian() -> float: + var _velocity = velocity + if _velocity.x < 0: + _velocity.x *= -1 + if _velocity.y < 0: + _velocity.y *= -1 + return (_velocity.x + _velocity.y) / 2 + +func newUpgrade(): + get_tree().paused = true + upgradeChooser.showUpgrades() + +func addSpeedMult(mult: float): + if speedMult * mult > maxSpeedMult: + speedMult = maxSpeedMult + Globals.removeSpeedUPgrade() + else: + speedMult *= mult + + +func switchToMinigun(): + changeWeapon(MINIGUN) + progressBarWeaponCooldown.max_value = weapon.cooldown + +func switchToShotgun(): + changeWeapon(SHOTGUN) + progressBarWeaponCooldown.max_value = weapon.cooldown + +func switchToRailgun(): + changeWeapon(RAILGUN) + progressBarWeaponCooldown.max_value = weapon.cooldown diff --git a/scenes/spaceShip/player/player.tscn b/scenes/spaceShip/player/player.tscn index 0a82fdc..5e9d655 100644 --- a/scenes/spaceShip/player/player.tscn +++ b/scenes/spaceShip/player/player.tscn @@ -1,8 +1,21 @@ -[gd_scene load_steps=6 format=3 uid="uid://bmc2exqutt6vu"] +[gd_scene load_steps=19 format=3 uid="uid://bmc2exqutt6vu"] [ext_resource type="PackedScene" uid="uid://csacin2gx2tum" path="res://scenes/spaceShip/spaceShip.tscn" id="1_nnn47"] [ext_resource type="Script" uid="uid://0i8gdbb8f6ic" path="res://scenes/spaceShip/player/player.gd" id="2_acneu"] -[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="3_0gv45"] +[ext_resource type="Texture2D" uid="uid://cd5anydes4tv3" path="res://assets/player/shotgunShip.png" id="3_ah1lv"] +[ext_resource type="Texture2D" uid="uid://dlahm782n0awk" path="res://assets/player/minigunShip.png" id="4_1o0bm"] +[ext_resource type="Theme" uid="uid://bcbicfiflkrja" path="res://theme/interface.tres" id="4_o6j0d"] +[ext_resource type="Script" uid="uid://cb4i45ekmd2is" path="res://scenes/spaceShip/player/camera2d.gd" id="4_sk4ix"] +[ext_resource type="Texture2D" uid="uid://dhbn4acw1a6eu" path="res://assets/player/railgunShip.png" id="5_5sy6u"] +[ext_resource type="PackedScene" uid="uid://ha8undpo7d4d" path="res://scenes/upgradeChooser/upgradeChooser.tscn" id="5_nno2o"] +[ext_resource type="Texture2D" uid="uid://bwtb3m00d1gu2" path="res://assets/symbols/heart.png" id="6_sytd6"] +[ext_resource type="Texture2D" uid="uid://cmb78bi27e2jl" path="res://assets/ui/dash.png" id="7_qoa7h"] +[ext_resource type="AudioStream" uid="uid://xldfu6srikfp" path="res://assets/sound/hit.wav" id="7_sma6c"] +[ext_resource type="Script" uid="uid://ds2moov3l1dyk" path="res://scenes/spaceShip/player/input.gd" id="8_5l1u7"] +[ext_resource type="Texture2D" uid="uid://vxl26x3xc8ms" path="res://assets/ui/reload.png" id="8_48lx4"] +[ext_resource type="Texture2D" uid="uid://c0qub1plvyt4x" path="res://assets/ui/move.png" id="10_5l1u7"] +[ext_resource type="Texture2D" uid="uid://bgqfuj6p3h5ad" path="res://assets/ui/attack.png" id="11_5l1u7"] +[ext_resource type="Script" uid="uid://bqykrbwxdktxk" path="res://addons/virtual_joystick/virtual_joystick_instantiator.gd" id="13_1o0bm"] [sub_resource type="CircleShape2D" id="CircleShape2D_0gv45"] radius = 56.5685 @@ -15,7 +28,11 @@ collision_layer = 12 collision_mask = 3 motion_mode = 1 script = ExtResource("2_acneu") -spawnDistance = 1000 +spawnDistance = 5000 +shotgunTexture = ExtResource("3_ah1lv") +minigunTexture = ExtResource("4_1o0bm") +railgunTexture = ExtResource("5_5sy6u") +invincible = true [node name="CollisionShape2D" parent="." index="0"] shape = SubResource("CircleShape2D_0gv45") @@ -24,30 +41,234 @@ shape = SubResource("CircleShape2D_0gv45") shape = SubResource("RectangleShape2D_0gv45") [node name="Sprite2D" parent="." index="2"] -texture = ExtResource("3_0gv45") +position = Vector2(0, -24) [node name="dashCooldown" type="Timer" parent="." index="5"] wait_time = 10.0 one_shot = true autostart = true -[node name="Camera2D" type="Camera2D" parent="." index="6"] +[node name="selfHealTimer" type="Timer" parent="." index="6"] +one_shot = true -[node name="spawnPointPool" type="Node2D" parent="." index="7"] +[node name="selfHealCountdownTimer" type="Timer" parent="." index="7"] +wait_time = 10.0 +one_shot = true -[node name="spawnPoint" type="Marker2D" parent="spawnPointPool" index="0"] -position = Vector2(360, -176) +[node name="Camera2D" type="Camera2D" parent="." index="8"] +script = ExtResource("4_sk4ix") -[node name="spawnPoint2" type="Marker2D" parent="spawnPointPool" index="1"] -position = Vector2(392, 256) +[node name="CanvasLayer" type="CanvasLayer" parent="Camera2D" index="0"] -[node name="spawnPoint3" type="Marker2D" parent="spawnPointPool" index="2"] -position = Vector2(-416, 224) +[node name="Control" type="Control" parent="Camera2D/CanvasLayer" index="0"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("4_o6j0d") -[node name="spawnPoint4" type="Marker2D" parent="spawnPointPool" index="3"] -position = Vector2(-408, -168) +[node name="Input" type="Control" parent="Camera2D/CanvasLayer/Control" index="0"] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("8_5l1u7") + +[node name="Virtual Joystick" type="Control" parent="Camera2D/CanvasLayer/Control/Input" index="0"] +modulate = Color(1, 1, 1, 0.588235) +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -40.0 +offset_right = 40.0 +grow_vertical = 0 +scale = Vector2(2.5, 2.5) +script = ExtResource("13_1o0bm") +metadata/_custom_type_script = "uid://bqykrbwxdktxk" + +[node name="MoveButton" type="TouchScreenButton" parent="Camera2D/CanvasLayer/Control/Input" index="1"] +modulate = Color(1, 1, 1, 0.588235) +position = Vector2(1408, 576) +scale = Vector2(14, 14) +texture_normal = ExtResource("10_5l1u7") +action = "touchscreenForward" + +[node name="ShootButton" type="TouchScreenButton" parent="Camera2D/CanvasLayer/Control/Input" index="2"] +modulate = Color(1, 1, 1, 0.588235) +position = Vector2(896, 560) +scale = Vector2(14, 14) +texture_normal = ExtResource("11_5l1u7") +action = "attack" + +[node name="ShootButtonCorner" type="Control" parent="Camera2D/CanvasLayer/Control/Input" index="3"] +layout_mode = 1 +anchor_left = 0.992 +anchor_top = 0.985 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -1016.64 +offset_top = -495.8 +offset_right = -1024.0 +offset_bottom = -504.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="MoveButtonCorner" type="Control" parent="Camera2D/CanvasLayer/Control/Input" index="4"] +layout_mode = 1 +anchor_left = 0.992 +anchor_top = 0.985 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -504.64 +offset_top = -495.8 +offset_right = -512.0 +offset_bottom = -504.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="VBoxContainer" type="VBoxContainer" parent="Camera2D/CanvasLayer/Control" index="1"] +layout_mode = 1 +offset_left = 64.0 +offset_top = 64.0 +offset_right = 1096.0 +offset_bottom = 238.0 + +[node name="Weapon" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/VBoxContainer" index="0"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Camera2D/CanvasLayer/Control/VBoxContainer/Weapon" index="0"] +layout_mode = 2 + +[node name="HealthUi" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/VBoxContainer" index="1"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Camera2D/CanvasLayer/Control/VBoxContainer/HealthUi" index="0"] +layout_mode = 2 +texture = ExtResource("6_sytd6") +expand_mode = 2 + +[node name="LabelHealth" type="Label" parent="Camera2D/CanvasLayer/Control/VBoxContainer/HealthUi" index="1"] +layout_mode = 2 + +[node name="ProgressBarHealth" type="ProgressBar" parent="Camera2D/CanvasLayer/Control/VBoxContainer/HealthUi" index="2"] +modulate = Color(1, 0, 0, 1) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +theme_override_font_sizes/font_size = 0 +show_percentage = false + +[node name="SpeedUi" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/VBoxContainer" index="2"] +visible = false +layout_mode = 2 + +[node name="LabelSpeed" type="Label" parent="Camera2D/CanvasLayer/Control/VBoxContainer/SpeedUi" index="0"] +layout_mode = 2 +text = "S" + +[node name="ProgressBarSpeed" type="ProgressBar" parent="Camera2D/CanvasLayer/Control/VBoxContainer/SpeedUi" index="1"] +layout_mode = 2 +size_flags_horizontal = 3 +step = 1.0 + +[node name="DashCooldownUi" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/VBoxContainer" index="3"] +visible = false +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Camera2D/CanvasLayer/Control/VBoxContainer/DashCooldownUi" index="0"] +layout_mode = 2 +texture = ExtResource("7_qoa7h") +expand_mode = 2 + +[node name="LabelDashCooldown" type="Label" parent="Camera2D/CanvasLayer/Control/VBoxContainer/DashCooldownUi" index="1"] +layout_mode = 2 + +[node name="ProgressBarDashCooldown" type="ProgressBar" parent="Camera2D/CanvasLayer/Control/VBoxContainer/DashCooldownUi" index="2"] +modulate = Color(0, 0.172549, 1, 1) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +show_percentage = false + +[node name="WeaponCooldown" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/VBoxContainer" index="4"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="Camera2D/CanvasLayer/Control/VBoxContainer/WeaponCooldown" index="0"] +layout_mode = 2 +texture = ExtResource("8_48lx4") +expand_mode = 2 + +[node name="LabelWeaponCooldown" type="Label" parent="Camera2D/CanvasLayer/Control/VBoxContainer/WeaponCooldown" index="1"] +layout_mode = 2 + +[node name="ProgressBarWeaponCooldown" type="ProgressBar" parent="Camera2D/CanvasLayer/Control/VBoxContainer/WeaponCooldown" index="2"] +modulate = Color(0.870588, 1, 0, 1) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +show_percentage = false + +[node name="HBoxContainer" type="VBoxContainer" parent="Camera2D/CanvasLayer/Control" index="2"] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -560.0 +offset_top = 64.0 +offset_right = -61.0 +offset_bottom = 321.0 +grow_horizontal = 0 +alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/HBoxContainer" index="0"] +layout_mode = 2 +alignment = 1 + +[node name="LabelWave" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer" index="0"] +layout_mode = 2 +text = "WAVE: " + +[node name="LabelWaveInfo" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer" index="1"] +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/HBoxContainer" index="1"] +layout_mode = 2 +alignment = 1 + +[node name="LabelWaveEnemies" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer2" index="0"] +layout_mode = 2 +text = "Enemies: " + +[node name="LabelWaveEnemiesInfo" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer2" index="1"] +layout_mode = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control/HBoxContainer" index="2"] +layout_mode = 2 +alignment = 1 + +[node name="LabelWaveDestroyed" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer3" index="0"] +layout_mode = 2 +text = "Destroyed: " + +[node name="LabelWaveDestroyedInfo" type="Label" parent="Camera2D/CanvasLayer/Control/HBoxContainer/HBoxContainer3" index="1"] +layout_mode = 2 + +[node name="UpgradeChooser" parent="Camera2D/CanvasLayer/Control" index="3" instance=ExtResource("5_nno2o")] +visible = false +layout_mode = 1 + +[node name="hit" type="AudioStreamPlayer2D" parent="." index="9"] +stream = ExtResource("7_sma6c") [connection signal="hurt" from="hurtArea" to="." method="_on_hurt_area_hurt"] [connection signal="timeout" from="dashCooldown" to="." method="_on_dash_cooldown_timeout"] +[connection signal="timeout" from="selfHealTimer" to="." method="_on_self_heal_timer_timeout"] +[connection signal="timeout" from="selfHealCountdownTimer" to="." method="_on_self_heal_countdown_timeout"] [editable path="hurtArea"] diff --git a/scenes/spaceShip/spaceShip.gd b/scenes/spaceShip/spaceShip.gd index 1d87324..c1aa962 100644 --- a/scenes/spaceShip/spaceShip.gd +++ b/scenes/spaceShip/spaceShip.gd @@ -5,9 +5,21 @@ class_name Spaceship extends CharacterBody2D @onready var weaponNode = $weaponNode @onready var invincibleTimer = $invincibleTimer +@onready var MINIGUN = preload("res://scenes/weapon/minigun/minigun.tscn") +@onready var RAILGUN = preload("res://scenes/weapon/railgun/railgun.tscn") +@onready var SHOTGUN = preload("res://scenes/weapon/shotgun/shotgun.tscn") + +@onready var radiationDamageTimer = $radiationDamageTimer +@onready var radiationDamage = $radiationDamage + +@export var shotgunTexture: Texture2D +@export var minigunTexture: Texture2D +@export var railgunTexture: Texture2D + + @export var minHealth: int = 0 @export var maxHealth: int = 100 -@export var health: int = maxHealth +@onready var health: int = maxHealth @export var speed: int = 800 @export var acceleration: float = 0.8 @@ -16,23 +28,31 @@ class_name Spaceship extends CharacterBody2D @export var timeGhost: TimeGhost = null @export var weapon: Weapon = null - +var currentWeapon: PackedScene @export var invincible: bool = false +var currentRadiationDamage: int = 1 + signal destroyed +func _init() -> void: + health = maxHealth + func _ready() -> void: invincibleTimer.wait_time = Globals.currentDelay * 3 + shortInvincibility() func damage(amount: int): if not invincible: if health - amount <= minHealth: if timeGhost == null: emit_signal("destroyed") + if self.is_in_group("enemy"): + Globals.enemyDestroyed() destroy() - health = minHealth shortInvincibility() + health = maxHealth else: health -= amount @@ -44,6 +64,7 @@ func heal(amount: int): func destroy(): if timeGhost == null: + destroyed.emit() queue_free() else: timeGhost.destroy() @@ -63,19 +84,36 @@ func moveTimeGhost(_position: Vector2, _rotation: float): timeGhost.moveTimeGhost(_position, _rotation) func changeWeapon(_weapon: PackedScene): + currentWeapon = _weapon var newWeapon = _weapon.instantiate() for i in weaponNode.get_children(): i.queue_free() weaponNode.add_child(newWeapon) weapon = newWeapon + if newWeapon is Shotgun: + sprite.texture = shotgunTexture + elif newWeapon is Minigun: + sprite.texture = minigunTexture + elif newWeapon is Railgun: + sprite.texture = railgunTexture + await get_tree().create_timer(Globals.currentDelay).timeout if timeGhost != null: timeGhost.changeWeapon(_weapon) + #match newWeapon: + #Shotgun: + #sprite.texture = shotgunTexture + #Minigun: + #sprite.texture = minigunTexture + #Railgun: + #sprite.texture = railgunTexture + # func addTimeGhost(_timeGhost: TimeGhost): if timeGhost == null: timeGhost = _timeGhost timeGhost.setSpaceship(self) + timeGhost.changeWeapon(currentWeapon) else: timeGhost.addTimeGhost(_timeGhost) @@ -91,5 +129,19 @@ func _on_invincible_timer_timeout() -> void: func _on_hurt_area_area_entered(area: Area2D) -> void: if area.get_parent().is_in_group("obstacle"): - velocity = Vector2.UP.rotated(rotation) * -pushback + velocity = Vector2.UP.rotated(rad_to_deg(global_position.angle_to(area.global_position))) * -pushback area.get_parent().queue_free() + +func inceraseMaxhealth(increase: int): + maxHealth += increase + health += increase + + +func applyRadiation(amount: int): + if radiationDamageTimer.is_stopped(): + currentRadiationDamage = amount + radiationDamageTimer.start() + +func _on_radiation_damge_timer_timeout() -> void: + radiationDamage.play() + damage(currentRadiationDamage) diff --git a/scenes/spaceShip/spaceShip.tscn b/scenes/spaceShip/spaceShip.tscn index 7920b7d..16f1234 100644 --- a/scenes/spaceShip/spaceShip.tscn +++ b/scenes/spaceShip/spaceShip.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=3 uid="uid://csacin2gx2tum"] +[gd_scene load_steps=4 format=3 uid="uid://csacin2gx2tum"] [ext_resource type="Script" uid="uid://quxft75411y7" path="res://scenes/spaceShip/spaceShip.gd" id="1_a2e5l"] [ext_resource type="PackedScene" uid="uid://cglnd1ekr5u6r" path="res://scenes/areas/hurtArea/hurtArea.tscn" id="2_b8guf"] +[ext_resource type="AudioStream" uid="uid://decf2fp3ve2v8" path="res://assets/sound/radiation.wav" id="3_6p3ob"] [node name="Spaceship" type="CharacterBody2D" groups=["spaceShip"]] collision_layer = 4 @@ -19,5 +20,12 @@ script = ExtResource("1_a2e5l") one_shot = true autostart = true +[node name="radiationDamageTimer" type="Timer" parent="."] +one_shot = true + +[node name="radiationDamage" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("3_6p3ob") + [connection signal="area_entered" from="hurtArea" to="." method="_on_hurt_area_area_entered"] [connection signal="timeout" from="invincibleTimer" to="." method="_on_invincible_timer_timeout"] +[connection signal="timeout" from="radiationDamageTimer" to="." method="_on_radiation_damge_timer_timeout"] diff --git a/scenes/spaceShip/timeGhost/timeghost.gd b/scenes/spaceShip/timeGhost/timeghost.gd index c8b0348..3e2f7a8 100644 --- a/scenes/spaceShip/timeGhost/timeghost.gd +++ b/scenes/spaceShip/timeGhost/timeghost.gd @@ -1,11 +1,15 @@ class_name TimeGhost extends "res://scenes/spaceShip/spaceShip.gd" +@onready var damageArea = $DamageArea + @export var spaceShip: Spaceship = null + #func _init(_speed: int, _acceleration: float) -> void: # speed = _speed #acceleration = _acceleration + func _physics_process(delta: float) -> void: move_and_slide() @@ -15,3 +19,8 @@ func setSpaceship(_spaceShip: Spaceship): acceleration = spaceShip.acceleration global_position = spaceShip.global_position sprite.texture = spaceShip.sprite.texture + + +func _on_damage_area_area_entered(area: Area2D) -> void: + if area.get_parent().is_in_group("player"): + damageArea.damageHurtArea(area, Globals.getPlayer().maxHealth) diff --git a/scenes/spaceShip/timeGhost/timeghost.tscn b/scenes/spaceShip/timeGhost/timeghost.tscn index 625e877..4a8a60e 100644 --- a/scenes/spaceShip/timeGhost/timeghost.tscn +++ b/scenes/spaceShip/timeGhost/timeghost.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://dms0cw7opfd64"] +[gd_scene load_steps=9 format=3 uid="uid://dms0cw7opfd64"] [ext_resource type="PackedScene" uid="uid://csacin2gx2tum" path="res://scenes/spaceShip/spaceShip.tscn" id="1_bm7fr"] [ext_resource type="Script" uid="uid://m3hn5tl2nidk" path="res://scenes/spaceShip/timeGhost/timeghost.gd" id="2_57067"] [ext_resource type="PackedScene" uid="uid://eqo7k2ronf8k" path="res://scenes/areas/damageArea/damageArea.tscn" id="3_5nmba"] +[ext_resource type="Texture2D" uid="uid://cd5anydes4tv3" path="res://assets/player/shotgunShip.png" id="3_37yrs"] +[ext_resource type="Texture2D" uid="uid://dlahm782n0awk" path="res://assets/player/minigunShip.png" id="4_s1boh"] +[ext_resource type="Texture2D" uid="uid://dhbn4acw1a6eu" path="res://assets/player/railgunShip.png" id="5_1tvm6"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_5nmba"] size = Vector2(50, 50) @@ -11,23 +14,24 @@ size = Vector2(50, 50) size = Vector2(50, 50) [node name="Timeghost" groups=["timeGhost"] instance=ExtResource("1_bm7fr")] -modulate = Color(0, 1, 1, 1) +modulate = Color(0.54902, 1, 1, 0.588235) collision_layer = 20 script = ExtResource("2_57067") +shotgunTexture = ExtResource("3_37yrs") +minigunTexture = ExtResource("4_s1boh") +railgunTexture = ExtResource("5_1tvm6") invincible = true [node name="CollisionShape2D" parent="." index="0"] shape = SubResource("RectangleShape2D_5nmba") disabled = true -[node name="hurtArea" parent="." index="1"] -visible = false - [node name="DamageArea" parent="." index="4" instance=ExtResource("3_5nmba")] -damage = 10 [node name="CollisionShape2D" parent="DamageArea" index="0"] shape = SubResource("RectangleShape2D_m3s7j") -disabled = true +[connection signal="area_entered" from="DamageArea" to="." method="_on_damage_area_area_entered"] + +[editable path="hurtArea"] [editable path="DamageArea"] diff --git a/scenes/upgrade/upgrade.gd b/scenes/upgrade/upgrade.gd index 31f046f..1e1ff83 100644 --- a/scenes/upgrade/upgrade.gd +++ b/scenes/upgrade/upgrade.gd @@ -1,4 +1,9 @@ -class_name Upgrade extends Node2D +class_name Upgrade extends Node @onready var upgradeName: String = "" @onready var description: String = "" + +@export var texture: Texture2D + +func select(): + Globals.getPlayer() diff --git a/scenes/upgrade/upgrade.tscn b/scenes/upgrade/upgrade.tscn index 0af7400..373654f 100644 --- a/scenes/upgrade/upgrade.tscn +++ b/scenes/upgrade/upgrade.tscn @@ -2,7 +2,5 @@ [ext_resource type="Script" uid="uid://dww2ci11ovsub" path="res://scenes/upgrade/upgrade.gd" id="1_6bmsu"] -[node name="Upgrade" type="Node2D"] +[node name="Upgrade" type="Node"] script = ExtResource("1_6bmsu") - -[node name="Sprite2D" type="Sprite2D" parent="."] diff --git a/scenes/upgrade/upgrades/damageUpgrade.gd b/scenes/upgrade/upgrades/damageUpgrade.gd new file mode 100644 index 0000000..69fb75a --- /dev/null +++ b/scenes/upgrade/upgrades/damageUpgrade.gd @@ -0,0 +1,9 @@ +class_name DamageUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Damage Upgrade" + description = "Do 1 more Damage" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().damageMult + 1 diff --git a/scenes/upgrade/upgrades/damageUpgrade.gd.uid b/scenes/upgrade/upgrades/damageUpgrade.gd.uid new file mode 100644 index 0000000..aa30aef --- /dev/null +++ b/scenes/upgrade/upgrades/damageUpgrade.gd.uid @@ -0,0 +1 @@ +uid://bys4gyrcpf45d diff --git a/scenes/upgrade/upgrades/dashUpgrade.gd b/scenes/upgrade/upgrades/dashUpgrade.gd new file mode 100644 index 0000000..6e30d3e --- /dev/null +++ b/scenes/upgrade/upgrades/dashUpgrade.gd @@ -0,0 +1,10 @@ +class_name DashUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Dash Upgrade" + description = "Fast forward jump. Needs 30 seconds to recharge" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().dashUnlocked = true + Globals.getPlayer().dashCooldown.start() diff --git a/scenes/upgrade/upgrades/dashUpgrade.gd.uid b/scenes/upgrade/upgrades/dashUpgrade.gd.uid new file mode 100644 index 0000000..026ae55 --- /dev/null +++ b/scenes/upgrade/upgrades/dashUpgrade.gd.uid @@ -0,0 +1 @@ +uid://qjo545pmsylf diff --git a/scenes/upgrade/upgrades/heal100Upgrade.gd b/scenes/upgrade/upgrades/heal100Upgrade.gd new file mode 100644 index 0000000..e86eafb --- /dev/null +++ b/scenes/upgrade/upgrades/heal100Upgrade.gd @@ -0,0 +1,9 @@ +class_name Heal100Upgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "100% Health" + description = "Heals 100% of Health" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().heal(Globals.getPlayer().maxHealth) diff --git a/scenes/upgrade/upgrades/heal100Upgrade.gd.uid b/scenes/upgrade/upgrades/heal100Upgrade.gd.uid new file mode 100644 index 0000000..c08bfc9 --- /dev/null +++ b/scenes/upgrade/upgrades/heal100Upgrade.gd.uid @@ -0,0 +1 @@ +uid://sry2bgpo2faf diff --git a/scenes/upgrade/upgrades/heal50Upgrade.gd b/scenes/upgrade/upgrades/heal50Upgrade.gd new file mode 100644 index 0000000..77a6014 --- /dev/null +++ b/scenes/upgrade/upgrades/heal50Upgrade.gd @@ -0,0 +1,9 @@ +class_name Heal50Upgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "50% Health" + description = "Heals 50% of Health" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().heal(Globals.getPlayer().maxHealth/2) diff --git a/scenes/upgrade/upgrades/heal50Upgrade.gd.uid b/scenes/upgrade/upgrades/heal50Upgrade.gd.uid new file mode 100644 index 0000000..be71fcd --- /dev/null +++ b/scenes/upgrade/upgrades/heal50Upgrade.gd.uid @@ -0,0 +1 @@ +uid://jn86iob1b38s diff --git a/scenes/upgrade/upgrades/healthUpgrade.gd b/scenes/upgrade/upgrades/healthUpgrade.gd new file mode 100644 index 0000000..df6b399 --- /dev/null +++ b/scenes/upgrade/upgrades/healthUpgrade.gd @@ -0,0 +1,9 @@ +class_name HealthUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Increase Health" + description = "Increase the amount of health you can have by 10" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().inceraseMaxhealth(10) diff --git a/scenes/upgrade/upgrades/healthUpgrade.gd.uid b/scenes/upgrade/upgrades/healthUpgrade.gd.uid new file mode 100644 index 0000000..5539205 --- /dev/null +++ b/scenes/upgrade/upgrades/healthUpgrade.gd.uid @@ -0,0 +1 @@ +uid://dergik7pwn525 diff --git a/scenes/upgrade/upgrades/minigunUpgrade.gd b/scenes/upgrade/upgrades/minigunUpgrade.gd new file mode 100644 index 0000000..25bf95c --- /dev/null +++ b/scenes/upgrade/upgrades/minigunUpgrade.gd @@ -0,0 +1,9 @@ +class_name MinigunUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Weapon Minigun" + description = "Switch Weapon to Minigun. Shoots fast but has a little bit of spread" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().switchToMinigun() diff --git a/scenes/upgrade/upgrades/minigunUpgrade.gd.uid b/scenes/upgrade/upgrades/minigunUpgrade.gd.uid new file mode 100644 index 0000000..878f1c4 --- /dev/null +++ b/scenes/upgrade/upgrades/minigunUpgrade.gd.uid @@ -0,0 +1 @@ +uid://dtq4m3wh8ik88 diff --git a/scenes/upgrade/upgrades/railgunUpgrade.gd b/scenes/upgrade/upgrades/railgunUpgrade.gd new file mode 100644 index 0000000..6c58213 --- /dev/null +++ b/scenes/upgrade/upgrades/railgunUpgrade.gd @@ -0,0 +1,9 @@ +class_name RailgunUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Weapon Railgun" + description = "Switch Weapon to Railgun. Shoots slow but does a lot of damage and penetratres targets" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().switchToRailgun() diff --git a/scenes/upgrade/upgrades/railgunUpgrade.gd.uid b/scenes/upgrade/upgrades/railgunUpgrade.gd.uid new file mode 100644 index 0000000..be43234 --- /dev/null +++ b/scenes/upgrade/upgrades/railgunUpgrade.gd.uid @@ -0,0 +1 @@ +uid://bq5bk33u8io64 diff --git a/scenes/upgrade/upgrades/selfHealUpgrade.gd b/scenes/upgrade/upgrades/selfHealUpgrade.gd new file mode 100644 index 0000000..0dd7992 --- /dev/null +++ b/scenes/upgrade/upgrades/selfHealUpgrade.gd @@ -0,0 +1,9 @@ +class_name SelfHealUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Self Heal Upgrade" + description = "Heal yourself after not taking damage for 10 seconds. After that you Heal 1 % health every second" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().selfHealUnlocked = true diff --git a/scenes/upgrade/upgrades/selfHealUpgrade.gd.uid b/scenes/upgrade/upgrades/selfHealUpgrade.gd.uid new file mode 100644 index 0000000..ad68e07 --- /dev/null +++ b/scenes/upgrade/upgrades/selfHealUpgrade.gd.uid @@ -0,0 +1 @@ +uid://clchossmuoqbm diff --git a/scenes/upgrade/upgrades/shotgunUpgrade.gd b/scenes/upgrade/upgrades/shotgunUpgrade.gd new file mode 100644 index 0000000..108c48c --- /dev/null +++ b/scenes/upgrade/upgrades/shotgunUpgrade.gd @@ -0,0 +1,9 @@ +class_name ShotgunUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Weapon Shotgun" + description = "Switch Weapon to Shotgun. Good on short range. Shoots multiple bullets with spread" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().switchToShotgun() diff --git a/scenes/upgrade/upgrades/shotgunUpgrade.gd.uid b/scenes/upgrade/upgrades/shotgunUpgrade.gd.uid new file mode 100644 index 0000000..f8cbab1 --- /dev/null +++ b/scenes/upgrade/upgrades/shotgunUpgrade.gd.uid @@ -0,0 +1 @@ +uid://bg61she3fkmn6 diff --git a/scenes/upgrade/upgrades/speedUpgrade.gd b/scenes/upgrade/upgrades/speedUpgrade.gd new file mode 100644 index 0000000..238fbba --- /dev/null +++ b/scenes/upgrade/upgrades/speedUpgrade.gd @@ -0,0 +1,11 @@ +class_name SpeedUpgrade extends "res://scenes/upgrade/upgrade.gd" + +@export var damage: int = 1 + +func _init() -> void: + upgradeName = "Speed Upgrade" + description = "Increase speed by 10%" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().addSpeedMult(1.1) diff --git a/scenes/upgrade/upgrades/speedUpgrade.gd.uid b/scenes/upgrade/upgrades/speedUpgrade.gd.uid new file mode 100644 index 0000000..3e5af56 --- /dev/null +++ b/scenes/upgrade/upgrades/speedUpgrade.gd.uid @@ -0,0 +1 @@ +uid://cww4y13d7o6wk diff --git a/scenes/upgrade/upgrades/strafeUpgrade.gd b/scenes/upgrade/upgrades/strafeUpgrade.gd new file mode 100644 index 0000000..c134e55 --- /dev/null +++ b/scenes/upgrade/upgrades/strafeUpgrade.gd @@ -0,0 +1,9 @@ +class_name StrafeUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Strafe Upgrade" + description = "Move Left and Right" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().strifeUnlocked = true diff --git a/scenes/upgrade/upgrades/strafeUpgrade.gd.uid b/scenes/upgrade/upgrades/strafeUpgrade.gd.uid new file mode 100644 index 0000000..0b01aed --- /dev/null +++ b/scenes/upgrade/upgrades/strafeUpgrade.gd.uid @@ -0,0 +1 @@ +uid://cp8ig5ipckooe diff --git a/scenes/upgrade/upgrades/timeGhostUpgrade.gd b/scenes/upgrade/upgrades/timeGhostUpgrade.gd new file mode 100644 index 0000000..968c9be --- /dev/null +++ b/scenes/upgrade/upgrades/timeGhostUpgrade.gd @@ -0,0 +1,9 @@ +class_name TimeGhostUpgrade extends "res://scenes/upgrade/upgrade.gd" + +func _init() -> void: + upgradeName = "Add Timeghost" + description = "Adds A Timeghost which repeats all actions you make. Acts as an extra life in case you get destroyed" + +func select(): + if Globals.getPlayer() != null: + Globals.getPlayer().addGhost() diff --git a/scenes/upgrade/upgrades/timeGhostUpgrade.gd.uid b/scenes/upgrade/upgrades/timeGhostUpgrade.gd.uid new file mode 100644 index 0000000..6de7e85 --- /dev/null +++ b/scenes/upgrade/upgrades/timeGhostUpgrade.gd.uid @@ -0,0 +1 @@ +uid://frqtmtgoe3l2 diff --git a/scenes/upgradeChooser/choice/choice.gd b/scenes/upgradeChooser/choice/choice.gd new file mode 100644 index 0000000..936ea12 --- /dev/null +++ b/scenes/upgradeChooser/choice/choice.gd @@ -0,0 +1,17 @@ +class_name Choice extends MarginContainer + +@onready var nameLabel = $VBoxContainer/nameLabel +@onready var description = $VBoxContainer/description + +var option: int + +signal selected(_option: int) + +func setValues(_text: String, _description: String, _option: int) -> void: + nameLabel.text = _text + description.text = _description + option = _option + +func _on_button_pressed() -> void: + get_tree().paused = false + selected.emit(option) diff --git a/scenes/upgradeChooser/choice/choice.gd.uid b/scenes/upgradeChooser/choice/choice.gd.uid new file mode 100644 index 0000000..3e3a31c --- /dev/null +++ b/scenes/upgradeChooser/choice/choice.gd.uid @@ -0,0 +1 @@ +uid://dcgxmxoarxn0v diff --git a/scenes/upgradeChooser/choice/choice.tscn b/scenes/upgradeChooser/choice/choice.tscn new file mode 100644 index 0000000..c4ec7b4 --- /dev/null +++ b/scenes/upgradeChooser/choice/choice.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=2 format=3 uid="uid://cr7q4nm5daxmt"] + +[ext_resource type="Script" uid="uid://dcgxmxoarxn0v" path="res://scenes/upgradeChooser/choice/choice.gd" id="1_ovap3"] + +[node name="choice" type="MarginContainer"] +process_mode = 3 +anchors_preset = -1 +anchor_right = 0.0659583 +anchor_bottom = 0.177963 +offset_right = 1.35999 +offset_bottom = -0.200005 +size_flags_horizontal = 3 +script = ExtResource("1_ovap3") +metadata/_edit_use_anchors_ = true + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 2 +alignment = 1 + +[node name="nameLabel" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "test" + +[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] +layout_mode = 2 + +[node name="description" type="RichTextLabel" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +text = "test" +fit_content = true + +[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"] +layout_mode = 2 + +[node name="Button" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Select" + +[connection signal="pressed" from="VBoxContainer/Button" to="." method="_on_button_pressed"] diff --git a/scenes/upgradeChooser/upgradeChooser.gd b/scenes/upgradeChooser/upgradeChooser.gd new file mode 100644 index 0000000..12d34a9 --- /dev/null +++ b/scenes/upgradeChooser/upgradeChooser.gd @@ -0,0 +1,45 @@ +extends Control + +@onready var choice = preload("res://scenes/upgradeChooser/choice/choice.tscn") + +@onready var choiceContainer = $CenterContainer/VBoxContainer/ChoiceContainer + +@onready var select = $select + +func _ready() -> void: + randomize() + + +func showUpgrades(): + show() + + for i in choiceContainer.get_children(): + i.queue_free() + var selectableUpgrades = getRandomUpgrades(3) + for i in selectableUpgrades: + addChoice(i) + + +func getRandomUpgrades(amount: int) -> Array[int]: + var selectableUpgrades: Array[int] + var rng = RandomNumberGenerator.new() + for i in range(0, amount): + var choice: int = rng.randi_range(0, Globals.getUpgrades().size()-1) + if choice in selectableUpgrades: + choice = rng.randi_range(0, Globals.getUpgrades().size()-1) + selectableUpgrades.append(choice) + return selectableUpgrades + +func addChoice(option: int): + var _choice: Choice = choice.instantiate() + choiceContainer.add_child(_choice) + _choice.setValues(Globals.getUpgrade(option).upgradeName, Globals.getUpgrade(option).description, option) + _choice.selected.connect(choose) + +func choose(option: int): + select.play() + var test = StrafeUpgrade.new() + Globals.getUpgrade(option).select() + if Globals.getUpgrade(option) is DashUpgrade or Globals.getUpgrade(option) is StrafeUpgrade or Globals.getUpgrade(option) is SelfHealUpgrade: + Globals.removeUpgrade(option) + hide() diff --git a/scenes/upgradeChooser/upgradeChooser.gd.uid b/scenes/upgradeChooser/upgradeChooser.gd.uid new file mode 100644 index 0000000..dd9974a --- /dev/null +++ b/scenes/upgradeChooser/upgradeChooser.gd.uid @@ -0,0 +1 @@ +uid://l4hm6nxyte6r diff --git a/scenes/upgradeChooser/upgradeChooser.tscn b/scenes/upgradeChooser/upgradeChooser.tscn new file mode 100644 index 0000000..36b0edc --- /dev/null +++ b/scenes/upgradeChooser/upgradeChooser.tscn @@ -0,0 +1,46 @@ +[gd_scene load_steps=3 format=3 uid="uid://ha8undpo7d4d"] + +[ext_resource type="Script" uid="uid://l4hm6nxyte6r" path="res://scenes/upgradeChooser/upgradeChooser.gd" id="1_6njr4"] +[ext_resource type="AudioStream" uid="uid://bspgis3hy5scl" path="res://assets/sound/upgrade.wav" id="3_xdubl"] + +[node name="UpgradeChooser" type="Control"] +process_mode = 3 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_6njr4") + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 0.333333) + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 +text = "Upgrades" + +[node name="ChoiceContainer" type="GridContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 +columns = 6 + +[node name="select" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("3_xdubl") diff --git a/scenes/weapon/minigun/minigun.gd b/scenes/weapon/minigun/minigun.gd index c58fa8d..27b90b3 100644 --- a/scenes/weapon/minigun/minigun.gd +++ b/scenes/weapon/minigun/minigun.gd @@ -4,11 +4,12 @@ class_name Minigun extends "res://scenes/weapon/weapon.gd" func attack(): if cooldownTimer.is_stopped(): - print(getSpread()) + shoot.play() spawnBullet() cooldownTimer.start(cooldown) func spawnBullet(): - var newBullet = bullet.instantiate() - get_tree().get_first_node_in_group("bulletPool").add_child(newBullet) + var newBullet: Bullet = bullet.instantiate() newBullet.spawn(bulletPoint.global_position, get_parent().get_parent().rotation + getSpread(), damage, range, penetration) + newBullet.fromTimeGhost = get_parent().get_parent().is_in_group("timeGhost") + get_tree().get_first_node_in_group("bulletPool").add_child(newBullet) diff --git a/scenes/weapon/railgun/railgun.gd b/scenes/weapon/railgun/railgun.gd index 0a452aa..fd7e580 100644 --- a/scenes/weapon/railgun/railgun.gd +++ b/scenes/weapon/railgun/railgun.gd @@ -4,11 +4,12 @@ class_name Railgun extends "res://scenes/weapon/weapon.gd" func attack(): if cooldownTimer.is_stopped(): + shoot.play() spawnBullet() cooldownTimer.start(cooldown) func spawnBullet(): - var newBullet = bullet.instantiate() - newBullet.spawn(bulletPoint.global_position, get_parent().get_parent().rotation, damage, penetration) - + var newBullet: Bullet = bullet.instantiate() + newBullet.spawn(bulletPoint.global_position, get_parent().get_parent().rotation, damage, penetration, bulletSpeed) + newBullet.fromTimeGhost = get_parent().get_parent().is_in_group("timeGhost") get_tree().get_first_node_in_group("bulletPool").add_child(newBullet) diff --git a/scenes/weapon/railgun/railgun.tscn b/scenes/weapon/railgun/railgun.tscn index 65aaf5a..23aa59c 100644 --- a/scenes/weapon/railgun/railgun.tscn +++ b/scenes/weapon/railgun/railgun.tscn @@ -5,9 +5,10 @@ [node name="Railgun" instance=ExtResource("1_lb4uk")] script = ExtResource("2_ur8td") -damage = 10 -cooldown = 10.0 +damage = 20 +cooldown = 5.0 penetration = 5 +bulletSpeed = 50.0 [node name="cooldownTimer" parent="." index="0"] wait_time = 10.0 diff --git a/scenes/weapon/shotgun/shotgun.gd b/scenes/weapon/shotgun/shotgun.gd index 743c2e0..0eff789 100644 --- a/scenes/weapon/shotgun/shotgun.gd +++ b/scenes/weapon/shotgun/shotgun.gd @@ -6,13 +6,13 @@ class_name Shotgun extends "res://scenes/weapon/weapon.gd" func attack(): if cooldownTimer.is_stopped(): + shoot.play() spawnBullet() cooldownTimer.start(cooldown) func spawnBullet(): - var rng = RandomNumberGenerator.new() - for i in range(0, bulletAmount): var newBullet = bullet.instantiate() newBullet.spawn(bulletPoint.global_position, get_parent().get_parent().rotation + getSpread(), damage, range, penetration) + newBullet.fromTimeGhost = get_parent().get_parent().is_in_group("timeGhost") get_tree().get_first_node_in_group("bulletPool").add_child(newBullet) diff --git a/scenes/weapon/weapon.gd b/scenes/weapon/weapon.gd index eb56148..744382a 100644 --- a/scenes/weapon/weapon.gd +++ b/scenes/weapon/weapon.gd @@ -3,13 +3,17 @@ class_name Weapon extends Node2D @onready var bulletPoint = $BulletPoint @onready var cooldownTimer = $cooldownTimer +@onready var shoot = $shoot + @export var damage: int = 1 @export var cooldown: float = 0.1 @export var penetration: int = 1 @export var spread: float = 0.1 @export var range: float = 8.0 +@export var bulletSpeed: float = 10 func attack(): + shoot.play() randomize() if cooldownTimer.is_stopped(): cooldownTimer.start(cooldown) diff --git a/scenes/weapon/weapon.tscn b/scenes/weapon/weapon.tscn index b4e47b2..8c5966e 100644 --- a/scenes/weapon/weapon.tscn +++ b/scenes/weapon/weapon.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://btyuxgfn12p1y"] +[gd_scene load_steps=3 format=3 uid="uid://btyuxgfn12p1y"] [ext_resource type="Script" uid="uid://dpfc01642pwq0" path="res://scenes/weapon/weapon.gd" id="1_l3xq3"] +[ext_resource type="AudioStream" uid="uid://bi2ee654gcg2y" path="res://assets/sound/shooot2.wav" id="2_jej8l"] [node name="Weapon" type="Node2D" groups=["weapon"]] script = ExtResource("1_l3xq3") @@ -10,3 +11,7 @@ one_shot = true [node name="BulletPoint" type="Marker2D" parent="."] position = Vector2(0, -128) + +[node name="shoot" type="AudioStreamPlayer2D" parent="."] +position = Vector2(0, -128) +stream = ExtResource("2_jej8l") diff --git a/theme/button/button.tres b/theme/button/button.tres new file mode 100644 index 0000000..ebc101d --- /dev/null +++ b/theme/button/button.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://b5kn7cf3fs6nc"] + +[ext_resource type="Texture2D" uid="uid://bmc50277gb4iw" path="res://assets/ui/button.png" id="1_lbjx8"] + +[resource] +texture = ExtResource("1_lbjx8") +texture_margin_left = 8.0 +texture_margin_top = 8.0 +texture_margin_right = 8.0 +texture_margin_bottom = 8.0 diff --git a/theme/interface.tres b/theme/interface.tres new file mode 100644 index 0000000..bf8c5bd --- /dev/null +++ b/theme/interface.tres @@ -0,0 +1,16 @@ +[gd_resource type="Theme" load_steps=2 format=3 uid="uid://bcbicfiflkrja"] + +[ext_resource type="StyleBox" uid="uid://b5kn7cf3fs6nc" path="res://theme/button/button.tres" id="1_gwktd"] + +[resource] +default_font_size = 60 +Button/styles/focus = ExtResource("1_gwktd") +Button/styles/hover = ExtResource("1_gwktd") +Button/styles/normal = ExtResource("1_gwktd") +Button/styles/pressed = ExtResource("1_gwktd") +MarginContainer/constants/margin_bottom = 20 +MarginContainer/constants/margin_left = 20 +MarginContainer/constants/margin_right = 20 +MarginContainer/constants/margin_top = 20 +ProgressBar/styles/background = ExtResource("1_gwktd") +RichTextLabel/font_sizes/normal_font_size = 40 diff --git a/theme/ui.tres b/theme/ui.tres new file mode 100644 index 0000000..8849614 --- /dev/null +++ b/theme/ui.tres @@ -0,0 +1,3 @@ +[gd_resource type="Theme" format=3 uid="uid://cle5s6bx7q4fa"] + +[resource]