Skip to content

Commit

Permalink
add fade effect to all scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Feb 14, 2024
1 parent 404fd34 commit 89b515b
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 143 deletions.
2 changes: 1 addition & 1 deletion game/assets/i18n/UltimateTossi18n.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ FOLLOW,follow,folge,segui,sigue
MORE_GAMES,games,spiele,giochi,juegos
NEXT,next,nächstes,prossimo,próximo
HELP,skip level,level übers.,salta livello,saltar nivel
HELP_INSTRUCTIONS,1. Get a friend's yellow code\n2. Put into red text box\n\nCodes regenerate at midnight!,1. Besorg dir ein gelben Code eines Freundes\n2. Gib ihn ins rote Textfeld\n\nDie Codes werden um Mitternacht erneuert!,1. Ottieni un codice giallo di un amico\n2. Mettilo nella casella di testo rossa\n\nI codici si rigenerano a mezzanotte!,1. Consigue un código amarillo de un amigo\n2. Ponelo en la caja de texto roja\n\nLos códigos se regeneran a medianoche!
HELP_INSTRUCTIONS,1. Get a friend's yellow code\n2. Put into red text box\n\nCodes regenerate at midnight!,1. Besorg dir ein gelben Code eines Freundes\n2. Gib ihn ins rote Textfeld ein\n\nCodes werden um Mitternacht erneuert!,1. Ottieni un codice giallo di un amico\n2. Mettilo nella casella di testo rossa\n\nI codici si rigenerano a mezzanotte!,1. Consigue un código amarillo de un amigo\n2. Ponelo en la caja de texto roja\n\nLos códigos se regeneran a medianoche!
PASTE,code,Kode,codice,codigo
Binary file modified game/assets/i18n/UltimateTossi18n.de.translation
Binary file not shown.
Binary file modified game/assets/i18n/UltimateTossi18n.en.translation
Binary file not shown.
Binary file modified game/assets/i18n/UltimateTossi18n.es.translation
Binary file not shown.
Binary file modified game/assets/i18n/UltimateTossi18n.it.translation
Binary file not shown.
46 changes: 0 additions & 46 deletions game/grabber-style.tres

This file was deleted.

3 changes: 1 addition & 2 deletions game/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ _global_script_class_icons={

config/name="Ball2Box"
run/main_scene="res://src/screens/splah/SplashScreen.tscn"
boot_splash/image="res://splash.png"
boot_splash/bg_color=Color( 0.105882, 0.105882, 0.231373, 1 )
config/icon="res://icon.png"

Expand Down Expand Up @@ -58,7 +57,7 @@ pointing/emulate_touch_from_mouse=true

[locale]

test="es"
test="de"
translations=PoolStringArray( "res://assets/i18n/UltimateTossi18n.de.translation", "res://assets/i18n/UltimateTossi18n.en.translation", "res://assets/i18n/UltimateTossi18n.es.translation", "res://assets/i18n/UltimateTossi18n.it.translation" )

[physics]
Expand Down
Binary file removed game/splash.png
Binary file not shown.
35 changes: 0 additions & 35 deletions game/splash.png.import

This file was deleted.

43 changes: 43 additions & 0 deletions game/src/fade-effect/FadeEffect.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2023 Simon Dalvai <info@simondalvai.org>

# SPDX-License-Identifier: AGPL-3.0-or-later

extends Tween

const DURATON:float = 0.2

export var node_path:NodePath
export var node_path2:NodePath

var node:Node
var node2:Node

func _ready() -> void:
if node_path:
node = get_node(node_path)

if node_path2:
node2 = get_node(node_path2)

if node:
node.modulate = Color(1, 1, 1, 0)
node.connect("visibility_changed", self, "fade_in")
if node2:
node2.modulate = Color(1, 1, 1, 0)
node2.connect("visibility_changed", self, "fade_in")


fade_in()


func fade_in() -> void:
if node:
interpolate_property(node, "modulate",
Color(1, 1, 1, 0), Color(1, 1, 1, 1), DURATON,
Tween.TRANS_LINEAR, Tween.EASE_IN)
start()
if node2:
interpolate_property(node2, "modulate",
Color(1, 1, 1, 0), Color(1, 1, 1, 1), DURATON,
Tween.TRANS_LINEAR, Tween.EASE_IN)
start()
6 changes: 6 additions & 0 deletions game/src/fade-effect/FadeEffect.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://src/fade-effect/FadeEffect.gd" type="Script" id=1]

[node name="FadeEffect" type="Tween"]
script = ExtResource( 1 )
6 changes: 5 additions & 1 deletion game/src/screens/help/Help.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://src/screens/help/Help.gd" type="Script" id=1]
[ext_resource path="res://assets/paste.svg" type="Texture" id=2]
[ext_resource path="res://assets/copy.svg" type="Texture" id=3]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=4]

[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.960784, 0.94902, 0.301961, 1 )
Expand All @@ -16,6 +17,9 @@ anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )

[node name="FadeEffect" parent="." instance=ExtResource( 4 )]
node_path = NodePath("..")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
Expand Down
6 changes: 5 additions & 1 deletion game/src/screens/info/Info.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://theme.tres" type="Theme" id=1]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/screens/info/Info.gd" type="Script" id=3]

[sub_resource type="StyleBoxFlat" id=1]
Expand All @@ -21,6 +22,9 @@ __meta__ = {
"_edit_use_anchors_": true
}

[node name="FadeEffect" parent="." instance=ExtResource( 2 )]
node_path = NodePath("..")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
Expand Down
7 changes: 5 additions & 2 deletions game/src/screens/level-complete/LevelComplete.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://theme.tres" type="Theme" id=1]
[ext_resource path="res://src/screens/level-complete/LevelComplete.gd" type="Script" id=2]
[ext_resource path="res://assets/star.png" type="Texture" id=3]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=4]

[node name="LevelComplete" type="Control"]
pause_mode = 2
Expand All @@ -11,6 +12,9 @@ anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )

[node name="FadeEffect" parent="." instance=ExtResource( 4 )]
node_path = NodePath("..")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
Expand All @@ -26,7 +30,6 @@ alignment = 1
margin_top = 65.0
margin_right = 475.0
margin_bottom = 183.0
rect_scale = Vector2( 2, 2 )
rect_pivot_offset = Vector2( 237, 59 )
text = "12"
align = 1
Expand Down
6 changes: 5 additions & 1 deletion game/src/screens/level-select/LevelSelect.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]

[ext_resource path="res://theme.tres" type="Theme" id=1]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/screens/level-select/LevelSelect.gd" type="Script" id=4]

[node name="LevelSelect" type="Control"]
Expand All @@ -10,6 +11,9 @@ anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 4 )

[node name="FadeEffect" parent="." instance=ExtResource( 2 )]
node_path = NodePath("..")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
Expand Down
5 changes: 1 addition & 4 deletions game/src/screens/main/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ signal levels
signal info
signal help

onready var animation_player:AnimationPlayer = $AnimationPlayer

func _ready() -> void:
$Buttons/Settings/MusicButton.pressed = Global.music
$Buttons/Settings/SfxButton.pressed = Global.sfx
Expand All @@ -27,7 +25,6 @@ func _on_InfoButton_pressed() -> void:

func _on_Info_back() -> void:
AudioMachine.click()
animation_player.play("InfoFadeOut")


func _on_SimonDalvai_pressed() -> void:
Expand Down Expand Up @@ -55,6 +52,6 @@ func _on_Help_pressed() -> void:
emit_signal("help")



func _on_LevelControl_levels() -> void:
emit_signal("levels")

53 changes: 6 additions & 47 deletions game/src/screens/main/Main.tscn
Original file line number Diff line number Diff line change
@@ -1,49 +1,19 @@
[gd_scene load_steps=16 format=2]
[gd_scene load_steps=15 format=2]

[ext_resource path="res://assets/font/manrope.thin.otf" type="DynamicFontData" id=1]
[ext_resource path="res://theme.tres" type="Theme" id=2]
[ext_resource path="res://assets/musicOff.png" type="Texture" id=3]
[ext_resource path="res://src/screens/main/Main.gd" type="Script" id=4]
[ext_resource path="res://panel.tres" type="StyleBox" id=5]
[ext_resource path="res://styles/panel.tres" type="StyleBox" id=5]
[ext_resource path="res://assets/github.svg" type="Texture" id=6]
[ext_resource path="res://src/ui/level-control/LevelControl.tscn" type="PackedScene" id=7]
[ext_resource path="res://assets/musicOn.png" type="Texture" id=8]
[ext_resource path="res://src/ui/toggle-button/ToggleButton.tscn" type="PackedScene" id=9]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=10]
[ext_resource path="res://assets/audioOn.png" type="Texture" id=11]
[ext_resource path="res://assets/audioOff.png" type="Texture" id=12]
[ext_resource path="res://assets/information.png" type="Texture" id=13]

[sub_resource type="Animation" id=3]
resource_name = "FirstFadeIn"
length = 1.2
tracks/0/type = "value"
tracks/0/path = NodePath("Fade:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.4, 0.7, 1.2 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 0 ) ]
}

[sub_resource type="Animation" id=12]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Fade:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ) ]
}

[sub_resource type="DynamicFont" id=13]
size = 53
outline_size = 3
Expand All @@ -60,20 +30,6 @@ rect_pivot_offset = Vector2( 360, 640 )
theme = ExtResource( 2 )
script = ExtResource( 4 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/FirstFadeIn = SubResource( 3 )
anims/RESET = SubResource( 12 )

[node name="Fade" type="ColorRect" parent="."]
modulate = Color( 1, 1, 1, 0 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 11.0
margin_top = 19.0
margin_right = 11.0
margin_bottom = 19.0
color = Color( 0.105882, 0.105882, 0.231373, 1 )

[node name="Buttons" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
Expand Down Expand Up @@ -204,6 +160,9 @@ size_flags_horizontal = 4
custom_fonts/font = SubResource( 13 )
text = "simondalvai.org"

[node name="FadeEffect" parent="." instance=ExtResource( 10 )]
node_path = NodePath("..")

[connection signal="levels" from="Buttons/LevelControl" to="." method="_on_LevelControl_levels"]
[connection signal="pressed" from="Buttons/Play" to="." method="_on_Play_pressed"]
[connection signal="pressed" from="Buttons/Help" to="." method="_on_Help_pressed"]
Expand Down
6 changes: 5 additions & 1 deletion game/src/screens/shop/Shop.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://theme.tres" type="Theme" id=1]
[ext_resource path="res://src/screens/shop/Shop.gd" type="Script" id=2]
[ext_resource path="res://src/fade-effect/FadeEffect.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/star.png" type="Texture" id=5]

[node name="Shop" type="Control"]
Expand All @@ -15,6 +16,9 @@ __meta__ = {
"_edit_use_anchors_": true
}

[node name="FadeEffect" parent="." instance=ExtResource( 3 )]
node_path = NodePath("..")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.568
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions game/theme.tres
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[ext_resource path="res://styles/button-pressed.tres" type="StyleBox" id=2]
[ext_resource path="res://assets/font/manrope.thin.otf" type="DynamicFontData" id=3]
[ext_resource path="res://styles/button-disabled.tres" type="StyleBox" id=4]
[ext_resource path="res://button-transparent.tres" type="StyleBox" id=5]
[ext_resource path="res://panel.tres" type="StyleBox" id=6]
[ext_resource path="res://styles/button-transparent.tres" type="StyleBox" id=5]
[ext_resource path="res://styles/panel.tres" type="StyleBox" id=6]

[sub_resource type="DynamicFont" id=9]
size = 85
Expand Down

0 comments on commit 89b515b

Please sign in to comment.