Skip to content

Commit

Permalink
end scene
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Cano committed Jul 15, 2016
1 parent 0ddbce0 commit 6c242d0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 30 deletions.
Binary file added ase/winner-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/ka16.fnt
Binary file not shown.
98 changes: 70 additions & 28 deletions end.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=5 format=1]
[gd_scene load_steps=6 format=1]

[ext_resource path="res://assets/end.png" type="Texture" id=1]
[ext_resource path="res://replay.gd" type="Script" id=2]
[ext_resource path="res://assets/game_over.png" type="Texture" id=3]
[ext_resource path="res://assets/ka16.fnt" type="Font" id=2]
[ext_resource path="res://replay.gd" type="Script" id=3]
[ext_resource path="res://ase/marcador.png" type="Texture" id=4]

[sub_resource type="Animation" id=1]

Expand All @@ -20,18 +21,18 @@ tracks/0/keys = { "cont":true, "times":FloatArray( 0, 0.5, 1 ), "transitions":Fl
texture = ExtResource( 1 )
centered = false

[node name="Label" type="Label" parent="."]
[node name="press play" type="Label" parent="."]

visibility/opacity = 0.44591
rect/scale = Vector2( 2, 2 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 123.0
margin/top = 253.0
margin/right = 330.0
margin/bottom = 285.0
margin/left = 197.0
margin/top = 280.0
margin/right = 456.0
margin/bottom = 312.0
custom_fonts/font = ExtResource( 2 )
text = "PRESS A TO PLAY AGAIN"
align = 1
valign = 1
Expand All @@ -40,7 +41,7 @@ lines_skipped = 0
max_lines_visible = -1
__meta__ = { "_editor_collapsed":true }

[node name="AnimationPlayer" type="AnimationPlayer" parent="Label"]
[node name="AnimationPlayer" type="AnimationPlayer" parent="press play"]

playback/process_mode = 1
playback/default_blend_time = 0.0
Expand All @@ -58,24 +59,25 @@ input/pickable = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
script/script = ExtResource( 2 )
script/script = ExtResource( 3 )

[node name="Sprite" type="Sprite" parent="."]

transform/pos = Vector2( 321.97, 108.793 )
texture = ExtResource( 3 )
transform/pos = Vector2( 326.211, 174.25 )
texture = ExtResource( 4 )

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

rect/scale = Vector2( 3, 3 )
rect/scale = Vector2( 1.5, 1.5 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 135.0
margin/top = 194.0
margin/right = 262.0
margin/bottom = 214.0
margin/left = 169.0
margin/top = 142.0
margin/right = 387.0
margin/bottom = 160.0
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.992188, 1, 0, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
custom_constants/shadow_offset_x = -1
Expand All @@ -89,22 +91,42 @@ percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[node name="Label 2" type="Label" parent="."]
[node name="points" type="Label" parent="."]

visibility/visible = false
rect/scale = Vector2( 5, 5 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 112.0
margin/top = 81.0
margin/right = 195.0
margin/bottom = 101.0
custom_colors/font_color = Color( 0.304688, 0.625183, 1, 1 )
margin/left = 237.0
margin/top = 177.0
margin/right = 413.0
margin/bottom = 206.0
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.988281, 0.953537, 0.953537, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
custom_constants/shadow_offset_x = 0
custom_constants/shadow_offset_y = 0
text = "0 points"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[node name="game over" type="Label" parent="."]

rect/scale = Vector2( 4, 4 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 0
size_flags/vertical = 0
margin/left = 90.0
margin/top = 27.0
margin/right = 209.0
margin/bottom = 48.0
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.304688, 0.625183, 1, 1 )
custom_colors/font_color_shadow = Color( 0.96875, 0.957397, 0.957397, 1 )
custom_constants/shadow_offset_x = 1
custom_constants/shadow_offset_y = 1
custom_constants/shadow_as_outline = 0
text = "GAME OVER"
align = 1
Expand All @@ -113,6 +135,26 @@ autowrap = true
uppercase = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = 2

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

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 164.0
margin/top = 243.0
margin/right = 491.0
margin/bottom = 272.0
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.78125, 0.805176, 1, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
text = "PLAYER 1 LOOSE - 0 points"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1


12 changes: 10 additions & 2 deletions replay.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ func _ready():

func _fixed_process(delta):
var control = get_node("/root/control")

var root = control.get_root()

var players_poinsts = control.get_players_poinsts()
var player1_points = players_poinsts.player1
var player2_points = players_poinsts.player2
var looser_player = ""

var winner_player = "No winners"
var winner_points = str(player1_points) + " points"

if player1_points > player2_points:
winner_player = "Winner Player 1"
winner_points = str(player1_points) + " points"
looser_player = "Player 2 loose! - " + str(player2_points) + " points"
elif player1_points < player2_points:
winner_player = "Winner Player 2"
winner_points = str(player2_points) + " points"
looser_player = "Player 1 loose! - " + str(player1_points) + " points"

var root = control.get_root()
root.get_node("points").set_text(winner_points)
root.get_node("winner").set_text(winner_player)
root.get_node("looser").set_text(looser_player)

delay -= 1;
if (Input.is_action_pressed("player1_main") || Input.is_action_pressed("player2_main")) && delay <= 0:
Expand Down

0 comments on commit 6c242d0

Please sign in to comment.