Skip to content

Commit

Permalink
always use selected ball, not only when coming from shop
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Aug 12, 2024
1 parent e8121b1 commit 7cdf6a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion game/src/actors/ball/base-ball/Ball.gd
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ func _integrate_forces(state:PhysicsDirectBodyState) -> void:


func _on_Ball_mouse_entered() -> void:
print("select ball")
pass
# print("select ball")
18 changes: 12 additions & 6 deletions game/src/levels/base-level/LevelBase.gd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func _ready() -> void:

fade_in_objects()

_connect_ball_signals()
ball_setup()

star1.connect("star_hit",self,"on_star1_hit")
star2.connect("star_hit",self,"on_star2_hit")

Expand All @@ -57,16 +58,19 @@ func _ready() -> void:
func fade_in_objects() -> void:
for object in get_tree().get_nodes_in_group("objects"):
object.fade_in()



func fade_in_pop_objects() -> void:
for object in get_tree().get_nodes_in_group("pop-objects"):
object.fade_in()



func on_star1_hit() -> void:
level_complete.add_star()
AudioMachine.hit(false)
# _camera_shake()



func on_star2_hit() -> void:
level_complete.add_star()
AudioMachine.hit(false)
Expand All @@ -93,8 +97,10 @@ func _on_Shop_select() -> void:
# menu animations
shop.hide()
animation_player.play("GoToMenu")

# ball setup
ball_setup()


func ball_setup() -> void:
var pos:Transform = ball.initial_position
print("shop transform " + str(pos))
ball.queue_free()
Expand Down
1 change: 0 additions & 1 deletion game/src/screens/shop/Shop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func set_values(ball:RigidBody) -> void:
func _on_Back_pressed() -> void:
AudioMachine.click()
emit_signal("back")



func _on_Select_pressed() -> void:
Expand Down

0 comments on commit 7cdf6a6

Please sign in to comment.