Skip to content

Commit

Permalink
Merge pull request #47 from tecMTST/abertura-nucleo
Browse files Browse the repository at this point in the history
Abertura-nucleo
  • Loading branch information
rodigu authored Jun 21, 2024
2 parents d7af017 + 68c56fd commit fa0b6b2
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 1 deletion.
Binary file added projeto/elementos/imagem/abertura/logo.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 added projeto/elementos/musica/bgm_vinheta.mp3
Binary file not shown.
Binary file added projeto/elementos/som/bolha_2.wav
Binary file not shown.
3 changes: 2 additions & 1 deletion projeto/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ _global_script_class_icons={
[application]

config/name="mtst-game-template"
run/main_scene="res://recursos/feed_de_noticias/feed_de_noticia.tscn"
run/main_scene="res://recursos/abertura/abertura.tscn"
config/icon="res://elementos/imagem/icon.png"

[autoload]
Expand All @@ -93,6 +93,7 @@ TrocadorDeCenas="*res://addons/trocador_de_cenas/trocador_de_cenas.tscn"

window/size/width=720
window/size/height=1280
window/handheld/orientation="portrait"
window/stretch/mode="2d"
window/stretch/aspect="expand"

Expand Down
15 changes: 15 additions & 0 deletions projeto/recursos/abertura/abertura.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends Control

export(PackedScene) var proxima_cena: PackedScene

func _ready() -> void:
$AnimationPlayer.play('abertura')
yield ($AnimationPlayer, 'animation_finished')
_pular_intro()

func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept"):
_pular_intro()

func _pular_intro() -> void:
TrocadorDeCenas.trocar_cena(proxima_cena.resource_path)
95 changes: 95 additions & 0 deletions projeto/recursos/abertura/abertura.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[gd_scene load_steps=7 format=2]

[ext_resource path="res://elementos/imagem/abertura/logo.png" type="Texture" id=1]
[ext_resource path="res://recursos/abertura/abertura.gd" type="Script" id=2]
[ext_resource path="res://recursos/feed_de_noticias/feed_de_noticia.tscn" type="PackedScene" id=3]
[ext_resource path="res://elementos/musica/bgm_vinheta.mp3" type="AudioStream" id=4]

[sub_resource type="Animation" id=2]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("AudioStreamPlayer:playing")
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": 1,
"values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CenterContainer/logo:rect_scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ) ]
}

[sub_resource type="Animation" id=1]
resource_name = "abertura"
length = 4.0
tracks/0/type = "value"
tracks/0/path = NodePath("AudioStreamPlayer:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( -0.1, 0, 3 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ false, true, false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CenterContainer/logo:rect_scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5, 1.5, 2.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ), Vector2( -1, 1 ), Vector2( 1, 1 ) ]
}

[node name="Abertura" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
proxima_cena = ExtResource( 3 )

[node name="ColorRect" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0.878431, 0, 0, 1 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 2 )
anims/abertura = SubResource( 1 )

[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0

[node name="logo" type="TextureRect" parent="CenterContainer"]
margin_left = 235.0
margin_top = 515.0
margin_right = 485.0
margin_bottom = 765.0
rect_min_size = Vector2( 250, 250 )
rect_scale = Vector2( 1e-05, 1e-05 )
rect_pivot_offset = Vector2( 125, 125 )
texture = ExtResource( 1 )
expand = true
stretch_mode = 6

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )
12 changes: 12 additions & 0 deletions projeto/recursos/jogos/enchente/jogador/Sons.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
extends AudioStreamPlayer

onready var sons = {
"agua": preload ("res://elementos/som/movimento_agua.wav"),
"dano": preload ("res://elementos/som/bolha_2.wav")
}

func _on_ControleFaixa3D_iniciou_movimento(_direcao, _alvo) -> void:
stop()
stream = sons.agua
play()


func _on_ControleFaixa3D_terminou_movimento() -> void:
yield(get_tree().create_timer(1.0), "timeout")
stop()

func _on_Vida_vida_alterada(alteracao: Vida.VidaAlterada) -> void:
if !alteracao.cura:
stop()
stream = sons.dano
play()
9 changes: 9 additions & 0 deletions projeto/recursos/jogos/enchente/jogador/playerLane3D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ func _on_ControladorArrasta_arrastado(chave):
print('a')
elif chave=='esquerda-0' or chave=='esquerda-1':
controle_faixa_3d.mover_esquerda()


func _on_AreaDano_body_entered(body: Node) -> void:
if body.is_in_group("obstaculo"):
vida.receber_dano(1.0)


func _on_Vida_vida_acabou() -> void:
TrocadorDeCenas.trocar_cena('res://recursos/feed_de_noticias/feed_de_noticia.tscn')
8 changes: 8 additions & 0 deletions projeto/recursos/jogos/enchente/jogador/playerLane3D.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ move_lock_z = true
script = ExtResource( 3 )

[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0 )
shape = SubResource( 1 )

[node name="Sprite3D" type="Sprite3D" parent="."]
Expand All @@ -45,7 +46,14 @@ autoplay = true
stream = ExtResource( 7 )
script = ExtResource( 8 )

[node name="AreaDano" type="Area" parent="."]

[node name="CollisionShape" type="CollisionShape" parent="AreaDano"]
shape = SubResource( 1 )

[connection signal="iniciou_movimento" from="ControleFaixa3D" to="Sons" method="_on_ControleFaixa3D_iniciou_movimento"]
[connection signal="terminou_movimento" from="ControleFaixa3D" to="Sons" method="_on_ControleFaixa3D_terminou_movimento"]
[connection signal="arrastado" from="ControladorArrasta" to="." method="_on_ControladorArrasta_arrastado"]
[connection signal="vida_acabou" from="Vida" to="." method="_on_Vida_vida_acabou"]
[connection signal="vida_alterada" from="Vida" to="Sons" method="_on_Vida_vida_alterada"]
[connection signal="body_entered" from="AreaDano" to="." method="_on_AreaDano_body_entered"]

0 comments on commit fa0b6b2

Please sign in to comment.