Skip to content

Commit

Permalink
Merge pull request #3 from Lukasdotcom/v0.6.1
Browse files Browse the repository at this point in the history
V0.6.1
  • Loading branch information
Lukasdotcom authored Feb 23, 2022
2 parents cd32b3c + 781c470 commit 669ecd9
Show file tree
Hide file tree
Showing 16 changed files with 408 additions and 37 deletions.
65 changes: 65 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,68 @@ progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color( 0, 0, 0, 1 )

[preset.1]

name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../../Downloads/Idle Bouncer.dmg"
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
application/name="Idle Bouncer"
application/info="Made with Godot Engine"
application/icon=""
application/identifier="xyz.lschaefer"
application/signature=""
application/app_category="Games"
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
codesign/enable=true
codesign/identity=""
codesign/timestamp=true
codesign/hardened_runtime=true
codesign/replace_existing_signature=true
codesign/entitlements/custom_file=""
codesign/entitlements/allow_jit_code_execution=false
codesign/entitlements/allow_unsigned_executable_memory=false
codesign/entitlements/allow_dyld_environment_variables=false
codesign/entitlements/disable_library_validation=false
codesign/entitlements/audio_input=false
codesign/entitlements/camera=false
codesign/entitlements/location=false
codesign/entitlements/address_book=false
codesign/entitlements/calendars=false
codesign/entitlements/photos_library=false
codesign/entitlements/apple_events=false
codesign/entitlements/debugging=false
codesign/entitlements/app_sandbox/enabled=false
codesign/entitlements/app_sandbox/network_server=false
codesign/entitlements/app_sandbox/network_client=false
codesign/entitlements/app_sandbox/device_usb=false
codesign/entitlements/app_sandbox/device_bluetooth=false
codesign/entitlements/app_sandbox/files_downloads=0
codesign/entitlements/app_sandbox/files_pictures=0
codesign/entitlements/app_sandbox/files_music=0
codesign/entitlements/app_sandbox/files_movies=0
codesign/custom_options=PoolStringArray( )
notarization/enable=false
notarization/apple_id_name=""
notarization/apple_id_password=""
notarization/apple_team_id=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
18 changes: 12 additions & 6 deletions src/Data.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ var goldenIncrease = 0.000005
var goldenLength = 1
var goldenMagnitude = 1

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass

func start() -> void: # Loads starting loader
number_of_balls = 0
first = null
first_animation = null
cost = [0, 10, 50, 500, 4500, 60000, 590000]
earnings = [0, 10, 50, 400, 2500, 14000, 85000]
# Adds additional boxes
Expand Down Expand Up @@ -62,7 +61,10 @@ func start() -> void: # Loads starting loader
_data["goldenMagnitude"] = 1
_data["upgrades"] = {"ball" : _data["ball_upgrades"], "golden" : false}
_data["version"] = "v0.6.0"
if _data["version"] == "v0.6.0": # Loads the save
if _data["version"] == "v0.6.0":
_data["performance"] = {"Simulate" : 75, "Show" : 100, "Ball" : 9.5}
_data["version"] = "v0.6.1"
if _data["version"] == "v0.6.1": # Loads the save
goldenLength = _data["goldenLength"]
goldenMagnitude = _data["goldenMagnitude"]
goldenChance = _data["goldenChance"]
Expand All @@ -84,6 +86,9 @@ func start() -> void: # Loads starting loader
if greatest_box < x[1]:
greatest_box = x[1]
get_node("/root/Main/Game Field").call_deferred("add_child", _instance)
# Loads performance settings
for x in _data["performance"]:
get_node("/root/Main/TabContainer/Performance/" + x).value = _data["performance"][x]
else: # Runs info for when no save is found
goldenLength = 1
goldenMagnitude = 1
Expand Down Expand Up @@ -138,7 +143,8 @@ func save() -> void: # Used to save the game
"goldenChance" : goldenChance,
"goldenLength" : goldenLength,
"goldenMagnitude" : goldenMagnitude,
"version" : "v0.6.0"
"performance" : {"Simulate" : get_node("/root/Main/TabContainer/Performance/Simulate").value, "Show" : get_node("/root/Main/TabContainer/Performance/Show").value, "Ball" : get_node("/root/Main/TabContainer/Performance/Ball").value},
"version" : "v0.6.1"
})
file.store_string(_save_data)
file.close()
Expand Down
16 changes: 16 additions & 0 deletions src/Export.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends Control

func _ready() -> void:
var file = File.new()
file.open(Data.save_file, File.READ)
$Export.text = Marshalls.utf8_to_base64(file.get_as_text())

func _on_Return_button_up() -> void:
get_tree().change_scene("res://src/Loading.tscn")

func _on_Load_button_up() -> void:
var file = File.new()
file.open(Data.save_file, File.WRITE)
file.store_string(Marshalls.base64_to_utf8($Import.text))
file.close()
_on_Return_button_up()
77 changes: 77 additions & 0 deletions src/Export.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://src/Export.gd" type="Script" id=1]
[ext_resource path="res://assets/main_theme.tres" type="Theme" id=2]
[ext_resource path="res://assets/Bold.tres" type="Theme" id=3]

[node name="Export" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Label" type="Label" parent="."]
margin_left = 161.0
margin_right = 305.0
margin_bottom = 60.0
theme = ExtResource( 3 )
text = "Export"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Label2" type="Label" parent="."]
margin_left = 693.0
margin_right = 842.0
margin_bottom = 60.0
theme = ExtResource( 3 )
text = "Import"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Return" type="Button" parent="."]
margin_left = 149.0
margin_top = 540.0
margin_right = 333.0
margin_bottom = 577.0
text = "Return to Game"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Load" type="Button" parent="."]
margin_left = 695.0
margin_top = 540.0
margin_right = 879.0
margin_bottom = 577.0
text = "Load"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Export" type="TextEdit" parent="."]
margin_top = 70.0
margin_right = 500.0
margin_bottom = 520.0
readonly = true
wrap_enabled = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Import" type="TextEdit" parent="."]
margin_left = 524.0
margin_top = 70.0
margin_right = 1024.0
margin_bottom = 520.0
wrap_enabled = true
__meta__ = {
"_edit_use_anchors_": false
}

[connection signal="button_up" from="Return" to="." method="_on_Return_button_up"]
[connection signal="button_up" from="Load" to="." method="_on_Load_button_up"]
18 changes: 18 additions & 0 deletions src/Game Field.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
extends Node2D
var simulate = 1.0
var show = 1.0
var visibly = 0.0
var enabled = 0.0
var total = 0.0 setget changed
var disabledTotal = 0.0
signal update


func changed(value):
total = value
emit_signal("update")

func _on_Timer_timeout() -> void:
simulate = get_node("/root/Main/TabContainer/Performance/Simulate").value / 100.0
show = get_node("/root/Main/TabContainer/Performance/Show").value / 100.0
emit_signal("update")
18 changes: 9 additions & 9 deletions src/Golden.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ func _on_Button_button_up() -> void: # Starts the golden effect
$Button.hide()
timeText.show()
var _choice = _rng.randi_range(0, 4)
if _choice == 0: # A x7 multiplier for 77 seconds
time_left = ceil(77 * Data.goldenLength)
Data.multiplier = ceil(7 * Data.goldenMagnitude)
label.text = "x%s multiplier" % Data.multiplier
if _choice == 0:
time_left = ceil(7 * Data.goldenLength)
Data.multiplier = ceil(200 * Data.goldenMagnitude)
Data.speed_multiplier = 0.5
label.text = "x%s & 1/2 speed" % Data.multiplier
elif _choice == 1: # A x77 multiplier for 7 seconds
time_left = ceil(7 * Data.goldenLength)
Data.multiplier = ceil(77 * Data.goldenMagnitude)
Expand All @@ -39,11 +40,10 @@ func _on_Button_button_up() -> void: # Starts the golden effect
time_left = ceil(30 * Data.goldenLength)
label.text = "Duplicating Duplicators"
Data.duplicaters_duplicate = true
elif _choice == 3:
time_left = ceil(33 * Data.goldenLength)
Data.speed_multiplier = ceil(3 * Data.goldenMagnitude)
Data.speed_multiplier = Data.speed_multiplier if Data.speed_multiplier < 10 else 10
label.text = "x%s Speed" % Data.speed_multiplier
elif _choice == 3: # A x7 multiplier for 77 seconds
time_left = ceil(77 * Data.goldenLength)
Data.multiplier = ceil(7 * Data.goldenMagnitude)
label.text = "x%s multiplier" % Data.multiplier
elif _choice == 4:
time_left = 3
var _money = Data.MPS * 500 * Data.goldenMagnitude
Expand Down
5 changes: 3 additions & 2 deletions src/Golden.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ texture = ExtResource( 1 )
[node name="Label" type="Label" parent="."]
visible = false
modulate = Color( 1, 0.843137, 0, 1 )
margin_left = -61.0
margin_left = -163.0
margin_top = -84.0
margin_right = 184.0
margin_right = 489.0
margin_bottom = -24.0
grow_horizontal = 2
rect_scale = Vector2( 0.5, 0.5 )
theme = ExtResource( 2 )
text = "Hello"
Expand Down
2 changes: 1 addition & 1 deletion src/Loading.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func _ready() -> void:
file.open(Data.save_file, File.READ)
if validate_json(file.get_as_text()) == "":
var _data = parse_json(file.get_as_text())
if _data["version"] in ["v0.5.0", "v0.5.1", "v0.5.2", "v0.6.0"]:
if _data["version"] in ["v0.5.0", "v0.5.1", "v0.5.2", "v0.6.0", "v0.6.1"]:
$Save.visible = true
$Timer.start()
else:
Expand Down
10 changes: 7 additions & 3 deletions src/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ func _on_Save_Button_button_up() -> void:

func _process(delta: float) -> void: # Checks if a button is pressed to change menu
if Input.is_action_just_pressed("menu1"):
_tab.current_tab = 0
elif Input.is_action_just_pressed("menu2"):
_tab.current_tab = 1
elif Input.is_action_just_pressed("menu3"):
elif Input.is_action_just_pressed("menu2"):
_tab.current_tab = 2
elif Input.is_action_just_pressed("menu3"):
_tab.current_tab = 3

func _on_Export_button_up() -> void:
Data.save()
get_tree().change_scene("res://src/Export.tscn")
Loading

0 comments on commit 669ecd9

Please sign in to comment.