Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
59
scripts/backround_scenes_scripts/Car.gd
Normal file
59
scripts/backround_scenes_scripts/Car.gd
Normal file
|
@ -0,0 +1,59 @@
|
|||
extends Node2D
|
||||
|
||||
const fadingTime = 0.8
|
||||
|
||||
|
||||
func _ready():
|
||||
if not get_tree().root.has_node("Root"):
|
||||
return ;
|
||||
|
||||
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
||||
dialogicNode.connect("dialogic_signal", self, "_crash_listener")
|
||||
|
||||
GallerySingleton.AddImage("Car");
|
||||
|
||||
var sfxPath = "res://resources/audio/sfx/12_1_ezdy na maschiny idet dojd.ogg"
|
||||
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func _crash_listener(string):
|
||||
match string:
|
||||
"crash":
|
||||
|
||||
$CrashBack.modulate = Color(1, 1, 1, 0)
|
||||
$Car2.modulate = Color(1, 1, 1, 0)
|
||||
$CrashBack.visible = true
|
||||
$Car2.visible = true
|
||||
$Tween.interpolate_property($View3d, "modulate", Color(1, 1, 1, 1), Color(1, 1, 1, 0), fadingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property($Car1, "modulate", Color(1, 1, 1, 1), Color(1, 1, 1, 0), fadingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property($Car2, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), fadingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property($CrashBack, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), fadingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.start()
|
||||
|
||||
|
||||
func _on_Tween_tween_all_completed():
|
||||
$View3D.visible = false
|
||||
$Car1.visible = false
|
||||
|
||||
|
||||
func InitForGallery()->Array:
|
||||
scale = Vector2(0.5, 0.5)
|
||||
return ["ui_gallery_car_crash"];
|
||||
|
||||
func SetToggleSettings(button):
|
||||
var state = button.pressed;
|
||||
if state:
|
||||
$View3D.visible = false;
|
||||
$Car1.visible = false;
|
||||
$CrashBack.visible = true;
|
||||
$Car2.visible = true;
|
||||
else :
|
||||
$View3D.visible = true;
|
||||
$Car1.visible = true;
|
||||
$CrashBack.visible = false;
|
||||
$Car2.visible = false;
|
Loading…
Add table
Add a link
Reference in a new issue