1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00

FIX FIX FIX

This commit is contained in:
Steffo 2023-10-02 23:56:28 +02:00
parent 4f240e1c7f
commit c90b99a9b3
Signed by: steffo
GPG key ID: 2A24051445686895
3 changed files with 12 additions and 30 deletions

View file

@ -35,7 +35,7 @@ package/app_category=2
package/retain_data_on_uninstall=false
package/exclude_from_recents=false
launcher_icons/main_192x192="res://media/jar_icon.png"
launcher_icons/adaptive_foreground_432x432="res://media/jar_icon.png"
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/opengl_debug=false
xr_features/xr_mode=0

View file

@ -43,9 +43,6 @@ var can_place: bool:
## The last input event of the input that's dragging the ghost around, or null if the ghost isn't being dragged.
var last_input_event: InputEvent
## The last alternate input event.
var last_alternate_event: InputEvent
func _ready():
collision_mask = collision_mask_prevent_placement | collision_mask_delete_placement
@ -58,29 +55,7 @@ func _input(event: InputEvent):
last_input_event = event if event.pressed else null
# Handle touch begin
elif event is InputEventScreenTouch:
print("Event: ", event)
print("Last: ", last_input_event)
print("Alt: ", last_alternate_event)
if not last_input_event:
last_input_event = event if event.pressed else null
elif event.index == last_input_event.index:
last_input_event = event if event.pressed else null
last_alternate_event = null
else:
last_alternate_event = event if event.pressed else null
# If is pinching
if last_alternate_event:
if event.index == last_input_event.index:
var last_vector: Vector2 = last_alternate_event.position - last_input_event.position
var vector: Vector2 = last_alternate_event.position - event.position
var angle = vector.angle_to(last_vector)
rotation += angle
else:
var last_vector: Vector2 = last_alternate_event.position - last_input_event.position
var vector: Vector2 = event.position - last_input_event.position
var angle = vector.angle_to(last_vector)
rotation += angle
# If is dragging
elif last_input_event:
@ -95,8 +70,6 @@ func _input(event: InputEvent):
var delta = event.position - last_input_event.position
position += delta
last_input_event = event
else:
last_alternate_event = event
## Update the value of [can_place].
# DIRTY HACK: Relies on the placeable area being perfectly surrounded by solid bodies.

View file

@ -80,30 +80,36 @@ signal upgraded_auto_spawn(scene: PackedScene, period: float)
func _on_buy_auto_copper_purchase_success():
print("[ShopUI] Upgrading to Auto Copper * 2...")
upgraded_auto_spawn.emit(copper_coin_scene, 0.5)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoCopper.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyHeliCopper.has_unlocked = true
func _on_buy_heli_copper_purchase_success():
print("[ShopUI] Upgrading to Auto Copper * 8...")
upgraded_auto_spawn.emit(copper_coin_scene, 0.125)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyHeliCopper.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoSilver.has_unlocked = true
func _on_buy_auto_silver_purchase_success():
print("[ShopUI] Upgrading to Auto Silver * 2...")
upgraded_auto_spawn.emit(silver_coin_scene, 0.5)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoSilver.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuySuperSilver.has_unlocked = true
func _on_buy_super_silver_purchase_success():
print("[ShopUI] Upgrading to Auto Silver * 8...")
upgraded_auto_spawn.emit(silver_coin_scene, 0.125)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuySuperSilver.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoGold.has_unlocked = true
func _on_buy_auto_gold_purchase_success():
print("[ShopUI] Upgrading to Auto Gold * 2...")
upgraded_auto_spawn.emit(gold_coin_scene, 0.5)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyAutoGold.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyMidasTouch.has_unlocked = true
func _on_buy_midas_touch_purchase_success():
print("[ShopUI] Upgrading to Auto Gold * 8...")
$Rows/PaddedScrollable/Scrollable/ScrollableItems/ManualCategory/BuyMidasTouch.has_unlocked = false
upgraded_auto_spawn.emit(gold_coin_scene, 0.125)
@ -112,10 +118,13 @@ signal upgraded_manual_spawn(scene: PackedScene)
func _on_buy_silver_star_purchase_success():
print("[ShopUI] Upgrading to Manual Silver...")
upgraded_manual_spawn.emit(silver_coin_scene)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory/BuySilverStar.has_unlocked = false
$Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory/BuyGoldStar.has_unlocked = true
func _on_buy_gold_star_purchase_success():
print("[ShopUI] Upgrading to Manual Gold...")
upgraded_manual_spawn.emit(gold_coin_scene)
$Rows/PaddedScrollable/Scrollable/ScrollableItems/AutomaticCategory/BuyGoldStar.has_unlocked = false
signal ghost_materialize