Skip to content

Commit

Permalink
Fim!
Browse files Browse the repository at this point in the history
Coloquei uma tela de game over
  • Loading branch information
DarknessCatt committed Jul 4, 2017
1 parent 9a0178f commit 4cf7a6b
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 11 deletions.
26 changes: 20 additions & 6 deletions godot/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ var state = 0 #usado para determinar o estado do jogo (começando = 2+, jogando
var set = 0 #usado para determinar o tempo da bola parada
var rightcor = 0 #usado para ver se a bola foi lançada com a cor correta
var parada = 0 #usado para parar a roleta
var pontosA = 0#putuação da barra Azul
var pontosV = 0#putuação da barra Vermelha
var ball #a bola
var trail #o rastro da bola
var roleta #a roleta
var explosao #particulas
var score #placar
var pontosA = 0#putuação da barra Azul
var pontosV = 0#putuação da barra Vermelha
var player #animationplayer

func setball(): #coloca a bola no meio
ball.set_global_pos(Vector2(512.5,300))
set = 0
rightcor = 0
parada = 0
roleta.roleta()
if(state!=0):
roleta.roleta()

func throw(): #prepara a direçao da bola baseada na roleta
var pos = roleta.getframe()
Expand Down Expand Up @@ -95,6 +97,7 @@ func _ready():
explosao = load("res://explosion.tscn")
trail = get_node("Ball/Particles2D")
score = get_node("ScoreBall")
player = get_node("Intro_End")
state = 6
randomize()
set_fixed_process(true)
Expand Down Expand Up @@ -132,11 +135,22 @@ func _fixed_process(delta):
pontosA = pontosA + 1
score.Blue(pontosA)
if(pontosA == 5):
get_tree().change_scene("res://AzulWin.tscn")
var label = get_node("Red_Label")
label.set_text("LOSE")
state = 0
player.play("End")
setball()
if(ball.get_global_pos() < Vector2(-200,0)):
pontosV = pontosV + 1
score.Red(pontosV)
if(pontosV == 5):
get_tree().change_scene("res://VermelhoWin.tscn")
setball()
var label = get_node("Blue_Label")
label.set_text("LOSE")
state = 0
player.play("End")
setball()
else:
state = state - delta
if(state < -7):
get_tree().change_scene("res://menu.tscn")

137 changes: 132 additions & 5 deletions godot/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=1]
[gd_scene load_steps=18 format=1]

[ext_resource path="res://main.gd" type="Script" id=1]
[ext_resource path="res://barraAzul.tscn" type="PackedScene" id=2]
Expand All @@ -12,6 +12,7 @@
[ext_resource path="res://Roleta.tscn" type="PackedScene" id=10]
[ext_resource path="res://background.tex" type="Texture" id=11]
[ext_resource path="res://ScoreBall.tscn" type="PackedScene" id=12]
[ext_resource path="res://Fonte.fnt" type="BitmapFont" id=13]

[sub_resource type="RectangleShape2D" id=1]

Expand All @@ -25,7 +26,73 @@ extents = Vector2( 185.818, 37.6098 )

[sub_resource type="Animation" id=3]

resource/name = "Start"
resource/name = "End"
length = 5.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("BarraAzul:visibility/visible")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = {
"times": FloatArray( 0, 1.7, 1.8, 1.9, 2, 2.3 ),
"transitions": FloatArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ true, false, true, false, true, false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("BarraVermelha:visibility/visible")
tracks/1/interp = 1
tracks/1/imported = false
tracks/1/keys = {
"times": FloatArray( 0, 1.7, 1.8, 1.9, 2, 2.3 ),
"transitions": FloatArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ true, false, true, false, true, false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Ball:visibility/visible")
tracks/2/interp = 1
tracks/2/imported = false
tracks/2/keys = {
"times": FloatArray( 0, 0.4, 0.8, 0.9, 1, 1.1, 3.2, 3.3, 3.4 ),
"transitions": FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ true, false, true, false, true, false, true, false, true ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Roleta:visibility/visible")
tracks/3/interp = 1
tracks/3/imported = false
tracks/3/keys = {
"times": FloatArray( 0, 2.5, 2.7, 2.8 ),
"transitions": FloatArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ true, false, true, false ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Blue_Label:visibility/visible")
tracks/4/interp = 1
tracks/4/imported = false
tracks/4/keys = {
"times": FloatArray( 0, 3.7, 3.8, 3.9 ),
"transitions": FloatArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ false, true, false, true ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Red_Label:visibility/visible")
tracks/5/interp = 1
tracks/5/imported = false
tracks/5/keys = {
"times": FloatArray( 0, 3.7, 3.8, 3.9 ),
"transitions": FloatArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ false, true, false, true ]
}

[sub_resource type="Animation" id=4]

length = 4.0
loop = false
step = 0.1
Expand Down Expand Up @@ -74,11 +141,31 @@ tracks/4/path = NodePath("background:visibility/visible")
tracks/4/interp = 1
tracks/4/imported = false
tracks/4/keys = {
"times": FloatArray( 0, 0.1, 0.2, 0.4 ),
"times": FloatArray( 0, 0.2, 0.3, 0.5 ),
"transitions": FloatArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ false, true, false, true ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Blue_Label:visibility/visible")
tracks/5/interp = 1
tracks/5/imported = false
tracks/5/keys = {
"times": FloatArray( 0 ),
"transitions": FloatArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Red_Label:visibility/visible")
tracks/6/interp = 1
tracks/6/imported = false
tracks/6/keys = {
"times": FloatArray( 0 ),
"transitions": FloatArray( 1 ),
"update": 1,
"values": [ false ]
}

[node name="YSort" type="YSort"]

Expand All @@ -87,12 +174,14 @@ script/script = ExtResource( 1 )

[node name="BarraAzul" parent="." instance=ExtResource( 2 )]

visibility/visible = false
transform/pos = Vector2( 47.7279, 300 )
transform/scale = Vector2( 0.513943, 0.513943 )
speed = 10

[node name="BarraVermelha" parent="." instance=ExtResource( 3 )]

visibility/visible = false
transform/pos = Vector2( 975, 300 )
transform/scale = Vector2( 0.513943, 0.513943 )
speed = 10
Expand Down Expand Up @@ -188,6 +277,7 @@ stream/buffering_ms = 500

[node name="Roleta" parent="." instance=ExtResource( 10 )]

visibility/visible = false
transform/pos = Vector2( 512.372, 299.098 )
transform/scale = Vector2( 0.35, 0.35 )
z/z = -2
Expand All @@ -205,17 +295,54 @@ texture = ExtResource( 11 )
transform/pos = Vector2( 512.5, 300 )
z/z = -4

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="Intro_End" type="AnimationPlayer" parent="."]

playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/Start = SubResource( 3 )
anims/End = SubResource( 3 )
anims/Start = SubResource( 4 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = "Start"

[node name="Blue_Label" type="Label" parent="."]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 50.0
margin/top = 300.0
margin/right = 233.0
margin/bottom = 350.0
custom_fonts/font = ExtResource( 13 )
custom_colors/font_color = Color( 0.298039, 0.882353, 0.882353, 1 )
text = "WIN"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[node name="Red_Label" type="Label" parent="."]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 800.0
margin/top = 300.0
margin/right = 1005.0
margin/bottom = 350.0
custom_fonts/font = ExtResource( 13 )
custom_colors/font_color = Color( 1, 0.239216, 0.239216, 1 )
text = "WIN"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[connection signal="finished" from="Intro" to="Repeat" method="_on_Intro_finished"]


0 comments on commit 4cf7a6b

Please sign in to comment.