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
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/projeto_pedrovmc/Capa_Pedrovmc.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b7alhexk4ll7"
path="res://.godot/imported/Capa_Pedrovmc.png-12a582bafad57185fe22664cee93c279.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2025S1/projeto_pedrovmc/Capa_Pedrovmc.png"
dest_files=["res://.godot/imported/Capa_Pedrovmc.png-12a582bafad57185fe22664cee93c279.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
Binary file added microjogos/2025S1/projeto_pedrovmc/capat.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/projeto_pedrovmc/capat.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bjnqd3iygtsha"
path="res://.godot/imported/capat.png-956b8704de1a275716176009ce982e00.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2025S1/projeto_pedrovmc/capat.png"
dest_files=["res://.godot/imported/capat.png-956b8704de1a275716176009ce982e00.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
44 changes: 44 additions & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/arrow.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
extends Area2D

@onready var reflected = false
var enemy = ""
var vel = 500
var velocity = Vector2(0, 0)

func setEnemy(e):
enemy = e

func _physics_process(delta: float) -> void:

velocity = Vector2(vel,0).rotated(rotation)
position += velocity * delta

func _on_area_entered(area: Area2D) -> void:
if area.name.contains("Enemy") and reflected:
if area.name == "EnemyLeft":
$"../EnemyLeft".kill()
elif area.name == "EnemyUp":
$"../EnemyUp".kill()
elif area.name == "EnemyRight":
$"../EnemyRight".kill()
elif area.name == "EnemyDown":
$"../EnemyDown".kill()
queue_free()
elif area.name == "SwordCollision":
reflected = true
if enemy == "EnemyLeft":
look_at($"../EnemyLeft".position)
elif enemy == "EnemyUp":
look_at($"../EnemyUp".position)
elif enemy == "EnemyRight":
look_at($"../EnemyRight".position)
elif enemy == "EnemyDown":
look_at($"../EnemyDown".position)
pass


func _on_body_entered(body: Node2D) -> void:
if body.name == "Player" :
$"../Player".kill()
queue_free()
pass
1 change: 1 addition & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/arrow.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bu1fhoc7cyyoo
23 changes: 23 additions & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/arrow.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[gd_scene load_steps=4 format=3 uid="uid://ccosrq4t17klw"]

[ext_resource type="Texture2D" uid="uid://6tog3nshsqlu" path="res://microjogos/2025S1/projeto_pedrovmc/recursos/Tiny Swords (Update 010)/Factions/Knights/Troops/Archer/Arrow/Arrow.png" id="1_6m52h"]
[ext_resource type="Script" uid="uid://bu1fhoc7cyyoo" path="res://microjogos/2025S1/projeto_pedrovmc/cenas/arrow.gd" id="1_oqhj4"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qn4pi"]
size = Vector2(61, 14)

[node name="Arrow" type="Area2D"]
collision_layer = 9
script = ExtResource("1_oqhj4")

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_6m52h")
region_enabled = true
region_rect = Rect2(1, 28, 63, 14)

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

[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
2 changes: 2 additions & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/cenas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Coloque suas cenas aqui! A cena que vai rodar no jogo deve necessariamente ser a Main.tscn

44 changes: 44 additions & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/enemy.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
extends Area2D

var direcao
@onready var arrow = preload("res://microjogos/2025S1/projeto_pedrovmc/cenas/arrow.tscn")

func _ready() -> void:
init.call_deferred()

func init() -> void:
if direcao == "Right":
$EnemyAnimation.flip_h = true
$EnemyAnimation.play("idle")
pass

func setDirecao(dir) -> void:
direcao = dir
pass

func shoot() -> void:
if direcao == "Right" or direcao == "Left":
$EnemyAnimation.play("shoot")
elif direcao == "Up":
$EnemyAnimation.play("shoot_down")
elif direcao == "Down":
$EnemyAnimation.play("shoot_up")

await $EnemyAnimation.animation_finished

$EnemyAnimation.play("idle")
pass

func kill() -> void:
queue_free()
get_parent().register_win()
pass

func _on_enemy_animation_frame_changed() -> void:
if $EnemyAnimation.animation.contains("shoot") and $EnemyAnimation.frame == 6 :
var new_arrow = arrow.instantiate()
new_arrow.setEnemy(name)
new_arrow.position = position
new_arrow.look_at($"../Player".position)
get_parent().add_child(new_arrow)
pass # Replace with function body.
1 change: 1 addition & 0 deletions microjogos/2025S1/projeto_pedrovmc/cenas/enemy.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://vcjj61wb77ku
Loading