Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions microjogos/2022S1/race/cenas/main.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
extends Node2D


signal win
signal lose

const WIDTH = 1920
const HEIGHT = 1080

var winnable = true
var losable = true

func _ready():
match Global.language:
Global.LANGUAGE.PT:
NotificationCenter.notify("VENCA A CORRIDA!")
Global.LANGUAGE.EN:
NotificationCenter.notify("WIN THE RACE!")

randomize()


func register_win():
if(winnable):
losable = false
get_node("VictorySFX").play()
emit_signal("win")

func register_lose():
if(losable):
winnable = false
losable = false
get_node("DefeatSFX").play()
emit_signal("lose")
1 change: 1 addition & 0 deletions microjogos/2022S1/race/cenas/main.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dh6jt40xiy334
4 changes: 2 additions & 2 deletions microjogos/2022S1/race/cenas/main.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[gd_scene load_steps=22 format=3 uid="uid://bg780bjjn3cse"]

[ext_resource type="Script" uid="uid://c4ylt7ddtsvus" path="res://microjogos/2022S1/race/cenas/Player.gd" id="1"]
[ext_resource type="Script" uid="uid://dh6jt40xiy334" path="res://microjogos/2022S1/race/cenas/main.gd" id="1_wijyh"]
[ext_resource type="Script" uid="uid://olki5tiweof3" path="res://microjogos/2022S1/race/cenas/camera.gd" id="2"]
[ext_resource type="Script" uid="uid://brnangyiatboe" path="res://microjogos/2022S1/race/cenas/caverna.gd" id="3"]
[ext_resource type="Script" uid="uid://d35gikftwiso5" path="res://microjogos/2022S1/race/cenas/Enemy.gd" id="4"]
[ext_resource type="Script" uid="uid://c8kay1pbs8ab1" path="res://microjogos/2022S1/race/cenas/Goal.gd" id="5"]
[ext_resource type="Script" uid="uid://caopud87pssfg" path="res://microjogos/2022S1/race/cenas/scripts/main.gd" id="6"]
[ext_resource type="Texture2D" uid="uid://ciue1sl1qo77s" path="res://microjogos/2022S1/race/recursos/ships.png" id="7"]
[ext_resource type="Texture2D" uid="uid://p562amfpcv0j" path="res://microjogos/2022S1/race/recursos/goal.png" id="8"]
[ext_resource type="AudioStream" uid="uid://bulvpol8sgnaq" path="res://microjogos/2022S1/race/recursos/171671__leszek-szary__success-1.wav" id="10"]
Expand Down Expand Up @@ -38,7 +38,7 @@ colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1)
size = Vector2(64, 700)

[node name="SeuJogo" type="Node2D"]
script = ExtResource("6")
script = ExtResource("1_wijyh")

[node name="Enemy" type="CharacterBody2D" parent="."]
position = Vector2(570, -4)
Expand Down
85 changes: 72 additions & 13 deletions microjogos/2022S1/race/cenas/scripts/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,84 @@ const HEIGHT = 1080
var winnable = true
var losable = true

@onready var anim_balde: AnimatedSprite2D = $AnimBalde
@onready var anim_vara: AnimatedSprite2D = $AnimVara

var v_posi_inic: Vector2

@onready var max_peixe: Sprite2D = $posimaxpeixe
@onready var peixe: Area2D = $Peixe
@onready var anzol: Area2D = $Anzol

var a_posi_inic: Vector2
var a_posi_now: Vector2
var p_posi_inic: Vector2
var p_posi_now: Vector2
var p_posi_max: Vector2

var speed = 2.5

func _ready():
anim_balde.play("default")
anim_vara.play("default")

v_posi_inic = anim_vara.position


a_posi_inic = anzol.position
a_posi_now = a_posi_inic

p_posi_inic = peixe.position
p_posi_max = max_peixe.position
p_posi_now = p_posi_max

match Global.language:
Global.LANGUAGE.PT:
NotificationCenter.notify("VENCA A CORRIDA!")
NotificationCenter.notify("MORDERAM A ISCA!")
Global.LANGUAGE.EN:
NotificationCenter.notify("WIN THE RACE!")
NotificationCenter.notify("A FISH!")

randomize()


func _process(delta: float) -> void:
if Input.is_action_just_pressed("baixo"):
get_tree().change_scene_to_file("res://microjogos/2022S1/Yhago_Gamelab/cenas/main.tscn")

if Input.is_action_just_pressed("acao"):
var new_a_posi: Vector2
new_a_posi.y = anzol.position.y - 128
a_posi_now = new_a_posi

if !Input.is_action_pressed("acao"):
a_posi_now.y = lerp(a_posi_now.y, a_posi_inic.y, delta * speed)

anzol.position.y = lerp(anzol.position.y, a_posi_now.y, delta * speed)

peixe.position.y = lerp(peixe.position.y, p_posi_now.y, delta * speed)

func register_win():
if(winnable):
losable = false
get_node("VictorySFX").play()
emit_signal("win")
func _on_peixe_timer_timeout() -> void:
p_posi_now.y = randf_range(p_posi_inic.y, p_posi_max.y)

func register_lose():
if(losable):
winnable = false
losable = false
get_node("DefeatSFX").play()
emit_signal("lose")

func _on_peixe_area_entered(area: Area2D) -> void:
emit_signal("win")
anim_vara.play("puxando")
anim_vara.position.y -= 180

match Global.language:
Global.LANGUAGE.PT:
NotificationCenter.notify("!")
Global.LANGUAGE.EN:
NotificationCenter.notify("!")

func _on_peixe_area_exited(area: Area2D) -> void:
emit_signal("lose")
anim_vara.play("default")
anim_vara.position = v_posi_inic

match Global.language:
Global.LANGUAGE.PT:
NotificationCenter.notify("X")
Global.LANGUAGE.EN:
NotificationCenter.notify("X")
Binary file added microjogos/2025S1/Yhago_Gamelab/capa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions microjogos/2025S1/Yhago_Gamelab/capa.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://sjmchmnlbr8g"
path="res://.godot/imported/capa.png-215b1b92cef23467ec16da3fa4af19db.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2025S1/Yhago_Gamelab/capa.png"
dest_files=["res://.godot/imported/capa.png-215b1b92cef23467ec16da3fa4af19db.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions microjogos/2025S1/Yhago_Gamelab/cenas/cenas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Coloque suas cenas aqui! A cena que vai rodar no jogo deve necessariamente ser a Main.tscn
158 changes: 158 additions & 0 deletions microjogos/2025S1/Yhago_Gamelab/cenas/main.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
[gd_scene load_steps=16 format=3 uid="uid://bxjif83b36oo2"]

[ext_resource type="Script" uid="uid://cc2nstc41ktlk" path="res://microjogos/2025S1/Yhago_Gamelab/cenas/scripts/main.gd" id="1_v35xu"]
[ext_resource type="Texture2D" uid="uid://doeedqotu75oi" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/gamuto.png" id="2_hwq0u"]
[ext_resource type="Texture2D" uid="uid://cpr4e8slkpk5b" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/peixe.png" id="2_v35xu"]
[ext_resource type="Texture2D" uid="uid://dodvdt3fkpvdl" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/anzol.png" id="3_1vj03"]
[ext_resource type="Texture2D" uid="uid://b71wdj0doay37" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/balde1.png" id="3_v35xu"]
[ext_resource type="Texture2D" uid="uid://dwxgjqcf68a27" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/balde2.png" id="4_1vj03"]
[ext_resource type="Texture2D" uid="uid://g8o3afvi3j8k" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/Spri1.png" id="5_djk22"]
[ext_resource type="Texture2D" uid="uid://b18q6ai0ky1uv" path="res://microjogos/2025S1/Yhago_Gamelab/recursos/images/Sprit2.png" id="6_xs200"]

[sub_resource type="CanvasTexture" id="CanvasTexture_s2chn"]

[sub_resource type="CanvasTexture" id="CanvasTexture_e0oyl"]

[sub_resource type="CanvasTexture" id="CanvasTexture_6ii3p"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_cnho3"]
size = Vector2(96, 161)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_uhi23"]
size = Vector2(64, 64)

[sub_resource type="SpriteFrames" id="SpriteFrames_wqsqo"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_v35xu")
}, {
"duration": 1.0,
"texture": ExtResource("4_1vj03")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

[sub_resource type="SpriteFrames" id="SpriteFrames_pf5al"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("5_djk22")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("6_xs200")
}],
"loop": true,
"name": &"puxando",
"speed": 5.0
}]

[node name="SeuJogo" type="Node2D"]
script = ExtResource("1_v35xu")

[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(0.364922, 0.640093, 0.921501, 1)
position = Vector2(962, 542)
scale = Vector2(1920, 1080)
texture = SubResource("CanvasTexture_s2chn")

[node name="TemplateBase7" type="Sprite2D" parent="."]
modulate = Color(0.890196, 0.329412, 0.596078, 1)
position = Vector2(1985, 454)
scale = Vector2(600, 600)
texture = SubResource("CanvasTexture_e0oyl")
offset = Vector2(-0.148809, -0.0426471)

[node name="TemplateBase" type="Sprite2D" parent="."]
modulate = Color(0.145098, 0.0666667, 0.0705882, 1)
position = Vector2(1625, 589)
scale = Vector2(168, 680)
texture = SubResource("CanvasTexture_e0oyl")
offset = Vector2(-0.148809, -0.0426471)

[node name="TemplateBase4" type="Sprite2D" parent="."]
modulate = Color(0.607843, 0.678431, 0.717647, 1)
position = Vector2(1600, 560)
scale = Vector2(160, 672)
texture = SubResource("CanvasTexture_e0oyl")

[node name="TemplateBase2" type="Sprite2D" parent="."]
position = Vector2(1600, 560)
scale = Vector2(132, 644)
texture = SubResource("CanvasTexture_e0oyl")

[node name="TemplateBase3" type="Sprite2D" parent="."]
modulate = Color(0.568627, 0.862745, 0.92549, 1)
position = Vector2(1600, 560)
scale = Vector2(128, 640)
texture = SubResource("CanvasTexture_e0oyl")

[node name="TemplateBase5" type="Sprite2D" parent="."]
modulate = Color(0.890196, 0.329412, 0.596078, 1)
position = Vector2(960, 900)
scale = Vector2(332, 180)
texture = SubResource("CanvasTexture_e0oyl")

[node name="TemplateBase6" type="Sprite2D" parent="."]
modulate = Color(0.890196, 0.329412, 0.596078, 1)
position = Vector2(315, 484)
scale = Vector2(420, 420)
texture = SubResource("CanvasTexture_e0oyl")

[node name="posimaxpeixe" type="Sprite2D" parent="."]
visible = false
modulate = Color(1, 0.32549, 1, 1)
position = Vector2(1601, 785)
scale = Vector2(96, 160)
texture = SubResource("CanvasTexture_6ii3p")

[node name="Peixe" type="Area2D" parent="."]
position = Vector2(1601, 314)

[node name="imagePeixe" type="Sprite2D" parent="Peixe"]
position = Vector2(0, 14)
texture = ExtResource("2_v35xu")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Peixe"]
position = Vector2(0, 14.5)
shape = SubResource("RectangleShape2D_cnho3")

[node name="Anzol" type="Area2D" parent="."]
position = Vector2(1601, 821)

[node name="ImageAnzol" type="Sprite2D" parent="Anzol"]
texture = ExtResource("3_1vj03")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Anzol"]
shape = SubResource("RectangleShape2D_uhi23")

[node name="AnimPersonagem" type="Sprite2D" parent="."]
position = Vector2(420, 560)
scale = Vector2(2.5, 2.5)
texture = ExtResource("2_hwq0u")

[node name="AnimBalde" type="AnimatedSprite2D" parent="."]
position = Vector2(960, 820)
scale = Vector2(2, 2)
sprite_frames = SubResource("SpriteFrames_wqsqo")
frame_progress = 0.555758

[node name="AnimVara" type="AnimatedSprite2D" parent="."]
position = Vector2(630, 531)
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_pf5al")
animation = &"puxando"

[node name="peixeTimer" type="Timer" parent="."]
autostart = true

[connection signal="area_entered" from="Peixe" to="." method="_on_peixe_area_entered"]
[connection signal="area_exited" from="Peixe" to="." method="_on_peixe_area_exited"]
[connection signal="timeout" from="peixeTimer" to="." method="_on_peixe_timer_timeout"]
Loading