A little cleanup
This commit is contained in:
parent
1cb2c7ebdb
commit
bedeee894a
15 changed files with 21 additions and 124 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://16xqvcrmuga6"]
|
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://16xqvcrmuga6"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://daojdy0tpvsoh" path="res://sprites/items_icons/energy.png" id="1_1ocvl"]
|
[ext_resource type="Texture2D" uid="uid://daojdy0tpvsoh" path="res://sprites/items_icons/energy.png" id="1_1ocvl"]
|
||||||
[ext_resource type="Script" path="res://scripts/item.gd" id="1_wdaj0"]
|
[ext_resource type="Script" path="res://scripts/Classes/item.gd" id="1_wdaj0"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_wdaj0")
|
script = ExtResource("1_wdaj0")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://dlnl6w416qylo"]
|
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://dlnl6w416qylo"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dlh6eyywjrsk4" path="res://sprites/items_icons/raw_materials.png" id="1_an4j4"]
|
[ext_resource type="Texture2D" uid="uid://dlh6eyywjrsk4" path="res://sprites/items_icons/raw_materials.png" id="1_an4j4"]
|
||||||
[ext_resource type="Script" path="res://scripts/item.gd" id="1_l7wcw"]
|
[ext_resource type="Script" path="res://scripts/Classes/item.gd" id="1_l7wcw"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_l7wcw")
|
script = ExtResource("1_l7wcw")
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://bii3yrhoqcket"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c3gei46k8muk3" path="res://sprites/Ships/Parts/laserbox.png" id="1_e5k7o"]
|
|
||||||
[ext_resource type="Script" path="res://scripts/item.gd" id="1_s7nhb"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dbwvej0c5bl52" path="res://sprites/ship mk1.png" id="2_l1qse"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_s7nhb")
|
|
||||||
name = "Test Item"
|
|
||||||
description = "This is an debug item"
|
|
||||||
min_price = 10.0
|
|
||||||
max_price = 100.0
|
|
||||||
weight = 10.0
|
|
||||||
icon = ExtResource("1_e5k7o")
|
|
||||||
image = ExtResource("2_l1qse")
|
|
||||||
type = 0
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://b4jy8uknltolk"]
|
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://b4jy8uknltolk"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cova10yh1rlk1" path="res://sprites/items_icons/water.png" id="1_fv1u8"]
|
[ext_resource type="Texture2D" uid="uid://cova10yh1rlk1" path="res://sprites/items_icons/water.png" id="1_fv1u8"]
|
||||||
[ext_resource type="Script" path="res://scripts/item.gd" id="1_w7v0g"]
|
[ext_resource type="Script" path="res://scripts/Classes/item.gd" id="1_w7v0g"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_w7v0g")
|
script = ExtResource("1_w7v0g")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://djmoij5kuou3j"]
|
[gd_scene load_steps=3 format=3 uid="uid://djmoij5kuou3j"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/objects/projectile.gd" id="1_6nacn"]
|
[ext_resource type="Script" path="res://scripts/Ship/projectile.gd" id="1_6nacn"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mo2if"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mo2if"]
|
||||||
size = Vector2(4, 32)
|
size = Vector2(4, 32)
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ offset_top = 6.0
|
||||||
offset_right = 1280.0
|
offset_right = 1280.0
|
||||||
offset_bottom = 29.0
|
offset_bottom = 29.0
|
||||||
theme = ExtResource("5_ag247")
|
theme = ExtResource("5_ag247")
|
||||||
|
theme_override_font_sizes/font_size = 16
|
||||||
text = "cosmic {version}"
|
text = "cosmic {version}"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
script = SubResource("GDScript_4yoh5")
|
script = SubResource("GDScript_4yoh5")
|
||||||
|
|
|
||||||
|
|
@ -77,31 +77,32 @@ func _process(_delta):
|
||||||
## Sets dock state to Ready
|
## Sets dock state to Ready
|
||||||
func dock_ready():
|
func dock_ready():
|
||||||
dock_state = DockState.Ready
|
dock_state = DockState.Ready
|
||||||
gate_static.visible = true
|
enable_gate()
|
||||||
gate_static.process_mode = Node.PROCESS_MODE_INHERIT
|
|
||||||
gate_area.visible = false
|
|
||||||
dock_area.visible = false
|
|
||||||
## Sets dock state to Process
|
## Sets dock state to Process
|
||||||
func dock_process():
|
func dock_process():
|
||||||
dock_state = DockState.Process
|
dock_state = DockState.Process
|
||||||
gate_static.visible = false
|
disable_gate()
|
||||||
gate_static.process_mode = Node.PROCESS_MODE_DISABLED
|
|
||||||
gate_area.visible = true
|
|
||||||
dock_area.visible = true
|
|
||||||
## Sets dock state to Busy
|
## Sets dock state to Busy
|
||||||
func dock_busy():
|
func dock_busy():
|
||||||
dock_state = DockState.Busy
|
dock_state = DockState.Busy
|
||||||
gate_static.visible = true
|
enable_gate()
|
||||||
gate_static.process_mode = Node.PROCESS_MODE_INHERIT
|
|
||||||
gate_area.visible = false
|
|
||||||
dock_area.visible = false
|
|
||||||
# opening base menu
|
# opening base menu
|
||||||
var menu_instance = menu.instantiate()
|
var menu_instance = menu.instantiate()
|
||||||
menu_instance.base = self
|
menu_instance.base = self
|
||||||
player_ship.non_colorable_gui.add_child(menu_instance)
|
player_ship.non_colorable_gui.add_child(menu_instance)
|
||||||
|
|
||||||
|
## Sets dock state to Leave
|
||||||
func dock_leave():
|
func dock_leave():
|
||||||
dock_state = DockState.Leave
|
dock_state = DockState.Leave
|
||||||
|
disable_gate()
|
||||||
|
|
||||||
|
func enable_gate():
|
||||||
|
gate_static.visible = true
|
||||||
|
gate_static.process_mode = Node.PROCESS_MODE_INHERIT
|
||||||
|
gate_area.visible = false
|
||||||
|
dock_area.visible = false
|
||||||
|
|
||||||
|
func disable_gate():
|
||||||
gate_static.visible = false
|
gate_static.visible = false
|
||||||
gate_static.process_mode = Node.PROCESS_MODE_DISABLED
|
gate_static.process_mode = Node.PROCESS_MODE_DISABLED
|
||||||
gate_area.visible = true
|
gate_area.visible = true
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ class_name Game
|
||||||
|
|
||||||
## TODO: rewrite item system
|
## TODO: rewrite item system
|
||||||
|
|
||||||
enum ITEM_TYPE {VALUABLE, WEAPON, HULL, SHIELD, ENGINE, AMMUNITION}
|
enum ItemType {Valuable, Weapon, Hull, Shield, Engine, Ammunition}
|
||||||
enum AMMO_TYPE {NULL, LASER_ENERGY, ROCKETS}
|
enum AmmoType {None, LaserEnergy, Rockets}
|
||||||
enum BASE_TYPE {POWER, MINING, FOOD, TRADING, MODULE}
|
enum BaseType {Power, Mining, Food, Trading, Module}
|
||||||
enum Faction {None, Player, Peaceful, Neutral, Aggressive}
|
enum Faction {None, Player, Peaceful, Neutral, Aggressive}
|
||||||
|
|
||||||
#const DEFAULT_ITEM = preload("res://items/test_item.tres")
|
#const DEFAULT_ITEM = preload("res://items/test_item.tres")
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ var target : Node2D = self
|
||||||
func _ready():
|
func _ready():
|
||||||
get_tree().create_timer(lifetime).timeout.connect(queue_free)
|
get_tree().create_timer(lifetime).timeout.connect(queue_free)
|
||||||
collider.body_entered.connect(_on_collision)
|
collider.body_entered.connect(_on_collision)
|
||||||
areyouready()
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if rotation_speed == 0: destination_angle = global_rotation_degrees
|
if rotation_speed == 0: destination_angle = global_rotation_degrees
|
||||||
|
|
@ -43,6 +42,3 @@ func _on_collision(body):
|
||||||
if target != self:
|
if target != self:
|
||||||
target.queue_free()
|
target.queue_free()
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
func areyouready():
|
|
||||||
pass
|
|
||||||
|
|
@ -39,8 +39,6 @@ func _ready():
|
||||||
else:
|
else:
|
||||||
# or add it to root node lol
|
# or add it to root node lol
|
||||||
add_child(pause_controller)
|
add_child(pause_controller)
|
||||||
|
|
||||||
|
|
||||||
pause_controller.visible = false
|
pause_controller.visible = false
|
||||||
|
|
||||||
## Pause the game. Remember to unpause it when switching scenes!
|
## Pause the game. Remember to unpause it when switching scenes!
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
extends Area2D
|
|
||||||
|
|
||||||
@export var menu : PackedScene
|
|
||||||
@onready var base_collider = $"../BaseCollider/BaseColliderDetector"
|
|
||||||
var menu_inst
|
|
||||||
var ship_in_menu = false
|
|
||||||
|
|
||||||
func onbcbodyentered(body):
|
|
||||||
if body is MainShip:
|
|
||||||
body.engine.speed = 0
|
|
||||||
|
|
||||||
func _input(event):
|
|
||||||
if event is InputEventKey and ship_in_menu:
|
|
||||||
if Input.is_action_just_released("hide_menu"):
|
|
||||||
menu_inst.visible = !menu_inst.visible
|
|
||||||
|
|
||||||
func _on_body_entered(body):
|
|
||||||
if body is MainShip:
|
|
||||||
ship_in_menu = true
|
|
||||||
body.allow_shooting = false
|
|
||||||
menu_inst = menu.instantiate()
|
|
||||||
menu_inst.modulate = get_parent().material.get_shader_parameter('color')
|
|
||||||
menu_inst.base = get_parent()
|
|
||||||
body.find_child("GUI").add_child(menu_inst)
|
|
||||||
body.minimap.visible = false
|
|
||||||
if body.quest.type == Quest.TYPE.DELIVERY:
|
|
||||||
if body.quest.data['destination'] == get_parent():
|
|
||||||
body.quest.do_progress()
|
|
||||||
|
|
||||||
func _on_body_exited(body):
|
|
||||||
if body is MainShip:
|
|
||||||
body.allow_shooting = true
|
|
||||||
body.minimap.visible = true
|
|
||||||
menu_inst.queue_free()
|
|
||||||
ship_in_menu = false
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
extends Control
|
|
||||||
|
|
||||||
@onready var ship = $"../../.."
|
|
||||||
|
|
||||||
func _on_unpause_button_button_up():
|
|
||||||
get_tree().current_scene.unpause()
|
|
||||||
|
|
||||||
|
|
||||||
func _on_exit_button_button_up():
|
|
||||||
get_tree().current_scene.unpause()
|
|
||||||
Game.profile_save(get_tree().current_scene)
|
|
||||||
get_tree().change_scene_to_file("res://scenes/MainMenu.tscn")
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
extends Line2D
|
|
||||||
|
|
||||||
@onready var ship = $"../../.."
|
|
||||||
var engine
|
|
||||||
var rdy = false
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
get_tree().create_timer(0.05).timeout.connect(is_rdy)
|
|
||||||
|
|
||||||
func is_rdy():
|
|
||||||
rdy = true
|
|
||||||
engine = ship.engine
|
|
||||||
|
|
||||||
func _process(_delta):
|
|
||||||
if !rdy:
|
|
||||||
return
|
|
||||||
engine = ship.engine
|
|
||||||
var speed_percentage : float = engine.speed / engine.max_speed * 100
|
|
||||||
var new_points = [Vector2.ZERO, Vector2(speed_percentage, 0)]
|
|
||||||
points = PackedVector2Array(new_points)
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
extends GPUParticles2D
|
|
||||||
|
|
||||||
@onready var engine = $".."
|
|
||||||
|
|
||||||
func _process(_delta):
|
|
||||||
var speed_percentage = engine.speed / engine.max_speed if engine.ship is MainShip else 0
|
|
||||||
emitting = speed_percentage > 1
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
extends Label
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
text = "GammaCosmicRays version {version}".format({"version" : Game.gameversion})
|
|
||||||
if OS.has_feature("editor"):
|
|
||||||
text += " uncompiled\nThis is a debug/prerelease version."
|
|
||||||
else:
|
|
||||||
if Game.beta:
|
|
||||||
text += " beta\nThis is a closed beta version."
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue