diff options
-rw-r--r-- | assets/laser_blast.png | bin | 0 -> 615 bytes | |||
-rw-r--r-- | assets/laser_blast.png.import (renamed from assets/manager.png.import) | 6 | ||||
-rw-r--r-- | assets/manager.png | bin | 4615 -> 0 bytes | |||
-rw-r--r-- | assets/manager.tres | 11 | ||||
-rw-r--r-- | buildings/base_building.tscn | 27 | ||||
-rw-r--r-- | buildings/buildings.tscn | 4 | ||||
-rw-r--r-- | lib/building_interface.gd (renamed from buildings/building_interface.gd) | 0 | ||||
-rw-r--r-- | lib/ticked.gd | 5 | ||||
-rw-r--r-- | project.godot | 6 | ||||
-rw-r--r-- | riot/angrydev.gd | 16 | ||||
-rw-r--r-- | riot/laser_blast.tscn | 14 | ||||
-rw-r--r-- | riot/manager.gd | 1 | ||||
-rw-r--r-- | riot/riot.tscn | 22 | ||||
-rw-r--r-- | save_state.gd | 8 | ||||
-rw-r--r-- | upgrades/upgrades.tscn | 13 | ||||
-rw-r--r-- | upgrades/wageslavery.gd | 8 |
16 files changed, 77 insertions, 64 deletions
diff --git a/assets/laser_blast.png b/assets/laser_blast.png Binary files differnew file mode 100644 index 0000000..a9ebcb9 --- /dev/null +++ b/assets/laser_blast.png diff --git a/assets/manager.png.import b/assets/laser_blast.png.import index f55b324..2899f95 100644 --- a/assets/manager.png.import +++ b/assets/laser_blast.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/manager.PNG-a98949d1d2ae7500f76975e89c7554a3.stex" +path="res://.import/laser_blast.png-faf99ac52547b5232e1f87a2c7649cc8.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/manager.PNG" -dest_files=[ "res://.import/manager.PNG-a98949d1d2ae7500f76975e89c7554a3.stex" ] +source_file="res://assets/laser_blast.png" +dest_files=[ "res://.import/laser_blast.png-faf99ac52547b5232e1f87a2c7649cc8.stex" ] [params] diff --git a/assets/manager.png b/assets/manager.png Binary files differdeleted file mode 100644 index a8b26fa..0000000 --- a/assets/manager.png +++ /dev/null diff --git a/assets/manager.tres b/assets/manager.tres new file mode 100644 index 0000000..7596a2b --- /dev/null +++ b/assets/manager.tres @@ -0,0 +1,11 @@ +[gd_resource type="AnimatedTexture" load_steps=3 format=2] + +[ext_resource path="res://assets/manager2.png" type="Texture" id=1] +[ext_resource path="res://assets/manager1.png" type="Texture" id=2] + +[resource] +flags = 4 +frames = 2 +frame_0/texture = ExtResource( 2 ) +frame_1/texture = ExtResource( 1 ) +frame_1/delay_sec = 0.0 diff --git a/buildings/base_building.tscn b/buildings/base_building.tscn deleted file mode 100644 index d8b9876..0000000 --- a/buildings/base_building.tscn +++ /dev/null @@ -1,27 +0,0 @@ -[gd_scene load_steps=4 format=2] - -[ext_resource path="res://lib/base_buyable.gd" type="Script" id=1] -[ext_resource path="res://buildings/building_interface.gd" type="Script" id=2] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 32, 32 ) - -[node name="texture" type="Sprite"] -script = ExtResource( 2 ) - -[node name="Area2D" type="Area2D" parent="."] -script = ExtResource( 1 ) - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -shape = SubResource( 1 ) - -[node name="Label" type="Label" parent="."] -margin_left = -32.0 -margin_top = -32.0 -margin_right = 32.0 -margin_bottom = -16.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/buildings/buildings.tscn b/buildings/buildings.tscn index 809a59f..f2c80ef 100644 --- a/buildings/buildings.tscn +++ b/buildings/buildings.tscn @@ -19,8 +19,8 @@ position = Vector2( 186.651, 77.0577 ) scale = Vector2( 0.4, 0.4 ) texture = ExtResource( 3 ) script = ExtResource( 5 ) -base_cost = 200.0 -cost_multiplier = 100.0 +base_cost = 100.0 +cost_multiplier = 1.2 building_identifier = "dev" [node name="Area2D" type="Area2D" parent="dev"] diff --git a/buildings/building_interface.gd b/lib/building_interface.gd index b03d3d1..b03d3d1 100644 --- a/buildings/building_interface.gd +++ b/lib/building_interface.gd diff --git a/lib/ticked.gd b/lib/ticked.gd index cef46ab..cacfaef 100644 --- a/lib/ticked.gd +++ b/lib/ticked.gd @@ -1,4 +1,4 @@ -extends Node +extends Node2D class_name Ticked export var tick_rate := 1.0 @@ -8,6 +8,9 @@ func _tick(): func _process(delta: float) -> void: current_tick += delta + if tick_rate < 0: + current_tick = 0 + return while current_tick > tick_rate: _tick() current_tick -= tick_rate diff --git a/project.godot b/project.godot index f06dea0..2a5bac6 100644 --- a/project.godot +++ b/project.godot @@ -9,7 +9,7 @@ config_version=4 _global_script_classes=[ { -"base": "Node2D", +"base": "Ticked", "class": "AngryDev", "language": "GDScript", "path": "res://riot/angrydev.gd" @@ -22,7 +22,7 @@ _global_script_classes=[ { "base": "Ticked", "class": "BuildingInterface", "language": "GDScript", -"path": "res://buildings/building_interface.gd" +"path": "res://lib/building_interface.gd" }, { "base": "Area2D", "class": "ClickableArea", @@ -34,7 +34,7 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://riot/manager.gd" }, { -"base": "Node", +"base": "Node2D", "class": "Ticked", "language": "GDScript", "path": "res://lib/ticked.gd" diff --git a/riot/angrydev.gd b/riot/angrydev.gd index 5e79141..580de32 100644 --- a/riot/angrydev.gd +++ b/riot/angrydev.gd @@ -1,4 +1,4 @@ -extends Node2D +extends Ticked class_name AngryDev var min_pitchfork_rotation : float = -15.0 @@ -8,12 +8,22 @@ var target: Manager = null var total_tick = 0.0 export var speed : float = 100.0 onready var pitchfork : Sprite = $pitchfork +onready var body : Sprite = $body +export (Texture) var laser_pitchfork_texture: Texture = null +var laser = false +func _ready(): + if SaveState.has_upgrade("sunglasses"): + laser = true + pitchfork.texture = laser_pitchfork_texture func interpolate(a, b, progress): return a + (b-a) * progress func _process(delta : float) -> void: + if laser: + pitchfork.rotation = get_angle_to(target.position) + PI / 2 + return total_tick += delta var normalized_progress = (sin(total_tick * rotation_speed) + 1.0) / 2.0 var rot = interpolate(min_pitchfork_rotation, max_pitchfork_rotation, normalized_progress) @@ -21,7 +31,9 @@ func _process(delta : float) -> void: func _physics_process(delta: float) -> void: - var normalized_move = (target.position - position).normalized() + if laser: + return + var normalized_move = (target.position - body.position).normalized() position += normalized_move * delta * speed diff --git a/riot/laser_blast.tscn b/riot/laser_blast.tscn new file mode 100644 index 0000000..6a588fd --- /dev/null +++ b/riot/laser_blast.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://assets/laser_blast.png" type="Texture" id=1] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 32, 32 ) + +[node name="Node2D" type="Sprite"] +texture = ExtResource( 1 ) + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +shape = SubResource( 1 ) diff --git a/riot/manager.gd b/riot/manager.gd index bca0559..56d507a 100644 --- a/riot/manager.gd +++ b/riot/manager.gd @@ -15,7 +15,6 @@ func _physics_process(delta : float) -> void: var collision = move_and_collide(move_vector) if collision: - SaveState.lose_bitcoin(int(ceil(SaveState.bitcoin / 2.0))) SaveState.buildings["dev"] = int(ceil(SaveState.buildings["dev"] * 8.0 / 10.0)) for child in get_parent().get_parent().get_children(): if child is CanvasItem: diff --git a/riot/riot.tscn b/riot/riot.tscn index e091837..77b6441 100644 --- a/riot/riot.tscn +++ b/riot/riot.tscn @@ -1,22 +1,11 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://riot/riot.gd" type="Script" id=1] -[ext_resource path="res://assets/manager2.png" type="Texture" id=2] +[ext_resource path="res://assets/manager.tres" type="Texture" id=2] [ext_resource path="res://riot/manager.gd" type="Script" id=3] -[ext_resource path="res://assets/manager1.png" type="Texture" id=4] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 33.1266, 67.3226 ) - -[sub_resource type="AnimatedTexture" id=2] -flags = 4 -frames = 2 -fps = 3.0 -frame_0/texture = ExtResource( 4 ) -frame_1/texture = ExtResource( 2 ) -frame_1/delay_sec = 0.0 - -[sub_resource type="AnimatedTexture" id=3] +extents = Vector2( 33.1266, 62.8009 ) [node name="Node2D" type="Node2D"] script = ExtResource( 1 ) @@ -24,10 +13,11 @@ script = ExtResource( 1 ) [node name="manager" type="KinematicBody2D" parent="."] position = Vector2( 600.978, 319.858 ) script = ExtResource( 3 ) +speed = 200.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="manager"] +position = Vector2( -13.566, -1.50735 ) shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="manager"] -texture = SubResource( 2 ) -normal_map = SubResource( 3 ) +texture = ExtResource( 2 ) diff --git a/save_state.gd b/save_state.gd index a9c8a59..2ce8b0d 100644 --- a/save_state.gd +++ b/save_state.gd @@ -5,9 +5,13 @@ var buildings = { "dev": 1, } var upgrades = { - "wageslavery": 0 + "wageslavery": 0, + "sunglasses": 0, } +func has_upgrade(name): + return upgrades[name] > 0 + func gain_bitcoin(amount: int) -> void: bitcoin += amount * (upgrades["wageslavery"] + 1) @@ -27,7 +31,7 @@ func try_gain_coffee(amount: int) -> int: var coffee = 10 var coffee_beans = 1000 -var bitcoin = 100 +var bitcoin = 10000 var riot_cooldown = 0 func pack_data(): diff --git a/upgrades/upgrades.tscn b/upgrades/upgrades.tscn index 6cd6770..ea45d2f 100644 --- a/upgrades/upgrades.tscn +++ b/upgrades/upgrades.tscn @@ -13,9 +13,22 @@ extents = Vector2( 32, 32 ) position = Vector2( 62.9383, 60.4207 ) texture = ExtResource( 1 ) script = ExtResource( 2 ) +tick_rate = -1.0 +base_cost = 200.0 +cost_multiplier = 100.0 +building_identifier = "wageslavery" [node name="Area2D" type="Area2D" parent="wageslavery"] script = ExtResource( 3 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="wageslavery/Area2D"] shape = SubResource( 1 ) + +[node name="Label" type="Label" parent="wageslavery"] +margin_left = -8.62447 +margin_top = 15.9221 +margin_right = 31.3755 +margin_bottom = 29.9221 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/upgrades/wageslavery.gd b/upgrades/wageslavery.gd index e48fba2..181df4b 100644 --- a/upgrades/wageslavery.gd +++ b/upgrades/wageslavery.gd @@ -1,10 +1,4 @@ -extends Node - -func _bought(): - pass - -func get_cost(): - return 200 * pow(100, get_amount()) +extends BuildingInterface func set_amount(amount: int) -> void: SaveState.upgrades['wageslavery'] = amount |