Team Screen propagates images
This commit is contained in:
257
User Interface/Header.gd
Normal file
257
User Interface/Header.gd
Normal file
@@ -0,0 +1,257 @@
|
||||
extends Control
|
||||
|
||||
#https://www.youtube.com/watch?v=V79YabQZC1s
|
||||
#13:03
|
||||
|
||||
var score = 0
|
||||
var clickAdd = 1
|
||||
var scorePerSec = 1
|
||||
var scoreMultiplier = 1
|
||||
|
||||
#Click Upgrades Costs
|
||||
var clickUpgradeReq1 = 10
|
||||
var clickUpgradeReq10 = 100
|
||||
var clickUpgradeReq20 = 1000
|
||||
var clickUpgradeReq40 = 10000
|
||||
var clickUpgradeReq60 = 100000
|
||||
var clickUpgradeReq80 = 1000000
|
||||
var clickUpgradeReq100 = 10000000
|
||||
var clickUpgradeReq200 = 100000000
|
||||
var clickUpgradeReq400 = 1000000000
|
||||
|
||||
|
||||
# Click Upgrades Amount
|
||||
var clickUpgradeAmt1 = 1
|
||||
var clickUpgradeAmt10 = 10
|
||||
var clickUpgradeAmt20 = 20
|
||||
var clickUpgradeAmt40 = 40
|
||||
var clickUpgradeAmt60 = 60
|
||||
var clickUpgradeAmt80 = 80
|
||||
var clickUpgradeAmt100 = 100
|
||||
var clickUpgradeAmt200 = 200
|
||||
var clickUpgradeAmt400 = 400
|
||||
|
||||
|
||||
# Passive Upgrades Costs
|
||||
var passiveUpgradeReq2 = 100
|
||||
var passiveUpgradeReq10 = 1000
|
||||
var passiveUpgradeReq20 = 10000
|
||||
var passiveUpgradeReq50 = 100000
|
||||
var passiveUpgradeReq100 = 1000000
|
||||
var passiveUpgradeReq200 = 10000000
|
||||
var passiveUpgradeReq500 = 100000000
|
||||
var passiveUpgradeReq1000 = 1000000000
|
||||
var passiveUpgradeReq10000 = 10000000000
|
||||
|
||||
# Passive Upgrades Amount
|
||||
var passiveUpgradeAmt2 = 2
|
||||
var passiveUpgradeAmt10 = 10
|
||||
var passiveUpgradeAmt20 = 20
|
||||
var passiveUpgradeAmt50 = 50
|
||||
var passiveUpgradeAmt100 = 100
|
||||
var passiveUpgradeAmt200 = 200
|
||||
var passiveUpgradeAmt500 = 500
|
||||
var passiveUpgradeAmt1000 = 1000
|
||||
var passiveUpgradeAmt10000 = 10000
|
||||
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$ClickUpgrades.get_popup().connect("id_pressed",clickUpgrade)
|
||||
$PassiveUpgrades.get_popup().connect("id_pressed",passiveUpgrade)
|
||||
$Timer.connect("timeout", _on_Timer_timeout)
|
||||
#$TeamButton.pressed.connect(self.openTeamWindow)
|
||||
#Code for the Click Me Button (deprecated)
|
||||
#$Click.pressed.connect(self._on_button_pressed)
|
||||
#Prints all input events, only for debugging
|
||||
#func _input(event):
|
||||
#print(event.as_text())
|
||||
|
||||
func _on_Timer_timeout():
|
||||
score += scorePerSec * scoreMultiplier
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
#Displays normal numbers until commas are needed
|
||||
if score > 999:
|
||||
$Score.text = str(scoreFormat(score))
|
||||
else:
|
||||
$Score.text = str(score) #Changes the score number
|
||||
|
||||
#This checks any input that comes in
|
||||
func _input(event):
|
||||
#Function to record every left click as a "Click" to add to the score
|
||||
if event.is_action_pressed("left_mouse"):
|
||||
leftClick()
|
||||
#_on_button_pressed()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Formats the score string so commas are inserted
|
||||
func scoreFormat(score):
|
||||
# Convert value to string.
|
||||
var str_value: String = str(score)
|
||||
|
||||
# Loop backward starting at the last 3 digits,
|
||||
# add comma then, repeat every 3rd step.
|
||||
for i in range(str_value.length()-3, 0, -3):
|
||||
str_value = str_value.insert(i, ",")
|
||||
score = str_value
|
||||
return score
|
||||
|
||||
func leftClick():
|
||||
score += clickAdd * scoreMultiplier
|
||||
|
||||
|
||||
func clickUpgrade(id):
|
||||
match id:
|
||||
0:
|
||||
if score >= clickUpgradeReq1:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq1
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt1
|
||||
else:
|
||||
print("not enough score")
|
||||
1:
|
||||
if score >= clickUpgradeReq10:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq10
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt10
|
||||
else:
|
||||
print("not enough score")
|
||||
2:
|
||||
if score >= clickUpgradeReq20:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq20
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt20
|
||||
else:
|
||||
print("not enough score")
|
||||
3:
|
||||
if score >= clickUpgradeReq40:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq40
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt40
|
||||
else:
|
||||
print("not enough score")
|
||||
4:
|
||||
if score >= clickUpgradeReq60:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq60
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt60
|
||||
else:
|
||||
print("not enough score")
|
||||
5:
|
||||
if score >= clickUpgradeReq80:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq80
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt80
|
||||
else:
|
||||
print("not enough score")
|
||||
6:
|
||||
if score >= clickUpgradeReq100:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq100
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt100
|
||||
else:
|
||||
print("not enough score")
|
||||
7:
|
||||
if score >= clickUpgradeReq200:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq200
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt200
|
||||
else:
|
||||
print("not enough score")
|
||||
8:
|
||||
if score >= clickUpgradeReq400:
|
||||
print ("Score sufficient")
|
||||
score -=clickUpgradeReq400
|
||||
$ClickUpgrades.get_popup().set_item_disabled(id, true)
|
||||
clickAdd += clickUpgradeAmt400
|
||||
else:
|
||||
print("not enough score")
|
||||
|
||||
func passiveUpgrade(id):
|
||||
match id:
|
||||
0:
|
||||
if score >= passiveUpgradeReq2:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq2
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt2
|
||||
else:
|
||||
print("not enough score")
|
||||
1:
|
||||
if score >= passiveUpgradeReq10:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq10
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt10
|
||||
else:
|
||||
print("not enough score")
|
||||
2:
|
||||
if score >= passiveUpgradeReq20:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq20
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt20
|
||||
else:
|
||||
print("not enough score")
|
||||
3:
|
||||
if score >= passiveUpgradeReq50:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq50
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt50
|
||||
else:
|
||||
print("not enough score")
|
||||
4:
|
||||
if score >= passiveUpgradeReq100:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq100
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt100
|
||||
else:
|
||||
print("not enough score")
|
||||
5:
|
||||
if score >= passiveUpgradeReq200:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq200
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt200
|
||||
else:
|
||||
print("not enough score")
|
||||
6:
|
||||
if score >= passiveUpgradeReq500:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq500
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt500
|
||||
else:
|
||||
print("not enough score")
|
||||
7:
|
||||
if score >= passiveUpgradeReq1000:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq1000
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt1000
|
||||
else:
|
||||
print("not enough score")
|
||||
8:
|
||||
if score >= passiveUpgradeReq10000:
|
||||
print ("Score sufficient")
|
||||
score -=passiveUpgradeReq10000
|
||||
$PassiveUpgrades.get_popup().set_item_disabled(id, true)
|
||||
scorePerSec = passiveUpgradeAmt10000
|
||||
else:
|
||||
print("not enough score")
|
||||
18
User Interface/Member1.gd
Normal file
18
User Interface/Member1.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends TextureButton
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
# Connect the pressed signal to the _on_Button_pressed function
|
||||
self.connect("pressed", Callable(self, "_on_Button_pressed"))
|
||||
|
||||
#Checks if the texture needs to be set
|
||||
if Global.selected_texture:
|
||||
self.texture_normal = Global.selected_texture
|
||||
|
||||
|
||||
# Function to handle the button press
|
||||
func _on_Button_pressed():
|
||||
# Change the current scene
|
||||
get_tree().change_scene_to_file("res://team.tscn")
|
||||
|
||||
#Function to set texture of the button
|
||||
5
User Interface/TeamButton.gd
Normal file
5
User Interface/TeamButton.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends Button
|
||||
|
||||
|
||||
|
||||
|
||||
91
User Interface/UseBBF4.tmp
Normal file
91
User Interface/UseBBF4.tmp
Normal file
@@ -0,0 +1,91 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://xh0p6v5ir05f"]
|
||||
|
||||
[ext_resource type="Script" path="res://Root.gd" id="1_dtx5s"]
|
||||
[ext_resource type="Script" path="res://User Interface/Header.gd" id="3_q5rri"]
|
||||
|
||||
[node name="Root" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_dtx5s")
|
||||
|
||||
[node name="UI" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="UI"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
script = ExtResource("3_q5rri")
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="UI/Header"]
|
||||
layout_mode = 2
|
||||
text = "Score:"
|
||||
|
||||
[node name="Score" type="Label" parent="UI/Header"]
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="Timer" type="Timer" parent="UI/Header"]
|
||||
autostart = true
|
||||
|
||||
[node name="ClickUpgrades" type="MenuButton" parent="UI/Header"]
|
||||
layout_mode = 2
|
||||
text = "Click Upgrades"
|
||||
item_count = 9
|
||||
popup/item_0/text = "+1 Cost:10"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "+10 Cost: 100"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "+20 Cost:1,000"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "+40 Cost: 10,000"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "+60 Cost: 100,000"
|
||||
popup/item_4/id = 4
|
||||
popup/item_5/text = "+80 Cost: 1,000,000"
|
||||
popup/item_5/id = 5
|
||||
popup/item_6/text = "+100 Cost: 10,000,000"
|
||||
popup/item_6/id = 6
|
||||
popup/item_7/text = "+200 Cost: 100,000,000"
|
||||
popup/item_7/id = 7
|
||||
popup/item_8/text = "+400 Cost: 1,000,000,000"
|
||||
popup/item_8/id = 8
|
||||
|
||||
[node name="PassiveUpgrades" type="MenuButton" parent="UI/Header"]
|
||||
layout_mode = 2
|
||||
text = "Passive Upgrades"
|
||||
item_count = 9
|
||||
popup/item_0/text = "2/s Cost: 100"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "10/s Cost: 1,000"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "20/s Cost: 10,000"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "50/s Cost: 100,000"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "100/s Cost:1,000,000"
|
||||
popup/item_4/id = 4
|
||||
popup/item_5/text = "200/s Cost: 10,000,000"
|
||||
popup/item_5/id = 5
|
||||
popup/item_6/text = "500/s Cost: 100,000,000"
|
||||
popup/item_6/id = 6
|
||||
popup/item_7/text = "1,000/s Cost: 1,000,000,000"
|
||||
popup/item_7/id = 7
|
||||
popup/item_8/text = "10,000/s Cost: 10,000,000,000"
|
||||
popup/item_8/id = 8
|
||||
|
||||
[node name="TeamButton" type="Button" parent="UI/Header"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Team"
|
||||
flat = true
|
||||
alignment = 0
|
||||
152
User Interface/UserInterface.tscn
Normal file
152
User Interface/UserInterface.tscn
Normal file
@@ -0,0 +1,152 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://xh0p6v5ir05f"]
|
||||
|
||||
[ext_resource type="Script" path="res://Root.gd" id="1_dtx5s"]
|
||||
[ext_resource type="Script" path="res://User Interface/TeamButton.gd" id="3_g0muc"]
|
||||
[ext_resource type="Script" path="res://User Interface/Header.gd" id="3_q5rri"]
|
||||
[ext_resource type="Script" path="res://User Interface/Member1.gd" id="4_4xump"]
|
||||
[ext_resource type="Texture2D" uid="uid://bfdqkquqtf6ir" path="res://Images/plus-icon-vector-illustration.jpg" id="4_gxo13"]
|
||||
|
||||
[node name="Root" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = 768.0
|
||||
offset_bottom = 432.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_dtx5s")
|
||||
|
||||
[node name="UI" type="Control" parent="."]
|
||||
anchors_preset = 0
|
||||
offset_right = 1920.0
|
||||
offset_bottom = 1080.0
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="UI"]
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="UI/CanvasLayer"]
|
||||
offset_left = 3.0
|
||||
offset_right = 395.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("3_q5rri")
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="UI/CanvasLayer/Header"]
|
||||
layout_mode = 2
|
||||
text = "Score:"
|
||||
|
||||
[node name="Score" type="Label" parent="UI/CanvasLayer/Header"]
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="Timer" type="Timer" parent="UI/CanvasLayer/Header"]
|
||||
autostart = true
|
||||
|
||||
[node name="ClickUpgrades" type="MenuButton" parent="UI/CanvasLayer/Header"]
|
||||
layout_mode = 2
|
||||
text = "Click Upgrades"
|
||||
item_count = 9
|
||||
popup/item_0/text = "+1 Cost:10"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "+10 Cost: 100"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "+20 Cost:1,000"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "+40 Cost: 10,000"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "+60 Cost: 100,000"
|
||||
popup/item_4/id = 4
|
||||
popup/item_5/text = "+80 Cost: 1,000,000"
|
||||
popup/item_5/id = 5
|
||||
popup/item_6/text = "+100 Cost: 10,000,000"
|
||||
popup/item_6/id = 6
|
||||
popup/item_7/text = "+200 Cost: 100,000,000"
|
||||
popup/item_7/id = 7
|
||||
popup/item_8/text = "+400 Cost: 1,000,000,000"
|
||||
popup/item_8/id = 8
|
||||
|
||||
[node name="PassiveUpgrades" type="MenuButton" parent="UI/CanvasLayer/Header"]
|
||||
layout_mode = 2
|
||||
text = "Passive Upgrades"
|
||||
item_count = 9
|
||||
popup/item_0/text = "2/s Cost: 100"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "10/s Cost: 1,000"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "20/s Cost: 10,000"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "50/s Cost: 100,000"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "100/s Cost:1,000,000"
|
||||
popup/item_4/id = 4
|
||||
popup/item_5/text = "200/s Cost: 10,000,000"
|
||||
popup/item_5/id = 5
|
||||
popup/item_6/text = "500/s Cost: 100,000,000"
|
||||
popup/item_6/id = 6
|
||||
popup/item_7/text = "1,000/s Cost: 1,000,000,000"
|
||||
popup/item_7/id = 7
|
||||
popup/item_8/text = "10,000/s Cost: 10,000,000,000"
|
||||
popup/item_8/id = 8
|
||||
|
||||
[node name="TeamButton" type="Button" parent="UI/CanvasLayer/Header"]
|
||||
layout_mode = 2
|
||||
text = "Team"
|
||||
flat = true
|
||||
alignment = 0
|
||||
script = ExtResource("3_g0muc")
|
||||
|
||||
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="UI"]
|
||||
layout_mode = 0
|
||||
offset_left = -2.60654
|
||||
offset_top = 271.396
|
||||
offset_right = 1917.39
|
||||
offset_bottom = 800.396
|
||||
|
||||
[node name="TeamScreen" type="HBoxContainer" parent="UI/AspectRatioContainer"]
|
||||
visibility_layer = 2
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Member1" type="TextureButton" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
custom_minimum_size = Vector2(200, 10)
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("4_gxo13")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 0
|
||||
script = ExtResource("4_4xump")
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button2" type="Button" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
custom_minimum_size = Vector2(200, 10)
|
||||
layout_mode = 2
|
||||
text = "Click Here"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button3" type="Button" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
custom_minimum_size = Vector2(200, 10)
|
||||
layout_mode = 2
|
||||
text = "Click Here"
|
||||
|
||||
[node name="VSeparator3" type="VSeparator" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button4" type="Button" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
custom_minimum_size = Vector2(200, 10)
|
||||
layout_mode = 2
|
||||
text = "Click Here"
|
||||
|
||||
[node name="VSeparator4" type="VSeparator" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button5" type="Button" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
custom_minimum_size = Vector2(200, 10)
|
||||
layout_mode = 2
|
||||
text = "Click Here"
|
||||
|
||||
[node name="Label" type="Label" parent="UI/AspectRatioContainer/TeamScreen"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "testtestsetsetsetsetsetsetset"
|
||||
Reference in New Issue
Block a user