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
Binary file added microjogos/2024S1/projeto-da-ana-luiza/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/2024S1/projeto-da-ana-luiza/capa.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bkvcg7ivmjl0d"
path="res://.godot/imported/capa.png-9f5f39968d2b7e4a0d674407439765a8.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2024S1/projeto-da-ana-luiza/capa.png"
dest_files=["res://.godot/imported/capa.png-9f5f39968d2b7e4a0d674407439765a8.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
40 changes: 40 additions & 0 deletions microjogos/2024S1/projeto-da-ana-luiza/cenas/estrela_amarela.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[gd_scene load_steps=6 format=3 uid="uid://dscq1spuoqur0"]

[ext_resource type="Script" uid="uid://btadh6b4sdnc0" path="res://microjogos/2024S1/projeto-da-ana-luiza/cenas/scripts/estrela_amarela.gd" id="1_oxbpl"]
[ext_resource type="Texture2D" uid="uid://befan316pn2nm" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/estrela_amarela.png" id="2_0lmnm"]
[ext_resource type="Texture2D" uid="uid://by2ykc65w1cmp" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/estrela_particles.png" id="2_j7vbq"]

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_3eqwi"]
rough = true
bounce = 5.0

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

[node name="EstrelaAmarela" type="RigidBody2D" groups=["star"]]
collision_layer = 2
collision_mask = 2
physics_material_override = SubResource("PhysicsMaterial_3eqwi")
script = ExtResource("1_oxbpl")

[node name="Head" type="Sprite2D" parent="."]
texture_filter = 3
scale = Vector2(4.5, 4.5)
texture = ExtResource("2_0lmnm")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_0lmnm")

[node name="Pivot" type="Node2D" parent="."]

[node name="EstrelaParticles" type="Sprite2D" parent="Pivot"]
texture_filter = 3
position = Vector2(1, -61)
scale = Vector2(4.375, 4.375)
texture = ExtResource("2_j7vbq")

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

[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
104 changes: 104 additions & 0 deletions microjogos/2024S1/projeto-da-ana-luiza/cenas/mafetotal.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[gd_scene load_steps=11 format=3 uid="uid://bxp45krk5k6wt"]

[ext_resource type="Texture2D" uid="uid://crfged8ec65r8" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/Mafe.png" id="2_725j0"]
[ext_resource type="AudioStream" uid="uid://6veda1tm1e2k" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/xmersounds-soft-treble-fast-collect-fade-out-ending-sound-effect-416828.wav" id="5_k8c8l"]

[sub_resource type="GDScript" id="GDScript_4q4xn"]
script/source = "extends CharacterBody2D


const SPEED = 1500.0

# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting(\"physics/2d/default_gravity\")


func _physics_process(delta):
# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta

# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction = Input.get_axis(\"esquerda\", \"direita\")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
move_and_slide()


func _on_area_2d_body_entered(body: PhysicsBody2D) -> void:
if body.is_in_group(\"star\"):
$\"Collect\".play()
body.queue_free()
"

[sub_resource type="AtlasTexture" id="AtlasTexture_qsnig"]
atlas = ExtResource("2_725j0")
region = Rect2(0, 0, 24, 34)

[sub_resource type="AtlasTexture" id="AtlasTexture_6v2ah"]
atlas = ExtResource("2_725j0")
region = Rect2(24, 0, 24, 34)

[sub_resource type="AtlasTexture" id="AtlasTexture_4q4xn"]
atlas = ExtResource("2_725j0")
region = Rect2(48, 0, 24, 34)

[sub_resource type="AtlasTexture" id="AtlasTexture_k8c8l"]
atlas = ExtResource("2_725j0")
region = Rect2(72, 0, 24, 34)

[sub_resource type="SpriteFrames" id="SpriteFrames_4812i"]
animations = [{
"frames": [{
"duration": 4.0,
"texture": SubResource("AtlasTexture_qsnig")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6v2ah")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4q4xn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k8c8l")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_3wopd"]
radius = 122.0
height = 338.0

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_t1n37"]
radius = 76.0
height = 280.0

[node name="CharacterBody2D" type="CharacterBody2D" groups=["player"]]
script = SubResource("GDScript_4q4xn")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 3
position = Vector2(0, -160)
scale = Vector2(10, 10)
sprite_frames = SubResource("SpriteFrames_4812i")
autoplay = "default"

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

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(0, -168)
shape = SubResource("CapsuleShape2D_3wopd")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -141)
shape = SubResource("CapsuleShape2D_t1n37")

[node name="Collect" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_k8c8l")

[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
132 changes: 132 additions & 0 deletions microjogos/2024S1/projeto-da-ana-luiza/cenas/main.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[gd_scene load_steps=15 format=3 uid="uid://bi0ahd7cv37i6"]

[ext_resource type="Script" uid="uid://v3gsxdydbc3q" path="res://microjogos/2024S1/projeto-da-ana-luiza/cenas/scripts/main.gd" id="1_l1y0h"]
[ext_resource type="Texture2D" uid="uid://cwe056qhc7fkw" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/FUNDO.png" id="2_h4vyi"]
[ext_resource type="PackedScene" uid="uid://bxp45krk5k6wt" path="res://microjogos/2024S1/projeto-da-ana-luiza/cenas/mafetotal.tscn" id="3_jer0v"]
[ext_resource type="Texture2D" uid="uid://cbo4w7a2r7xv7" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/Palco.png" id="3_lehno"]
[ext_resource type="Texture2D" uid="uid://bqk72p0lqnmj6" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/plateia.png" id="4_wl3pf"]
[ext_resource type="Texture2D" uid="uid://d0e6wuxscgwq1" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/holofote.png" id="5_joptk"]
[ext_resource type="AudioStream" uid="uid://dhigtx12xrm0q" path="res://microjogos/2024S1/projeto-da-ana-luiza/recursos/Dancing Queen song.wav" id="9_y3kfu"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_lehno"]
size = Vector2(1920, 50)

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_lehno"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_7yrij"]
size = Vector2(1920, 256)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_wjpbq"]
size = Vector2(60, 700)

[sub_resource type="Animation" id="Animation_lehno"]
resource_name = "move"
length = 2.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1, 2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(938, 710), Vector2(938, 690), Vector2(938, 710)]
}

[sub_resource type="Animation" id="Animation_d0rvo"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(938, 710)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_2y5b8"]
_data = {
&"RESET": SubResource("Animation_d0rvo"),
&"move": SubResource("Animation_lehno")
}

[node name="Palco" type="Node2D"]
script = ExtResource("1_l1y0h")

[node name="Background" type="Node2D" parent="."]

[node name="Background" type="Sprite2D" parent="Background"]
texture_filter = 3
scale = Vector2(1.92, 1.078)
texture = ExtResource("2_h4vyi")
centered = false

[node name="Palco" type="Sprite2D" parent="Background"]
texture_filter = 3
position = Vector2(960, 549)
scale = Vector2(10, 10)
texture = ExtResource("3_lehno")

[node name="L_Lamp" type="Sprite2D" parent="Background"]
texture_filter = 3
position = Vector2(410.177, 691.18)
scale = Vector2(0.739294, 0.70472)
texture = ExtResource("5_joptk")
flip_h = true

[node name="R_Lamp" type="Sprite2D" parent="Background"]
position = Vector2(1527, 691)
scale = Vector2(0.727445, 0.700628)
texture = ExtResource("5_joptk")

[node name="Mafe" parent="." instance=ExtResource("3_jer0v")]
position = Vector2(960, 800)

[node name="Deadzone" type="Area2D" parent="."]
position = Vector2(960, 800)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Deadzone"]
shape = SubResource("RectangleShape2D_lehno")

[node name="Walls" type="StaticBody2D" parent="."]
physics_material_override = SubResource("PhysicsMaterial_lehno")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls"]
position = Vector2(960, 953)
shape = SubResource("RectangleShape2D_7yrij")

[node name="CollisionShape2D3" type="CollisionShape2D" parent="Walls"]
position = Vector2(1920, 500)
shape = SubResource("RectangleShape2D_wjpbq")

[node name="CollisionShape2D2" type="CollisionShape2D" parent="Walls"]
position = Vector2(0, 500)
shape = SubResource("RectangleShape2D_wjpbq")

[node name="Plateia" type="Sprite2D" parent="."]
position = Vector2(938, 710)
scale = Vector2(2.02178, 1.84251)
texture = ExtResource("4_wl3pf")

[node name="AnimationPlayer" type="AnimationPlayer" parent="Plateia"]
libraries = {
&"": SubResource("AnimationLibrary_2y5b8")
}
autoplay = "move"

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

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("9_y3kfu")
autoplay = true

[connection signal="body_entered" from="Deadzone" to="." method="_on_area_2d_body_entered"]
[connection signal="timeout" from="Timer" to="." method="spawn_estrela"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends RigidBody2D

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
$Pivot.rotation = -global_rotation


func delete() -> void:
await get_tree().create_timer(0.5).timeout
queue_free()


func _on_timer_timeout() -> void:
collision_layer = 1
collision_mask = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://btadh6b4sdnc0
57 changes: 57 additions & 0 deletions microjogos/2024S1/projeto-da-ana-luiza/cenas/scripts/main.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
extends Node2D

# Declaração dos sinais win e lose
signal win
signal lose

# Estas constantes são usadas para determinar o tamanho da tela do seu jogo. Por padrão, definem uma
# tela 1920x1080, que é padrão para monitores full HD. Caso você queira uma resolução menor para
# atingir uma estética mais pixelada, você pode mudar estes números para qualquer outra resolução
# 16:9
const WIDTH = 1920
const HEIGHT = 1080

var cena_estrela = preload("res://microjogos/2024S1/projeto-da-ana-luiza/cenas/estrela_amarela.tscn")


# --------------------------------------------------------------------------------------------------
# FUNÇÕES PADRÃO
# --------------------------------------------------------------------------------------------------

# Esta função é chamada assim que esta cena é instanciada, ou seja, assim que seu minigame inicia
func _ready():
register_win()


# --------------------------------------------------------------------------------------------------
# CONDIÇÕES DE VITÓRIA
# --------------------------------------------------------------------------------------------------
# Quando o jogo começa, ela assume que o jogador não conseguiu vencer o jogo ainda, ou seja, se não
# acontecer nada, o jogador vai perder o jogo. A verificação se o jogador venceu o minigame é feita
# com base na emissão dos sinais "win" e "lose". Se "win" foi o último sinal emitido, o jogador
# vencerá o jogo, e se "lose" foi o último sinal emitido ou nenhum sinal foi emitido, o jogador
# perderá o jogo


# Chame esta função para registrar que o jogador venceu o jogo
func register_win():
emit_signal("win")


# Chame esta função para registrar que o jogador perdeu o jogo
func register_lose():
emit_signal("lose")


func spawn_estrela():
var estrela_nova : RigidBody2D = cena_estrela.instantiate()
estrela_nova.position.x = 960
estrela_nova.position.y = 800.0
estrela_nova.linear_velocity = Vector2(randf_range(-300, 300), -1400)
add_child(estrela_nova)


func _on_area_2d_body_entered(body: PhysicsBody2D) -> void:
if body.is_in_group("star"):
register_lose()
body.delete()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://v3gsxdydbc3q
Loading