Skip to content

Commit

Permalink
Adicionando tween aos botões do pause.
Browse files Browse the repository at this point in the history
  • Loading branch information
victordomiciano committed Dec 6, 2015
1 parent 08ae9db commit 6ac7f94
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
10 changes: 6 additions & 4 deletions default.xscn
Expand Up @@ -182,9 +182,9 @@
<string> "flat" </string>
<string> "clip_text" </string>
<string> "quit" </string>
<string> "_colide_com_barra" </string>
<string> "body_enter" </string>
<string> "_colide_com_brick" </string>
<string> "body_enter" </string>
<string> "_colide_com_barra" </string>
</string_array>
<string> "node_count" </string>
<int> 22 </int>
Expand Down Expand Up @@ -319,9 +319,9 @@
<string> "Script" </string>
<dictionary shared="false">
<string> "current" </string>
<int> 1 </int>
<int> 4 </int>
<string> "sources" </string>
<array len="8" shared="false">
<array len="10" shared="false">
<string> "res://ball.gd" </string>
<string> "res://main.gd" </string>
<string> "res://bar.gd" </string>
Expand All @@ -330,6 +330,8 @@
<string> "res://sound_fx.gd" </string>
<string> "res://song.gd" </string>
<string> "res://green-brick.gd" </string>
<string> "res://resume.gd" </string>
<string> "res://quit_button.gd" </string>
</array>
</dictionary>
</dictionary>
Expand Down
2 changes: 1 addition & 1 deletion green-brick.gd
Expand Up @@ -18,7 +18,7 @@ func _ready():
var posicao = get_pos()
var random = 0.5 + randf()

tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y + 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)
tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y - 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)

tween.set_repeat(false)
tween.start()
Expand Down
2 changes: 2 additions & 0 deletions main.gd
Expand Up @@ -72,7 +72,9 @@ func _input(event):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
bg.set_opacity(0.5)
resume.show()
resume.tween()
quit.show()
quit.tween()
else:
var bar_pos = bar.get_pos()
get_tree().set_pause(false)
Expand Down
8 changes: 8 additions & 0 deletions quit_button.gd
Expand Up @@ -17,4 +17,12 @@ func _fixed_process(delta):
hover = 1
elif (not is_hovered()):
hover = 0

func tween():
var tween = get_node("../Tween")

tween.interpolate_method(self, "set_pos", Vector2(-331, 312), Vector2(226, 312), 1, Tween.TRANS_ELASTIC, Tween.EASE_OUT)

tween.set_repeat(false)
tween.start()

2 changes: 1 addition & 1 deletion red-brick.gd
Expand Up @@ -20,7 +20,7 @@ func _ready():
var posicao = get_pos()
var random = 0.5 + randf()

tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y + 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)
tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y - 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)

tween.set_repeat(false)
tween.start()
Expand Down
8 changes: 8 additions & 0 deletions resume.gd
Expand Up @@ -20,4 +20,12 @@ func _input_event(event):
var main = get_node("../")
hide()
main.resume()

func tween():
var tween = get_node("../Tween")

tween.interpolate_method(self, "set_pos", Vector2(800, 210), Vector2(226, 210), 1, Tween.TRANS_ELASTIC, Tween.EASE_OUT)

tween.set_repeat(false)
tween.start()

2 changes: 1 addition & 1 deletion yellow-brick.gd
Expand Up @@ -19,7 +19,7 @@ func _ready():

#falling level:

tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y + 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)
tween.interpolate_method(self, "set_pos", Vector2(posicao.x, posicao.y - 100), self.get_pos(), random, Tween.TRANS_ELASTIC, Tween.EASE_OUT)

tween.set_repeat(false)
tween.start()
Expand Down

0 comments on commit 6ac7f94

Please sign in to comment.