aboutsummaryrefslogtreecommitdiff
path: root/main_scene
diff options
context:
space:
mode:
authorRoman Gräf <romangraef@gmail.com>2020-04-18 15:33:01 +0200
committerRoman Gräf <romangraef@gmail.com>2020-04-18 15:33:01 +0200
commit6a6fd1828959e3343e58e3ddc36790b4a25e1747 (patch)
treeb155ea05bf32aef00adca52f77a46deae248939e /main_scene
parent6c66e81946d005dac3b05be73889da28936b0ad0 (diff)
downloadLDJam46-6a6fd1828959e3343e58e3ddc36790b4a25e1747.tar.gz
LDJam46-6a6fd1828959e3343e58e3ddc36790b4a25e1747.tar.bz2
LDJam46-6a6fd1828959e3343e58e3ddc36790b4a25e1747.zip
Anfänge von Riots und Eingebundene Dev hire assets
Diffstat (limited to 'main_scene')
-rw-r--r--main_scene/coffee_machine.gd6
-rw-r--r--main_scene/management.tscn59
-rw-r--r--main_scene/programmers.gd15
3 files changed, 73 insertions, 7 deletions
diff --git a/main_scene/coffee_machine.gd b/main_scene/coffee_machine.gd
new file mode 100644
index 0000000..86c1ca2
--- /dev/null
+++ b/main_scene/coffee_machine.gd
@@ -0,0 +1,6 @@
+extends ClickableArea
+
+
+func _click():
+ SaveState.coffee +=1
+
diff --git a/main_scene/management.tscn b/main_scene/management.tscn
new file mode 100644
index 0000000..63dc13d
--- /dev/null
+++ b/main_scene/management.tscn
@@ -0,0 +1,59 @@
+[gd_scene load_steps=11 format=2]
+
+[ext_resource path="res://assets/background.png" type="Texture" id=1]
+[ext_resource path="res://main_scene/coffee_machine.gd" type="Script" id=2]
+[ext_resource path="res://main_scene/Label.gd" type="Script" id=3]
+[ext_resource path="res://buildings/buildings.tscn" type="PackedScene" id=4]
+[ext_resource path="res://assets/hire.png" type="Texture" id=5]
+[ext_resource path="res://main_scene/hire_button.gd" type="Script" id=6]
+[ext_resource path="res://main_scene/programmers.gd" type="Script" id=7]
+[ext_resource path="res://assets/coffee_maschine.png" type="Texture" id=8]
+
+[sub_resource type="RectangleShape2D" id=1]
+extents = Vector2( 70.4574, 120 )
+
+[sub_resource type="RectangleShape2D" id=2]
+extents = Vector2( 360, 360 )
+
+[node name="Node2D" type="Node2D"]
+
+[node name="background" type="Sprite" parent="."]
+position = Vector2( 512.018, 299.606 )
+texture = ExtResource( 1 )
+
+[node name="Label" type="Label" parent="."]
+margin_right = 237.0
+margin_bottom = 97.0
+script = ExtResource( 3 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="buildings" parent="." instance=ExtResource( 4 )]
+
+[node name="hiring" type="Node2D" parent="."]
+script = ExtResource( 7 )
+
+[node name="hire" type="Sprite" parent="hiring"]
+position = Vector2( 501.726, 101.527 )
+scale = Vector2( 0.6, 0.6 )
+texture = ExtResource( 5 )
+
+[node name="Area2D" type="Area2D" parent="hiring/hire"]
+script = ExtResource( 6 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="hiring/hire/Area2D"]
+position = Vector2( -9.54248, -2.42094 )
+shape = SubResource( 1 )
+
+[node name="coffee_maschine" type="Sprite" parent="."]
+position = Vector2( 288, 304 )
+scale = Vector2( 0.2, 0.2 )
+texture = ExtResource( 8 )
+
+[node name="Area2D" type="Area2D" parent="coffee_maschine"]
+script = ExtResource( 2 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="coffee_maschine/Area2D"]
+position = Vector2( -40.0001, -0.00012207 )
+shape = SubResource( 2 )
diff --git a/main_scene/programmers.gd b/main_scene/programmers.gd
index 1210b86..8e0a2a2 100644
--- a/main_scene/programmers.gd
+++ b/main_scene/programmers.gd
@@ -1,9 +1,9 @@
extends Ticked
-var riot_cooldown := 0
+var riot := preload("res://riot/riot.tscn")
func _tick() -> void:
- if riot_cooldown == 0:
+ if SaveState.riot_cooldown == 0:
SaveState.coffee -= SaveState.programmers
if SaveState.coffee < 0:
riot()
@@ -11,8 +11,9 @@ func _tick() -> void:
else:
SaveState.bitcoin += SaveState.programmers
else:
- riot_cooldown -= 1
- if riot_cooldown < 0:
- riot_cooldown = 0
-func riot():
- riot_cooldown = 10
+ SaveState.riot_cooldown -= 1
+
+func riot() -> void:
+ SaveState.riot_cooldown = -1
+ get_parent().hide()
+ get_parent().get_parent().add_child(riot.instance())