more work on the 240p ui

This commit is contained in:
2025-10-27 01:25:15 +11:00
parent 0de868c796
commit a411be74aa
39 changed files with 597 additions and 2975 deletions

View File

@@ -21,8 +21,9 @@ msdf_pixel_range=8
msdf_size=48 msdf_size=48
allow_system_fallback=true allow_system_fallback=true
force_autohinter=false force_autohinter=false
modulate_color_glyphs=false
hinting=1 hinting=1
subpixel_positioning=4 subpixel_positioning=0
keep_rounding_remainders=true keep_rounding_remainders=true
oversampling=0.0 oversampling=0.0
Fallbacks=null Fallbacks=null
@@ -33,7 +34,8 @@ preload=[{
"chars": [], "chars": [],
"glyphs": [], "glyphs": [],
"name": "New Configuration", "name": "New Configuration",
&"size": Vector2i(8, 0) &"size": Vector2i(8, 0),
&"variation_embolden": 0.0
}] }]
language_support={} language_support={}
script_support={} script_support={}

View File

@@ -20,13 +20,10 @@ scene = ExtResource("3_tyyee")
icon = ExtResource("2_tyyee") icon = ExtResource("2_tyyee")
death_sprite = ExtResource("1_r8gpy") death_sprite = ExtResource("1_r8gpy")
sprite = SubResource("AtlasTexture_n6kdu") sprite = SubResource("AtlasTexture_n6kdu")
spawn_power = 10
health = 180 health = 180
penalty = 10
movement_speed = 1.5 movement_speed = 1.5
spawn_cooldown = 1.2 spawn_cooldown = 1.2
common_group = 6 common_group = 6
common_cost = 1
uncommon_group = 10 uncommon_group = 10
uncommon_cost = 2 uncommon_cost = 2
rare_group = 16 rare_group = 16

View File

@@ -15,9 +15,11 @@ dest_files=["res://.godot/imported/Gun Thing.glb-346cc6d756ff806bd7662c149c6ed8f
nodes/root_type="" nodes/root_type=""
nodes/root_name="" nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true nodes/apply_root_scale=true
nodes/root_scale=1.0 nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/generate_lods=true meshes/generate_lods=true
@@ -32,10 +34,14 @@ animation/trimming=false
animation/remove_immutable_tracks=true animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false animation/import_rest_as_RESET=false
import_script/path="" import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={ _subresources={
"materials": { "materials": {
"Material": { "Material": {
"use_external/enabled": true, "use_external/enabled": true,
"use_external/fallback_path": "res://Weapons/Assault/weapon_material.tres",
"use_external/path": "uid://bjdi4f801k0xt" "use_external/path": "uid://bjdi4f801k0xt"
} }
} }

Binary file not shown.

View File

@@ -600,6 +600,24 @@ msgstr "Heavy Rounds"
msgid "FEATURE_NAME_EXTENDED_BARREL" msgid "FEATURE_NAME_EXTENDED_BARREL"
msgstr "Extended Barrel" msgstr "Extended Barrel"
msgid "TITLE_REMIX"
msgstr "T.O.W.E.R. Editor"
msgid "LABEL_TOWER_TRACK"
msgstr "Turret Track"
msgid "LABEL_WEAPON_TRACK"
msgstr "Weapon Track"
msgid "TITLE_SAMPLES"
msgstr "Sample Library"
msgid "BUTTON_CONFIRM_REMIX"
msgstr "REMIX"
msgid "PROMPT_REMIX_INTERACT"
msgstr "%Interact% Remix Cassette"
#, fuzzy #, fuzzy
#~| msgid "LABEL_DISPLAY_NAME" #~| msgid "LABEL_DISPLAY_NAME"
#~ msgid "LABEL_CARD_NAME" #~ msgid "LABEL_CARD_NAME"

View File

@@ -563,3 +563,21 @@ msgstr ""
msgid "FEATURE_NAME_EXTENDED_BARREL" msgid "FEATURE_NAME_EXTENDED_BARREL"
msgstr "" msgstr ""
msgid "TITLE_REMIX"
msgstr ""
msgid "LABEL_TOWER_TRACK"
msgstr ""
msgid "LABEL_WEAPON_TRACK"
msgstr ""
msgid "TITLE_SAMPLES"
msgstr ""
msgid "BUTTON_CONFIRM_REMIX"
msgstr ""
msgid "PROMPT_REMIX_INTERACT"
msgstr ""

View File

@@ -60,7 +60,6 @@ func process_state(_delta: float) -> void:
func swap_to_slot(num: int) -> void: func swap_to_slot(num: int) -> void:
if hero.unique_cards.size() >= num: if hero.hand.size >= num:
hero.hand_selected_index = num - 1 hero.hand_selected_index = num - 1
hero.swap_card_audio.play() hero.swap_card_audio.play()
hero.update_selected_box()

View File

@@ -41,8 +41,6 @@ signal ready_state_changed(state: bool)
var current_state: HeroState var current_state: HeroState
var pre_fighting_state: HeroState var pre_fighting_state: HeroState
var selection_boxes: Array[CardSelectionBox] = []
var unique_cards: Array[Card] = []
var hand_card_scene: PackedScene = preload("res://Scenes/UI/card_hand.tscn") var hand_card_scene: PackedScene = preload("res://Scenes/UI/card_hand.tscn")
var card_sprites: Array[CardInHand] var card_sprites: Array[CardInHand]
var game_manager: GameManager var game_manager: GameManager
@@ -81,7 +79,7 @@ var selected_card: Card :
set(_value): set(_value):
pass pass
get(): get():
return unique_cards[hand_selected_index] if unique_cards.size() > 0 else null return hand.item_at(hand_selected_index) if hand.size > 0 else null
func set_zoom_factor(value: float) -> void: func set_zoom_factor(value: float) -> void:
@@ -99,7 +97,6 @@ func _ready() -> void:
draw_pile.add(card) draw_pile.add(card)
else: else:
add_card(card) add_card(card)
update_selected_box()
else: else:
camera.set_visible(false) camera.set_visible(false)
gun_camera.set_visible(false) gun_camera.set_visible(false)
@@ -132,44 +129,6 @@ func exit_fighting_state() -> void:
update_state(pre_fighting_state) update_state(pre_fighting_state)
func add_selection(card: Card) -> void:
if !unique_cards.has(card):
unique_cards.append(card)
var box: CardSelectionBox = card_select_scene.instantiate()
box.set_card(card)
box.set_key(unique_cards.size() - 1)
box.set_amount(1)
selection_boxes.append(box)
$HUD/selection_boxes.add_child(box)
else:
var box: CardSelectionBox
for existing_box: CardSelectionBox in selection_boxes:
if existing_box.card == card:
box = existing_box
box.set_amount(hand.contents.count(card))
func check_removal() -> void:
var index: int = -1
for card: Card in unique_cards:
if !hand.contents.has(card):
index = unique_cards.find(card)
for i: int in selection_boxes.size():
selection_boxes[i].set_amount(hand.contents.count(unique_cards[i]))
if index >= 0:
unique_cards.remove_at(index)
selection_boxes[index].queue_free()
selection_boxes.remove_at(index)
if selection_boxes.size() > 0:
for i: int in selection_boxes.size():
var card: Card = unique_cards[i]
selection_boxes[i].set_card(card)
selection_boxes[i].set_key(i)
if hand_selected_index == index:
decrement_selected()
update_selected_box()
func _physics_process(_delta: float) -> void: func _physics_process(_delta: float) -> void:
if !is_multiplayer_authority() or paused: if !is_multiplayer_authority() or paused:
return return
@@ -223,24 +182,25 @@ func check_world_button() -> void:
func increment_selected() -> void: func increment_selected() -> void:
hand_selected_index += 1 hand_selected_index += 1
if hand_selected_index >= unique_cards.size(): if hand_selected_index >= hand.size:
hand_selected_index = 0 hand_selected_index = 0
update_selected_box()
func decrement_selected() -> void: func decrement_selected() -> void:
if unique_cards.size() == 0: if hand.size == 0:
hand_selected_index = 0 hand_selected_index = 0
return return
hand_selected_index -= 1 hand_selected_index -= 1
if hand_selected_index < 0: if hand_selected_index < 0:
hand_selected_index = unique_cards.size() - 1 hand_selected_index = hand.size - 1
update_selected_box()
func set_card_elements_visibility(value: bool) -> void: func set_card_elements_visibility(value: bool) -> void:
if value:
hud.show_hot_wheel()
else:
hud.hide_hot_wheel()
$FirstPersonViewport/Head2/LeftHand.visible = value $FirstPersonViewport/Head2/LeftHand.visible = value
$HUD/selection_boxes.visible = value
$HUD/PlaceIcon.visible = value $HUD/PlaceIcon.visible = value
$HUD/SwapIcon.visible = value $HUD/SwapIcon.visible = value
if cards[0]: if cards[0]:
@@ -270,7 +230,6 @@ func ready_self() -> void:
hud.swap_icon.set_visible(false) hud.swap_icon.set_visible(false)
hud.shrink_wave_start_label() hud.shrink_wave_start_label()
ready_audio.play() ready_audio.play()
networked_set_ready_state.rpc(ready_state)
func unready_self() -> void: func unready_self() -> void:
@@ -278,14 +237,12 @@ func unready_self() -> void:
ready_state = false ready_state = false
hud.grow_wave_start_label() hud.grow_wave_start_label()
unready_audio.play() unready_audio.play()
networked_set_ready_state(ready_state)
func add_card(new_card: Card) -> void: func add_card(new_card: Card) -> void:
hand.add(new_card) hand.add(new_card)
hud.pickup(new_card) hud.pickup(new_card)
place_card_audio.play() place_card_audio.play()
add_selection(new_card)
func unpause() -> void: func unpause() -> void:
@@ -322,37 +279,11 @@ func draw_to_hand_size() -> void:
display.position = Vector3(0.01 * hand.size, 0.0, -0.001 * hand.size) display.position = Vector3(0.01 * hand.size, 0.0, -0.001 * hand.size)
display.rotation_degrees = Vector3(0.0, 0.0, -10.0 * hand.size) display.rotation_degrees = Vector3(0.0, 0.0, -10.0 * hand.size)
$FirstPersonViewport/Head2/LeftHand/Cards.add_child(display) $FirstPersonViewport/Head2/LeftHand/Cards.add_child(display)
#var tween: Tween = create_tween()
#tween.set_ease(Tween.EASE_OUT)
#tween.set_trans(Tween.TRANS_CUBIC)
#tween.tween_property(display, "position", Vector2(200.0 * hand.size, 80.0), 0.5)
else: else:
for x: int in discard_pile.size: for x: int in discard_pile.size:
draw_pile.add(discard_pile.remove_at(0)) draw_pile.add(discard_pile.remove_at(0))
draw_pile.shuffle() draw_pile.shuffle()
unique_cards = []
selection_boxes = []
for card: Card in hand.contents:
if !unique_cards.has(card):
unique_cards.append(card)
for i: int in $HUD/selection_boxes.get_child_count():
$HUD/selection_boxes.get_child(i).queue_free()
for i: int in unique_cards.size():
var card: Card = unique_cards[i]
var box: CardSelectionBox = card_select_scene.instantiate()
box.set_card(card)
box.set_key(i)
box.set_amount(hand.contents.count(unique_cards[i]))
selection_boxes.append(box)
$HUD/selection_boxes.add_child(box)
hand_selected_index = 0 hand_selected_index = 0
update_selected_box()
func update_selected_box() -> void:
for box: CardSelectionBox in selection_boxes:
box.deselect()
selection_boxes[hand_selected_index].select()
func equip_weapon(slot: int = 0) -> void: func equip_weapon(slot: int = 0) -> void:
@@ -381,7 +312,6 @@ func equip_weapon(slot: int = 0) -> void:
weapons[slot].stats = cards[slot].weapon_stats weapons[slot].stats = cards[slot].weapon_stats
weapons[slot].name = str(weapons_spawn_count) weapons[slot].name = str(weapons_spawn_count)
weapons[slot].duration = 1 weapons[slot].duration = 1
networked_equip_weapon.rpc(Data.cards.find(cards[slot]), 0, weapons_spawn_count)
weapons_spawn_count += 1 weapons_spawn_count += 1
weapons[slot].set_multiplayer_authority(multiplayer.get_unique_id()) weapons[slot].set_multiplayer_authority(multiplayer.get_unique_id())
gauntlet_cards[slot].set_card(cards[slot]) gauntlet_cards[slot].set_card(cards[slot])
@@ -394,7 +324,6 @@ func equip_weapon(slot: int = 0) -> void:
weapons[slot].set_hero(self) weapons[slot].set_hero(self)
weapons[slot].visible = false weapons[slot].visible = false
right_hand.add_child(weapons[slot]) right_hand.add_child(weapons[slot])
check_removal()
if slot == 0: if slot == 0:
weapons[slot].energy_spent.connect(hud.new_energy_bar.use_energy) weapons[slot].energy_spent.connect(hud.new_energy_bar.use_energy)
weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_energy) weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_energy)
@@ -458,7 +387,6 @@ func _on_timer_timeout() -> void:
func unequip_weapon(slot: int = 0) -> void: func unequip_weapon(slot: int = 0) -> void:
networked_unequip_weapon.rpc(slot)
gauntlet_cards[slot].visible = false gauntlet_cards[slot].visible = false
if slot == 0: if slot == 0:
hud.place_icon.visible = true hud.place_icon.visible = true
@@ -472,33 +400,3 @@ func unequip_weapon(slot: int = 0) -> void:
add_card(cards[slot]) add_card(cards[slot])
cards[slot] = null cards[slot] = null
place_card_audio.play() place_card_audio.play()
#MULTIPLAYER NETWORKED FUNCTIONS
@rpc("reliable")
func networked_set_ready_state(state: bool) -> void:
ready_state = state
@rpc("reliable")
func networked_swap_weapon() -> void:
swap_weapons()
@rpc("reliable")
func networked_equip_weapon(card_index: int, slot: int, id: int) -> void:
var new_card: Card = Data.cards[card_index]
var new_weapon: Weapon = new_card.weapon_scene.instantiate()
new_weapon.set_multiplayer_authority(multiplayer.get_remote_sender_id())
new_weapon.name = str(id)
new_weapon.set_hero(self)
right_hand.add_child(new_weapon)
cards[slot] = new_card
weapons[slot] = new_weapon
@rpc("reliable")
func networked_unequip_weapon(slot: int) -> void:
weapons[slot].queue_free()
weapons[slot] = null
cards[slot] = null

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=68 format=3 uid="uid://dxgxbtf68lcv5"] [gd_scene load_steps=69 format=3 uid="uid://dxgxbtf68lcv5"]
[ext_resource type="Script" uid="uid://1fqpoegbdm6n" path="res://PCs/hero.gd" id="1_pihpe"] [ext_resource type="Script" uid="uid://1fqpoegbdm6n" path="res://PCs/hero.gd" id="1_pihpe"]
[ext_resource type="Resource" uid="uid://b5pc3frhx467q" path="res://Classes/Engineer/class.tres" id="2_dbyo0"] [ext_resource type="Resource" uid="uid://b5pc3frhx467q" path="res://Classes/Engineer/class.tres" id="2_dbyo0"]
@@ -38,6 +38,7 @@
[ext_resource type="AudioStream" uid="uid://val5n418yebw" path="res://Audio/cardSlide3.ogg" id="30_djhlg"] [ext_resource type="AudioStream" uid="uid://val5n418yebw" path="res://Audio/cardSlide3.ogg" id="30_djhlg"]
[ext_resource type="Texture2D" uid="uid://up7omskwg0yx" path="res://Assets/Textures/battery.png" id="30_rim6q"] [ext_resource type="Texture2D" uid="uid://up7omskwg0yx" path="res://Assets/Textures/battery.png" id="30_rim6q"]
[ext_resource type="AudioStream" uid="uid://ck6g061w7i6ro" path="res://Audio/cardSlide4.ogg" id="31_546e6"] [ext_resource type="AudioStream" uid="uid://ck6g061w7i6ro" path="res://Audio/cardSlide4.ogg" id="31_546e6"]
[ext_resource type="PackedScene" uid="uid://ga21hoa8fxmm" path="res://hot_wheel.tscn" id="31_h1yfy"]
[ext_resource type="AudioStream" uid="uid://bj8eitlsjdotb" path="res://Audio/cardSlide5.ogg" id="32_tg7y0"] [ext_resource type="AudioStream" uid="uid://bj8eitlsjdotb" path="res://Audio/cardSlide5.ogg" id="32_tg7y0"]
[ext_resource type="AudioStream" uid="uid://d0620p56ad34a" path="res://Audio/cardSlide6.ogg" id="33_2v5co"] [ext_resource type="AudioStream" uid="uid://d0620p56ad34a" path="res://Audio/cardSlide6.ogg" id="33_2v5co"]
[ext_resource type="AudioStream" uid="uid://uvoxbl1fbtu0" path="res://Audio/cardSlide7.ogg" id="34_6acmc"] [ext_resource type="AudioStream" uid="uid://uvoxbl1fbtu0" path="res://Audio/cardSlide7.ogg" id="34_6acmc"]
@@ -320,7 +321,7 @@ max_look_up_angle = 80.0
enable_jumping = true enable_jumping = true
weapon_holder = NodePath("../FirstPersonViewport/Head2/RightHand") weapon_holder = NodePath("../FirstPersonViewport/Head2/RightHand")
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar", "energy_label", "blank_cassette_label")] [node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar", "energy_label", "blank_cassette_label", "feature_preview", "hot_wheel")]
script = ExtResource("8_yl6ka") script = ExtResource("8_yl6ka")
player = NodePath("..") player = NodePath("..")
wave_count = NodePath("EnemyTracker/WaveCount") wave_count = NodePath("EnemyTracker/WaveCount")
@@ -344,6 +345,8 @@ enemy_card_scene = ExtResource("18_dfkac")
new_energy_bar = NodePath("EnergyBar") new_energy_bar = NodePath("EnergyBar")
energy_label = NodePath("Currencies/HBoxContainer/EnergyLabel") energy_label = NodePath("Currencies/HBoxContainer/EnergyLabel")
blank_cassette_label = NodePath("Currencies/BlankCassetteLabel") blank_cassette_label = NodePath("Currencies/BlankCassetteLabel")
feature_preview = NodePath("FeaturePreview")
hot_wheel = NodePath("HotWheel")
[node name="FirstPersonCam" type="TextureRect" parent="HUD"] [node name="FirstPersonCam" type="TextureRect" parent="HUD"]
anchors_preset = 15 anchors_preset = 15
@@ -715,25 +718,6 @@ texture = ExtResource("26_dfkac")
expand_mode = 3 expand_mode = 3
stretch_mode = 5 stretch_mode = 5
[node name="selection_boxes" type="HBoxContainer" parent="HUD"]
anchors_preset = -1
anchor_left = 0.05
anchor_top = 0.8
anchor_right = 0.2
anchor_bottom = 0.8
grow_vertical = 0
mouse_filter = 2
alignment = 1
[node name="Control" parent="HUD/selection_boxes" instance=ExtResource("5_h82f6")]
layout_mode = 2
[node name="Control2" parent="HUD/selection_boxes" instance=ExtResource("5_h82f6")]
layout_mode = 2
[node name="Control3" parent="HUD/selection_boxes" instance=ExtResource("5_h82f6")]
layout_mode = 2
[node name="Currencies" type="VBoxContainer" parent="HUD"] [node name="Currencies" type="VBoxContainer" parent="HUD"]
anchors_preset = -1 anchors_preset = -1
anchor_left = 0.95 anchor_left = 0.95
@@ -779,6 +763,26 @@ layout_mode = 2
horizontal_alignment = 2 horizontal_alignment = 2
vertical_alignment = 1 vertical_alignment = 1
[node name="HotWheel" parent="HUD" instance=ExtResource("31_h1yfy")]
visible = false
anchors_preset = -1
anchor_left = 0.5
anchor_top = 0.893
anchor_right = 0.5
anchor_bottom = 0.893
grow_horizontal = 2
grow_vertical = 0
[node name="FeaturePreview" type="HBoxContainer" parent="HUD"]
anchors_preset = -1
anchor_top = 0.6
anchor_right = 1.0
anchor_bottom = 0.8
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
alignment = 1
[node name="WeaponSwapTimer" type="Timer" parent="."] [node name="WeaponSwapTimer" type="Timer" parent="."]
wait_time = 0.4 wait_time = 0.4
one_shot = true one_shot = true

View File

@@ -26,11 +26,14 @@ extends CanvasLayer
@export var primary_duration: Label @export var primary_duration: Label
@export var secondary_duration: Label @export var secondary_duration: Label
@export var blank_cassette_label: Label @export var blank_cassette_label: Label
@export var feature_preview: HBoxContainer
@export var hot_wheel: HotWheel
var last_lives_count: int = 120 var last_lives_count: int = 120
var enemy_names: Array[String] var enemy_names: Array[String]
var map_anchor: Node3D var map_anchor: Node3D
var cards: Array[EnemyCardUI] = [] var cards: Array[EnemyCardUI] = []
var feature_preview_tween: Tween
func _ready() -> void: func _ready() -> void:
@@ -40,6 +43,14 @@ func _ready() -> void:
energy_label.visible = true energy_label.visible = true
func show_hot_wheel() -> void:
hot_wheel.visible = true
func hide_hot_wheel() -> void:
hot_wheel.visible = false
func set_blank_cassette_count(value: int) -> void: func set_blank_cassette_count(value: int) -> void:
blank_cassette_label.text = str(value) blank_cassette_label.text = str(value)
@@ -87,6 +98,33 @@ func _process(_delta: float) -> void:
swap_text.text = parse_action_tag("[center]%Secondary Fire%") swap_text.text = parse_action_tag("[center]%Secondary Fire%")
func show_features(cassette: Card) -> void:
for child: Node in feature_preview.get_children():
child.queue_free()
var cols: int = max(cassette.tower_stats.features.size(), cassette.weapon_stats.features.size())
for x: int in cols:
var vbox: VBoxContainer = VBoxContainer.new()
vbox.alignment = BoxContainer.ALIGNMENT_END
if x < cassette.tower_stats.features.size():
vbox.alignment = BoxContainer.ALIGNMENT_BEGIN
var tex: TextureRect = TextureRect.new()
tex.texture = cassette.tower_stats.features[x].icon
vbox.add_child(tex)
if x < cassette.weapon_stats.features.size():
var tex: TextureRect = TextureRect.new()
tex.texture = cassette.weapon_stats.features[x].icon
vbox.add_child(tex)
feature_preview.add_child(vbox)
if feature_preview_tween:
feature_preview_tween.kill()
feature_preview_tween = create_tween()
feature_preview_tween.set_ease(Tween.EASE_OUT)
feature_preview_tween.set_trans(Tween.TRANS_CUBIC)
feature_preview.modulate = Color.WHITE
feature_preview_tween.tween_interval(0.7)
feature_preview_tween.tween_property(feature_preview, "modulate", Color8(255, 255, 255, 0), 0.5)
func grow_wave_start_label() -> void: func grow_wave_start_label() -> void:
tween_label(300.0) tween_label(300.0)
@@ -209,6 +247,7 @@ func minimize_minimap() -> void:
func pickup(card: Card) -> void: func pickup(card: Card) -> void:
hot_wheel.add_cassette(card)
var notif: PickupNotification = pickup_notif_scene.instantiate() var notif: PickupNotification = pickup_notif_scene.instantiate()
notif.set_card(card) notif.set_card(card)
$VBoxContainer.add_child(notif) $VBoxContainer.add_child(notif)

View File

@@ -38,13 +38,11 @@ cull_mask = 1047553
fov = 39.4 fov = 39.4
[node name="PanelContainer" type="PanelContainer" parent="." node_paths=PackedStringArray("tower_label_container", "hero_name_label")] [node name="PanelContainer" type="PanelContainer" parent="." node_paths=PackedStringArray("tower_label_container", "hero_name_label")]
anchors_preset = 4 anchors_preset = -1
anchor_left = 0.05
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.05
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = 100.0
offset_top = -91.5
offset_right = 299.0
offset_bottom = 91.5
grow_vertical = 2 grow_vertical = 2
script = ExtResource("9_8d0rx") script = ExtResource("9_8d0rx")
tower_label_scene = ExtResource("10_jdigy") tower_label_scene = ExtResource("10_jdigy")
@@ -61,26 +59,18 @@ text = "character name"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="Label2" type="Label" parent="PanelContainer/HBoxContainer2"] [node name="HSeparator" type="HSeparator" parent="PanelContainer/HBoxContainer2"]
auto_translate_mode = 2
layout_mode = 2 layout_mode = 2
text = "------------------------"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HBoxContainer" type="VBoxContainer" parent="PanelContainer/HBoxContainer2"] [node name="HBoxContainer" type="VBoxContainer" parent="PanelContainer/HBoxContainer2"]
layout_mode = 2 layout_mode = 2
[node name="Controls" type="VBoxContainer" parent="."] [node name="Controls" type="VBoxContainer" parent="."]
anchors_preset = 7 anchors_preset = -1
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 1.0 anchor_top = 0.95
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 1.0 anchor_bottom = 0.95
offset_left = -20.0
offset_top = -40.0
offset_right = 20.0
offset_bottom = -150.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0

View File

@@ -29,26 +29,13 @@ region = Rect2(0, 0, 32, 32)
[sub_resource type="Resource" id="Resource_sv1gy"] [sub_resource type="Resource" id="Resource_sv1gy"]
resource_local_to_scene = true resource_local_to_scene = true
script = ExtResource("5_u514r") script = ExtResource("5_u514r")
title = "dog"
target_type = 1 target_type = 1
icon = ExtResource("7_2sylv") icon = ExtResource("7_2sylv")
death_sprite = ExtResource("6_rsxwm") death_sprite = ExtResource("6_rsxwm")
sprite = SubResource("AtlasTexture_74epv") sprite = SubResource("AtlasTexture_74epv")
spawn_power = 10
health = 180 health = 180
penalty = 10
movement_speed = 1.2 movement_speed = 1.2
spawn_cooldown = 1.2 spawn_cooldown = 1.2
common_group = 1
common_cost = 1
uncommon_group = 1
uncommon_cost = 1
rare_group = 1
rare_cost = 1
epic_group = 1
epic_cost = 1
legendary_group = 1
legendary_cost = 1
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2jyua"] [sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2jyua"]
random_pitch = 1.1 random_pitch = 1.1
@@ -198,6 +185,7 @@ text = "LABEL_SEED"
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
placeholder_text = "LABEL_SEED_PLACEHOLDER" placeholder_text = "LABEL_SEED_PLACEHOLDER"
expand_to_text_length = true
[node name="ProfileManager" type="PanelContainer" parent="."] [node name="ProfileManager" type="PanelContainer" parent="."]
visible = false visible = false
@@ -233,6 +221,7 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
placeholder_text = "LABEL_DISPLAY_NAME_PLACEHOLDER" placeholder_text = "LABEL_DISPLAY_NAME_PLACEHOLDER"
alignment = 1 alignment = 1
expand_to_text_length = true
[node name="Stats" type="VBoxContainer" parent="ProfileManager/VBoxContainer"] [node name="Stats" type="VBoxContainer" parent="ProfileManager/VBoxContainer"]
layout_mode = 2 layout_mode = 2
@@ -434,15 +423,11 @@ expand_icon = true
[node name="ModsMenu" type="PanelContainer" parent="."] [node name="ModsMenu" type="PanelContainer" parent="."]
visible = false visible = false
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = -1
anchor_left = 0.5 anchor_left = 0.05
anchor_top = 0.5 anchor_top = 0.05
anchor_right = 0.5 anchor_right = 0.95
anchor_bottom = 0.5 anchor_bottom = 0.95
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("19_6t4jd") script = ExtResource("19_6t4jd")
@@ -457,8 +442,8 @@ horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="ModsMenu/VBoxContainer"] [node name="ScrollContainer" type="ScrollContainer" parent="ModsMenu/VBoxContainer"]
custom_minimum_size = Vector2(800, 400)
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="ModsMenu/VBoxContainer/ScrollContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="ModsMenu/VBoxContainer/ScrollContainer"]
layout_mode = 2 layout_mode = 2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 390 B

View File

@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/extended_barrel_icon.png-1c0812e89e02473dd178
compress/mode=0 compress/mode=0
compress/high_quality=false compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1 compress/hdr_compression=1
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
@@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1 mipmaps/limit=-1
roughness/mode=0 roughness/mode=0
roughness/src_normal="" roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/normal_map_invert_y=false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 388 B

View File

@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/HeavyRounds_icon.png-ce2bc40148089de1cb95a58f
compress/mode=0 compress/mode=0
compress/high_quality=false compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1 compress/hdr_compression=1
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
@@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1 mipmaps/limit=-1
roughness/mode=0 roughness/mode=0
roughness/src_normal="" roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/normal_map_invert_y=false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

After

Width:  |  Height:  |  Size: 401 B

View File

@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/radar_icon.png-3ea7bb6ea2b253a4a5535d5dd7d115
compress/mode=0 compress/mode=0
compress/high_quality=false compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1 compress/hdr_compression=1
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
@@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1 mipmaps/limit=-1
roughness/mode=0 roughness/mode=0
roughness/src_normal="" roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/normal_map_invert_y=false

View File

@@ -13,6 +13,7 @@ signal switch_to_single_player
signal switch_to_multi_player signal switch_to_multi_player
signal switch_to_main_menu signal switch_to_main_menu
var root_scene: Node
var level_scene: PackedScene = load("res://Worlds/GreenPlanet/Levels/Bridge/bridge.tscn") var level_scene: PackedScene = load("res://Worlds/GreenPlanet/Levels/Bridge/bridge.tscn")
var player_scene: PackedScene = load("res://PCs/hero.tscn") var player_scene: PackedScene = load("res://PCs/hero.tscn")
var game_end_scene: PackedScene = load("res://Scenes/Menus/GameEndScreen/game_end_screen.tscn") var game_end_scene: PackedScene = load("res://Scenes/Menus/GameEndScreen/game_end_screen.tscn")
@@ -40,7 +41,7 @@ var connected_player_profiles: Dictionary = {}
func _ready() -> void: func _ready() -> void:
UILayer = CanvasLayer.new() UILayer = CanvasLayer.new()
UILayer.layer = 2 UILayer.layer = 2
get_tree().root.add_child.call_deferred(UILayer) root_scene.add_child.call_deferred(UILayer)
var version_label: Label = Label.new() var version_label: Label = Label.new()
var version: String = ProjectSettings.get_setting("application/config/version") var version: String = ProjectSettings.get_setting("application/config/version")
version_label.text = "WORK IN PROGRESS | ALPHA - VERSION " + version + " | PLAYTEST" version_label.text = "WORK IN PROGRESS | ALPHA - VERSION " + version + " | PLAYTEST"
@@ -114,7 +115,7 @@ func spawn_level() -> void:
x.enemy_died_callback = enemy_died x.enemy_died_callback = enemy_died
x.enemy_reached_goal_callback = damage_goal x.enemy_reached_goal_callback = damage_goal
x.enemy_spawned.connect(increase_enemy_count) x.enemy_spawned.connect(increase_enemy_count)
add_child(level) root_scene.add_child(level)
func spawn_players() -> void: func spawn_players() -> void:
@@ -141,7 +142,7 @@ func spawn_players() -> void:
wave_started.connect(player.enter_fighting_state) wave_started.connect(player.enter_fighting_state)
wave_finished.connect(player.exit_fighting_state) wave_finished.connect(player.exit_fighting_state)
base_took_damage.connect(player.hud.set_lives_count) base_took_damage.connect(player.hud.set_lives_count)
add_child(player) root_scene.add_child(player)
p_i += 1 p_i += 1
level.cinematic_cam.does_its_thing = false level.cinematic_cam.does_its_thing = false

File diff suppressed because one or more lines are too long

View File

@@ -15,9 +15,11 @@ dest_files=["res://.godot/imported/bridge.glb-8a57eeddb9b299ef3c8dd1f0a8ff0656.s
nodes/root_type="" nodes/root_type=""
nodes/root_name="" nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true nodes/apply_root_scale=true
nodes/root_scale=1.0 nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/generate_lods=true meshes/generate_lods=true
@@ -32,18 +34,24 @@ animation/trimming=false
animation/remove_immutable_tracks=true animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false animation/import_rest_as_RESET=false
import_script/path="" import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={ _subresources={
"materials": { "materials": {
"Dirt": { "Dirt": {
"use_external/enabled": true, "use_external/enabled": true,
"use_external/fallback_path": "res://Worlds/GreenPlanet/Levels/Bridge/mat13.tres",
"use_external/path": "uid://bjr7u7ixxokw6" "use_external/path": "uid://bjr7u7ixxokw6"
}, },
"Grass": { "Grass": {
"use_external/enabled": true, "use_external/enabled": true,
"use_external/fallback_path": "res://Worlds/GreenPlanet/Levels/Bridge/mat2.tres",
"use_external/path": "uid://jdg8tb7g3d4o" "use_external/path": "uid://jdg8tb7g3d4o"
}, },
"Stone": { "Stone": {
"use_external/enabled": true, "use_external/enabled": true,
"use_external/fallback_path": "res://Worlds/GreenPlanet/Levels/Bridge/mat1.tres",
"use_external/path": "uid://bajfn46md8pyy" "use_external/path": "uid://bajfn46md8pyy"
} }
} }

View File

@@ -3,10 +3,10 @@
[sub_resource type="FastNoiseLite" id="FastNoiseLite_lxu40"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_lxu40"]
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pnl7j"] [sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pnl7j"]
seamless = true
seamless_blend_skirt = 0.247
as_normal_map = true
noise = SubResource("FastNoiseLite_lxu40") noise = SubResource("FastNoiseLite_lxu40")
seamless = true
as_normal_map = true
seamless_blend_skirt = 0.247
[resource] [resource]
albedo_color = Color(0.347817, 0.347817, 0.347817, 1) albedo_color = Color(0.347817, 0.347817, 0.347817, 1)

View File

@@ -5,9 +5,9 @@
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ah5r4"] [sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ah5r4"]
width = 256 width = 256
height = 256 height = 256
noise = SubResource("FastNoiseLite_mrvo6")
seamless = true seamless = true
as_normal_map = true as_normal_map = true
noise = SubResource("FastNoiseLite_mrvo6")
[resource] [resource]
albedo_color = Color(0.207653, 0.448041, 0.223187, 1) albedo_color = Color(0.207653, 0.448041, 0.223187, 1)

View File

@@ -52,7 +52,6 @@ func place_card(tower_base: TowerBase) -> void:
return return
remove_card(tower_base) remove_card(tower_base)
hero.hand.remove_at(hero.hand.contents.find(card)) hero.hand.remove_at(hero.hand.contents.find(card))
hero.check_removal()
tower_base.add_card(card, multiplayer.get_unique_id()) tower_base.add_card(card, multiplayer.get_unique_id())
hero.place_card_audio.play() hero.place_card_audio.play()
if hero.game_manager.card_gameplay: if hero.game_manager.card_gameplay:

340
crt_harrison.gdshader Normal file
View File

@@ -0,0 +1,340 @@
// CRT Shader by Harrison Allen
// V4
shader_type canvas_item;
/**
The input texture that will have the CRT effect applied to it.
Scanline count will be determined by this texture's height.
You'll need to use a texture that's roughly screen height / 4.5
(for instance 240 on a 1080 monitor or 480 on a 4k monitor)
Else The scanlines won't properly resolve and you're get moiré patters.
*/
uniform sampler2D tex: filter_linear;
/**
Set the type of mask this CRT will have.
Dots: emulates a typical PC CRT monitor.
Grille: emulates an aperture grille. Good with higher curve values.
Wide Grille: more suitable for 4k monitors.
Soft Grille: very close to wide grille, but a little softer.
Slot mask: this is the pattern found on most TVs, but it can clash with the
scanlines unless the input texture resolution is halved.
*/
uniform int mask_type : hint_enum(
"Dots:1",
"Aperture Grille:2",
"Wide Grille:3",
"Wide Soft Grille:4",
"Slot Mask:5",
"Null:0") = 1;
uniform float curve : hint_range(0.0, 0.5) = 0.0;
/**
Controls how sharp the image is. Low values are fun with dithering, but a
value of 0.5 will destroy high frequency details and render small text
illegible. Use with care.
*/
uniform float sharpness : hint_range(0.5, 1.0) = 0.6666666666666666666666666667;
/**
Use to offset color channels from each other. I've personally observed this
effect in real CRTs. It can go in either direction, and some CRTs are better
aligned than others.
I'd suggest offsetting this at least a little bit from the default value.
Note that because of the typical RGB subpixel layout on on LCD, a very small
positive value will actually align colors better (it depends on
screen size), and -0.5 is just slightly more misaligned than 0.5, which is
important if you want to be as misaligned as possible.
*/
uniform float color_offset : hint_range(-0.5, 0.5) = 0.0;
/**
Reduce to preserve phosphor mask details in highlights at the cost of
overall brightness. This should usually be kept at or near 1
*/
uniform float mask_brightness : hint_range(0, 1) = 1.0;
/**
Reduce to preserve scanline details in highlights at the cost of
overall brightness. This should usually be kept at or near 1
*/
uniform float scanline_brightness : hint_range(0.5, 1.0) = 1.0;
/**
Raising this value can help reduce Moiré patterns.
A value of 1 will eliminate scanlines entirely.
*/
uniform float min_scanline_thickness : hint_range(0.25, 1.0) = 0.5;
/**
This should be the input texture's height divided by width.
Only important if curve is used.
For 16:9, this should be 0.5625.
*/
uniform float aspect : hint_range(0.5, 1.0) = 0.75;
/**
This controls slight horizontal shaking. This is set to 0 (off) by default.
*/
uniform float wobble_strength : hint_range(0.0, 1.0) = 0.0;
varying flat float wobble;
void vertex()
{
wobble = cos(TIME * TAU * 15.0) * wobble_strength / 8192.0;
}
vec2 warp(vec2 uv, float _aspect, float _curve)
{
// Centralize coordinates
uv -= 0.5;
uv.x /= _aspect;
// Squared distance from the middle
float warping = dot(uv, uv) * _curve;
// Compensate for shrinking
warping -= _curve * 0.25;
// Warp the coordinates
uv /= 1.0 - warping;
uv.x *= _aspect;
// Decentralize the coordinates
uv += 0.5;
return uv;
}
vec3 linear_to_srgb(vec3 col)
{
return mix(
(pow(col, vec3(1.0 / 2.4)) * 1.055) - 0.055,
col * 12.92,
lessThan(col, vec3(0.0031318))
);
}
vec3 srgb_to_linear(vec3 col)
{
return mix(
pow((col + 0.055) / 1.055, vec3(2.4)),
col / 12.92,
lessThan(col, vec3(0.04045))
);
}
// Get scanlines from coordinates (returns in linear color)
vec3 scanlines(vec2 uv)
{
// Set coordinates to match texture dimensions
uv *= vec2(textureSize(tex, 0));
// Vertical coordinate scanline samples
int y = int(uv.y + 0.5) - 1;
float x = floor(uv.x);
// Horizontal coordinates for the texture samples
float ax = x - 2.0;
float bx = x - 1.0;
float cx = x;
float dx = x + 1.0;
float ex = x + 2.0;
// Sample the texture at various points
vec3 upper_a = texelFetch(tex, ivec2(int(ax), y), 0).rgb;
vec3 upper_b = texelFetch(tex, ivec2(int(bx), y), 0).rgb;
vec3 upper_c = texelFetch(tex, ivec2(int(cx), y), 0).rgb;
vec3 upper_d = texelFetch(tex, ivec2(int(dx), y), 0).rgb;
vec3 upper_e = texelFetch(tex, ivec2(int(ex), y), 0).rgb;
// Adjust the vertical coordinate for the lower scanline
y += 1;
// Sample the texture at various points
vec3 lower_a = texelFetch(tex, ivec2(int(ax), y), 0).rgb;
vec3 lower_b = texelFetch(tex, ivec2(int(bx), y), 0).rgb;
vec3 lower_c = texelFetch(tex, ivec2(int(cx), y), 0).rgb;
vec3 lower_d = texelFetch(tex, ivec2(int(dx), y), 0).rgb;
vec3 lower_e = texelFetch(tex, ivec2(int(ex), y), 0).rgb;
// Convert every sample to linear color
upper_a = srgb_to_linear(upper_a);
upper_b = srgb_to_linear(upper_b);
upper_c = srgb_to_linear(upper_c);
upper_d = srgb_to_linear(upper_d);
upper_e = srgb_to_linear(upper_e);
lower_a = srgb_to_linear(lower_a);
lower_b = srgb_to_linear(lower_b);
lower_c = srgb_to_linear(lower_c);
lower_d = srgb_to_linear(lower_d);
lower_e = srgb_to_linear(lower_e);
// The x coordinates of electron beam offsets
vec3 beam = vec3(uv.x - 0.5);
beam.r -= color_offset;
beam.b += color_offset;
// Calculate weights
vec3 weight_a = smoothstep(1, 0, (beam - ax) * sharpness);
vec3 weight_b = smoothstep(1, 0, (beam - bx) * sharpness);
vec3 weight_c = smoothstep(1, 0, abs(beam - cx) * sharpness);
vec3 weight_d = smoothstep(1, 0, (dx - beam) * sharpness);
vec3 weight_e = smoothstep(1, 0, (ex - beam) * sharpness);
// This can be a fun place to raise each weight to some power
// Mix samples into the upper scanline color
vec3 upper_col = vec3(
upper_a * weight_a +
upper_b * weight_b +
upper_c * weight_c +
upper_d * weight_d +
upper_e * weight_e
);
// Mix samples into the lower scanline color
vec3 lower_col = vec3(
lower_a * weight_a +
lower_b * weight_b +
lower_c * weight_c +
lower_d * weight_d +
lower_e * weight_e
);
vec3 weight_scaler = vec3(1.0) / (weight_a + weight_b + weight_c + weight_d + weight_e);
// Normalize weight
upper_col *= weight_scaler;
lower_col *= weight_scaler;
// Apply scanline brightness
upper_col *= scanline_brightness;
lower_col *= scanline_brightness;
// Scanline size (and roughly the apperent brightness of this line)
vec3 upper_thickness = mix(vec3(min_scanline_thickness), vec3(1.0), upper_col);
vec3 lower_thickness = mix(vec3(min_scanline_thickness), vec3(1.0), lower_col);
// Vertical sawtooth wave used to generate scanlines
// Almost the same as fract(uv.y + 0.5), but prevents a rare visual bug
float sawtooth = (uv.y + 0.5) - float(y);
vec3 upper_line = vec3(sawtooth) / upper_thickness;
upper_line = smoothstep(1.0, 0.0, upper_line);
vec3 lower_line = vec3(1.0 - sawtooth) / lower_thickness;
lower_line = smoothstep(1.0, 0.0, lower_line);
// Correct line brightness below min_scanline_thickness
upper_line *= upper_col / upper_thickness;
lower_line *= lower_col / lower_thickness;
// Combine the upper and lower scanlines
return upper_line + lower_line;
}
vec4 generate_mask(vec2 fragcoord)
{
switch (mask_type)
{
case 1: // Dots
const vec3 pattern[] = {vec3(1,0,0), vec3(0,1,0), vec3(0,0,1), vec3(0,0,0)};
ivec2 icoords = ivec2(fragcoord);
return vec4(pattern[(icoords.y * 2 + icoords.x) % 4], 0.25);
case 2: // Grille
const vec3 pattern[] = {vec3(0,1,0), vec3(1,0,1)};
return vec4(pattern[int(fragcoord.x) % 2], 0.5);
case 3: // Wide grille
const vec3 pattern[] = {
vec3(1,0,0), vec3(0,1,0), vec3(0,0,1), vec3(0,0,0)};
return vec4(pattern[int(fragcoord.x) % 4], 0.25);
case 4: // Grille wide soft
const vec3 pattern[] = {
vec3(1.0,0.125,0.0),
vec3(0.125,1.0,0.125),
vec3(0.0,0.125,1.0),
vec3(0.125,0.0,0.125)};
return vec4(pattern[int(fragcoord.x) % 4], 0.3125);
case 5: // Slotmask
const vec3 pattern[] = {
vec3(1,0,1), vec3(0,1,0), vec3(1,0,1), vec3(0,1,0),
vec3(0,0,1), vec3(0,1,0), vec3(1,0,0), vec3(0,0,0),
vec3(1,0,1), vec3(0,1,0), vec3(1,0,1), vec3(0,1,0),
vec3(1,0,0), vec3(0,0,0), vec3(0,0,1), vec3(0,1,0)
};
ivec2 icoords = ivec2(fragcoord) % 4;
return vec4(pattern[icoords.y * 4 + icoords.x], 0.375);
default:
return vec4(0.5);
}
}
// Add phosphor mask/grill
vec3 mask(vec3 linear_color, vec2 fragcoord)
{
// Get the pattern for the mask. Mask.w equals avg. brightness of the mask
vec4 mask = generate_mask(fragcoord);
// Dim the color if brightness is reduced to preserve mask details
linear_color *= mix(mask.w, 1.0, mask_brightness);
// How bright the color needs to be to maintain 100% brightness while masked
vec3 target_color = linear_color / mask.w;
// Target color limited to the 0 to 1 range.
vec3 primary_col = clamp(target_color, 0.0, 1.0);
// This calculates how bright the secondary subpixels will need to be
vec3 highlights = target_color - primary_col;
highlights /= 1.0 / mask.w - 1.0;
primary_col *= mask.rgb;
// Add the secondary subpixels
primary_col += highlights * (1.0 - mask.rgb);
return primary_col;
}
void fragment()
{
// Warp UV coordinates
vec2 warped_coords = warp(UV, aspect, curve);
// Add wobble
warped_coords.x += wobble;
// Sample the scanlines
vec3 col = scanlines(warped_coords);
// Apply phosphor mask
col = mask(col, FRAGCOORD.xy);
// Convert back to srgb
col = linear_to_srgb(col);
COLOR.rgb = col;
}

View File

@@ -0,0 +1 @@
uid://c5onkcewwqwoh

View File

@@ -11,3 +11,11 @@ func set_feature(new_feature: Feature) -> void:
feature = new_feature feature = new_feature
icon.texture = feature.icon icon.texture = feature.icon
name_label.text = tr(feature.display_name) name_label.text = tr(feature.display_name)
func show_title() -> void:
name_label.visible = true
func hide_title() -> void:
name_label.visible = false

View File

@@ -21,6 +21,7 @@ texture = ExtResource("2_w6jf0")
stretch_mode = 5 stretch_mode = 5
[node name="Label" type="Label" parent="."] [node name="Label" type="Label" parent="."]
visible = false
layout_mode = 2 layout_mode = 2
text = "Radar" text = "Radar"
horizontal_alignment = 1 horizontal_alignment = 1

13
hot_wheel.gd Normal file
View File

@@ -0,0 +1,13 @@
class_name HotWheel
extends HBoxContainer
var entries: Array[TextureRect]
func add_cassette(cassette: Card) -> void:
var tex: TextureRect = TextureRect.new()
tex.texture = cassette.icon
tex.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
tex.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
tex.custom_minimum_size = Vector2(32.0, 32.0)
add_child(tex)

1
hot_wheel.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://laoxiep4e5x0

7
hot_wheel.tscn Normal file
View File

@@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://ga21hoa8fxmm"]
[ext_resource type="Script" uid="uid://laoxiep4e5x0" path="res://hot_wheel.gd" id="1_2sjpl"]
[node name="HotWheel" type="HBoxContainer"]
alignment = 1
script = ExtResource("1_2sjpl")

View File

@@ -24,6 +24,7 @@ func load_main_menu() -> void:
game_manager.queue_free() game_manager.queue_free()
game_manager = GameManager.new() game_manager = GameManager.new()
game_manager.name = "GameManager" game_manager.name = "GameManager"
game_manager.root_scene = scene
add_child(game_manager) add_child(game_manager)
game_manager.switch_to_main_menu.connect(load_main_menu) game_manager.switch_to_main_menu.connect(load_main_menu)
game_manager.switch_to_single_player.connect(load_singleplayer) game_manager.switch_to_single_player.connect(load_singleplayer)

View File

@@ -78,7 +78,6 @@ color = Color(0.192157, 0.415686, 0.223529, 1)
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 2 layer = 2
visible = false
[node name="ColorRect2" type="ColorRect" parent="CanvasLayer"] [node name="ColorRect2" type="ColorRect" parent="CanvasLayer"]
material = SubResource("ShaderMaterial_272bh") material = SubResource("ShaderMaterial_272bh")

BIN
screencap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

40
screencap.png.import Normal file
View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1v5d8goaf7mu"
path="res://.godot/imported/screencap.png-3297cf7556450392792667332cdef39f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://screencap.png"
dest_files=["res://.godot/imported/screencap.png-3297cf7556450392792667332cdef39f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
screencap.png~ Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -47,6 +47,8 @@ func _ready() -> void:
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
drag_feature.position = get_viewport().get_mouse_position() drag_feature.position = get_viewport().get_mouse_position()
if Input.is_action_just_pressed("Pause"):
_on_cancel_button_pressed()
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
@@ -101,6 +103,7 @@ func populate_sample_library() -> void:
sample_library.add_child(hbox) sample_library.add_child(hbox)
var feat: FeatureUI = feature_scene.instantiate() as FeatureUI var feat: FeatureUI = feature_scene.instantiate() as FeatureUI
feat.set_feature(feature) feat.set_feature(feature)
feat.show_title()
feat.mouse_filter = Control.MOUSE_FILTER_PASS feat.mouse_filter = Control.MOUSE_FILTER_PASS
feat.size_flags_horizontal = Control.SIZE_EXPAND_FILL feat.size_flags_horizontal = Control.SIZE_EXPAND_FILL
feat.mouse_entered.connect(set_hovered_feature.bind(feat.feature)) feat.mouse_entered.connect(set_hovered_feature.bind(feat.feature))

View File

@@ -27,10 +27,10 @@ price_label = NodePath("PanelContainer/VBoxContainer/VBoxContainer/SourceCartrid
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = -1 anchors_preset = -1
anchor_left = 0.175 anchor_left = 0.04
anchor_top = 0.05 anchor_top = 0.04
anchor_right = 0.825 anchor_right = 0.96
anchor_bottom = 0.95 anchor_bottom = 0.96
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
@@ -81,60 +81,6 @@ size_flags_vertical = 1
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="SourceCartridge2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2"]
layout_mode = 2
size_flags_horizontal = 3
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 4.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_FIRST"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_SECOND"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label3" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_THIRD"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label4" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_FOURTH"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label5" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_FIFTH"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label6" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "SLOT_SIXTH"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TowerTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"] [node name="TowerTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3