we're cooking now

This commit is contained in:
Tabby 2026-01-11 16:37:57 +11:00
parent f58fd81ec5
commit da3dc64056
6 changed files with 86 additions and 15 deletions

View file

@ -15,16 +15,20 @@ func _process(delta: float) -> void:
func _on_loot_button_pressed() -> void: func _on_loot_button_pressed() -> void:
loot_button.hide() if Clock.has_time(10):
bin_inventory.show() Clock.use_time(10)
bin_inventory.add_item(pick_random_item()) bin_inventory.add_item(pick_random_item())
bin_inventory.add_item(pick_random_item())
bin_inventory.add_item(pick_random_item()) #loot_button.hide()
bin_inventory.add_item(pick_random_item()) #bin_inventory.show()
bin_inventory.add_item(pick_random_item()) #bin_inventory.add_item(pick_random_item())
bin_inventory.add_item(pick_random_item()) #bin_inventory.add_item(pick_random_item())
bin_inventory.add_item(pick_random_item()) #bin_inventory.add_item(pick_random_item())
bin_inventory.add_item(pick_random_item()) #bin_inventory.add_item(pick_random_item())
#bin_inventory.add_item(pick_random_item())
#bin_inventory.add_item(pick_random_item())
#bin_inventory.add_item(pick_random_item())
#bin_inventory.add_item(pick_random_item())
func pick_random_item() -> ItemData: func pick_random_item() -> ItemData:
var icount = loot_pool.size() var icount = loot_pool.size()

View file

@ -21,6 +21,14 @@ Tooltip="*res://tooltip.tscn"
PlayerInventory="*res://inv_system/player_inventory.tscn" PlayerInventory="*res://inv_system/player_inventory.tscn"
Clock="*res://time_system/clock.tscn" Clock="*res://time_system/clock.tscn"
[editor]
movie_writer/video_quality=0.25
movie_writer/ogv/encoding_speed=1
movie_writer/ogv/keyframe_interval=128
movie_writer/movie_file="C:/Users/tabby/Documents/Godot/Projects/RepurposedJam/video.avi"
movie_writer/fps=30
[rendering] [rendering]
renderer/rendering_method="gl_compatibility" renderer/rendering_method="gl_compatibility"

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://dsfal3m4siap2"] [gd_scene load_steps=12 format=3 uid="uid://dsfal3m4siap2"]
[ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="1_6uqi0"] [ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="1_6uqi0"]
[ext_resource type="Texture2D" uid="uid://dj487wauiay6i" path="res://assets/ewase bins.png" id="1_g14j6"] [ext_resource type="Texture2D" uid="uid://dj487wauiay6i" path="res://assets/ewase bins.png" id="1_g14j6"]
@ -11,6 +11,9 @@
[ext_resource type="Resource" uid="uid://swd1m0hvep4c" path="res://items/small_psu_item.tres" id="7_5tkv4"] [ext_resource type="Resource" uid="uid://swd1m0hvep4c" path="res://items/small_psu_item.tres" id="7_5tkv4"]
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="7_xersf"] [ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="7_xersf"]
[sub_resource type="LabelSettings" id="LabelSettings_00tp4"]
font_color = Color(1, 0, 0, 0.5764706)
[node name="Control" type="Control" node_paths=PackedStringArray("bin_inventory", "loot_button")] [node name="Control" type="Control" node_paths=PackedStringArray("bin_inventory", "loot_button")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
@ -37,13 +40,12 @@ texture = ExtResource("1_g14j6")
expand_mode = 3 expand_mode = 3
[node name="BinPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")] [node name="BinPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")]
visible = false
z_index = 2 z_index = 2
layout_mode = 0 layout_mode = 0
offset_left = 714.0 offset_left = 714.0
offset_top = 386.0 offset_top = 386.0
offset_right = 1066.0 offset_right = 1066.0
offset_bottom = 563.0 offset_bottom = 587.0
script = ExtResource("1_6uqi0") script = ExtResource("1_6uqi0")
inventory_name = "E-waste Recycling Bin" inventory_name = "E-waste Recycling Bin"
grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/GridContainer") grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/GridContainer")
@ -102,6 +104,12 @@ layout_mode = 2
[node name="ItemSlot21" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] [node name="ItemSlot21" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
layout_mode = 2 layout_mode = 2
[node name="Label2" type="Label" parent="BinPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "(Items left here will be destroyed)"
label_settings = SubResource("LabelSettings_00tp4")
horizontal_alignment = 1
[node name="LootButton" type="Button" parent="."] [node name="LootButton" type="Button" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = 8

23
time_system/clock.gd Normal file
View file

@ -0,0 +1,23 @@
extends Control
@export var days_left : float = 7
@export var time_left : int = 200
var starting_time : int = 200
@export var bar : TextureProgressBar
@export var timer_text : Label
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
bar.value = (starting_time-time_left)/float(starting_time)
timer_text.text = str(time_left)
func has_time(time : float) -> bool:
return time_left >= time
func use_time(time : float):
time_left -= time

1
time_system/clock.gd.uid Normal file
View file

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

View file

@ -1,19 +1,24 @@
[gd_scene load_steps=5 format=3 uid="uid://dpa3yvdrddtsh"] [gd_scene load_steps=6 format=3 uid="uid://dpa3yvdrddtsh"]
[ext_resource type="Texture2D" uid="uid://cvsibrbtuqfww" path="res://assets/ready_time.png" id="1_chnjs"] [ext_resource type="Texture2D" uid="uid://cvsibrbtuqfww" path="res://assets/ready_time.png" id="1_chnjs"]
[ext_resource type="Script" uid="uid://c4y7w10si2q2p" path="res://time_system/clock.gd" id="1_m6rn1"]
[ext_resource type="Texture2D" uid="uid://bemb2moou1hkj" path="res://assets/timer_over.png" id="2_m6rn1"] [ext_resource type="Texture2D" uid="uid://bemb2moou1hkj" path="res://assets/timer_over.png" id="2_m6rn1"]
[ext_resource type="Texture2D" uid="uid://dvxtm2ahjd55h" path="res://assets/used_time.png" id="3_uyb5s"] [ext_resource type="Texture2D" uid="uid://dvxtm2ahjd55h" path="res://assets/used_time.png" id="3_uyb5s"]
[sub_resource type="LabelSettings" id="LabelSettings_r3ygl"] [sub_resource type="LabelSettings" id="LabelSettings_r3ygl"]
font_size = 32 font_size = 32
[node name="Clock" type="Control"] [node name="Clock" type="Control" node_paths=PackedStringArray("bar", "timer_text")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_m6rn1")
bar = NodePath("PanelContainer/HBoxContainer/TextureProgressBar")
timer_text = NodePath("PanelContainer/HBoxContainer/TextureProgressBar/PanelContainer/Label")
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1 layout_mode = 1
@ -45,6 +50,8 @@ text = "Days Left"
[node name="TextureProgressBar" type="TextureProgressBar" parent="PanelContainer/HBoxContainer"] [node name="TextureProgressBar" type="TextureProgressBar" parent="PanelContainer/HBoxContainer"]
custom_minimum_size = Vector2(150, 73) custom_minimum_size = Vector2(150, 73)
layout_mode = 2 layout_mode = 2
max_value = 1.0
step = 0.0
fill_mode = 4 fill_mode = 4
radial_initial_angle = 270.0 radial_initial_angle = 270.0
radial_fill_degrees = 180.0 radial_fill_degrees = 180.0
@ -53,3 +60,23 @@ nine_patch_stretch = true
texture_under = ExtResource("1_chnjs") texture_under = ExtResource("1_chnjs")
texture_over = ExtResource("2_m6rn1") texture_over = ExtResource("2_m6rn1")
texture_progress = ExtResource("3_uyb5s") texture_progress = ExtResource("3_uyb5s")
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/HBoxContainer/TextureProgressBar"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -16.0
offset_top = -23.0
offset_right = 16.0
grow_horizontal = 2
grow_vertical = 0
[node name="Label" type="Label" parent="PanelContainer/HBoxContainer/TextureProgressBar/PanelContainer"]
layout_mode = 2
size_flags_vertical = 8
text = "200"
horizontal_alignment = 1
vertical_alignment = 2