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/2025S1/paillo_dice/capa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://cqekrh5c0f2xo"
path="res://.godot/imported/capa.png-526adc8f4efc58507da3284b33749be8.ctex"
uid="uid://bcmma75tkuukb"
path="res://.godot/imported/capa.png-477dcac3f00efd70f47799a6affa1f59.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2025S1/seu_projeto/capa.png"
dest_files=["res://.godot/imported/capa.png-526adc8f4efc58507da3284b33749be8.ctex"]
source_file="res://microjogos/2025S1/paillo_dice/capa.png"
dest_files=["res://.godot/imported/capa.png-477dcac3f00efd70f47799a6affa1f59.ctex"]

[params]

Expand Down
23 changes: 23 additions & 0 deletions microjogos/2025S1/paillo_dice/cenas/dadometro.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
extends AnimatedSprite2D

const x_inicial = 283.5
const y_inicial = 848

func _ready() -> void:
position = Vector2(x_inicial, y_inicial)

func _process(delta: float) -> void:
var icon = get_node("../Node2D/Icon")
var dados = [get_node("../Node2D/Dado1"), get_node("../Node2D/Dado2"), get_node("../Node2D/Dado3")]
for dado in dados:
if icon.position == dado.position:
if Input.is_action_just_pressed("acao"):
play("rolls") #por 0.2 segundo
else:
play("static")
frame = dado.frame
else:
play("not_here")
# for dado in dados:
# if icon == dado:

1 change: 1 addition & 0 deletions microjogos/2025S1/paillo_dice/cenas/dadometro.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dyjuvoxgu0q8n
19 changes: 19 additions & 0 deletions microjogos/2025S1/paillo_dice/cenas/dados.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends AnimatedSprite2D

func _ready():
rotation_degrees = randi() % 360
var value = randi() % 2000
if value < 333:
frame = 0
elif value < 666:
frame = 1
elif value < 999:
frame = 2
elif value < 1332:
frame = 3
elif value < 1665:
frame = 4
elif value < 1998:
frame = 5
else:
frame = 8
1 change: 1 addition & 0 deletions microjogos/2025S1/paillo_dice/cenas/dados.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dleug5vwgnu4s
19 changes: 19 additions & 0 deletions microjogos/2025S1/paillo_dice/cenas/entidades.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends Node2D

const x_inicial = 645
const y_inicial = 300
const movimento = 127

var positions = []

func _ready():
var children = get_children()

for child in children:
var sobreposto = true
while sobreposto:
child.position.x = x_inicial + movimento * ( randi()%6 )
child.position.y = y_inicial + movimento * ( randi()%6 )
if Vector2(child.position.x, child.position.y) not in positions:
sobreposto = false
positions.append(Vector2(child.position.x, child.position.y))
1 change: 1 addition & 0 deletions microjogos/2025S1/paillo_dice/cenas/entidades.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bhyew2sgyr8cq
58 changes: 58 additions & 0 deletions microjogos/2025S1/paillo_dice/cenas/icon.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
extends Node2D

const x_inicial = 640
const y_inicial = 295
const movimento = 127
const distancia_max_dado = 5

@export var dados: Array[AnimatedSprite2D]

#posições x: 645, 772, 899, 1026, 1153, 1280
#posições y: 300, 427, 554, 681, 808, 935

var dadometro
var pode_mexer = true

func _ready():
dadometro = get_node("../../dadometro")

func _process(delta: float) -> void:
if not pode_mexer: return
posx()
posy()
var dado_colidido = false
for dado in dados:
if abs(dado.position.x - position.x) <= distancia_max_dado and abs(dado.position.y - position.y) <= distancia_max_dado:
dado_colidido = true
dadometro.show()

if Input.is_action_just_pressed("acao"):
dadometro.play("rolls")
if dado.frame > 0:
dado.frame -= 1
else:
dados.erase(dado)
dado.queue_free()
else:
if not dadometro.animation == "rolls" or not dadometro.is_playing():
dadometro.play("static")
dadometro.frame = dado.frame
if not dado_colidido:
dadometro.hide()
if len(dados) == 0:
dadometro.hide()
get_parent().get_parent().register_win()
pode_mexer = false


func posx():
if Input.is_action_just_pressed("direita") and position.x < 1280:
position.x += movimento
if Input.is_action_just_pressed("esquerda") and position.x > 645:
position.x -= movimento

func posy():
if Input.is_action_just_pressed("baixo") and position.y < 935:
position.y += movimento
if Input.is_action_just_pressed("cima") and position.y > 300:
position.y -= movimento
1 change: 1 addition & 0 deletions microjogos/2025S1/paillo_dice/cenas/icon.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dkitpcp7xinue
239 changes: 239 additions & 0 deletions microjogos/2025S1/paillo_dice/cenas/main.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
[gd_scene load_steps=36 format=3 uid="uid://djgr8pfav82d5"]

[ext_resource type="Script" uid="uid://bhyew2sgyr8cq" path="res://microjogos/2025S1/paillo_dice/cenas/entidades.gd" id="1_6mo7f"]
[ext_resource type="Texture2D" uid="uid://cd8e16xpqbk3t" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/tabuleiro2.png" id="1_ieclo"]
[ext_resource type="Script" uid="uid://b4es8881cyhmm" path="res://microjogos/2025S1/paillo_dice/cenas/scripts/main.gd" id="1_mkbwt"]
[ext_resource type="Texture2D" uid="uid://b66e5nnnnmg11" path="res://icon.png" id="1_npcfk"]
[ext_resource type="Texture2D" uid="uid://bglu5tqyqovn8" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/tabuleiro1.png" id="2_33gw0"]
[ext_resource type="Script" uid="uid://cpw87sybl8mia" path="res://microjogos/2025S1/paillo_dice/cenas/tabuleiro.gd" id="3_33gw0"]
[ext_resource type="Script" uid="uid://dkitpcp7xinue" path="res://microjogos/2025S1/paillo_dice/cenas/icon.gd" id="3_qa4ji"]
[ext_resource type="Texture2D" uid="uid://67jrvqgcsq2v" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado1.png" id="4_cqiw6"]
[ext_resource type="Texture2D" uid="uid://cp1obsjc8nxj4" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/diceanimated1.png" id="4_ut36f"]
[ext_resource type="Texture2D" uid="uid://cljwg0btj5vh0" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado2.png" id="5_aho0k"]
[ext_resource type="Texture2D" uid="uid://chbxdanwuoyyx" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/diceanimated2.png" id="5_lwvi1"]
[ext_resource type="Texture2D" uid="uid://2so124dqahm3" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado3.png" id="6_hdkc0"]
[ext_resource type="Texture2D" uid="uid://dqh3vtjcybdew" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/diceanimated3.png" id="6_mkbwt"]
[ext_resource type="Texture2D" uid="uid://cmlc50n7ubyyk" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado4.png" id="7_ieclo"]
[ext_resource type="Texture2D" uid="uid://cej2tnm8j3q01" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado5.png" id="8_33gw0"]
[ext_resource type="Texture2D" uid="uid://c66rhe0150ppx" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado6.png" id="9_ut36f"]
[ext_resource type="Texture2D" uid="uid://dg6xng2mkr7hl" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado7.png" id="10_lwvi1"]
[ext_resource type="Texture2D" uid="uid://34i4l2aiaics" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado8.png" id="11_mkbwt"]
[ext_resource type="Texture2D" uid="uid://njfa5cggy38e" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado9.png" id="12_etbqd"]
[ext_resource type="Texture2D" uid="uid://c7d2xvmoa4mey" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison1.png" id="16_17o5f"]
[ext_resource type="Script" uid="uid://dleug5vwgnu4s" path="res://microjogos/2025S1/paillo_dice/cenas/dados.gd" id="16_hdkc0"]
[ext_resource type="Texture2D" uid="uid://ct82pptnu14t3" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison2.png" id="17_bjo6a"]
[ext_resource type="Texture2D" uid="uid://b1qvnq5c3774b" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison3.png" id="18_fe2hn"]
[ext_resource type="Texture2D" uid="uid://4e8tj8f5wrs" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/dado0.png" id="18_mkbwt"]
[ext_resource type="Texture2D" uid="uid://bwtlm55c1mjwv" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison4.png" id="19_6vemf"]
[ext_resource type="Texture2D" uid="uid://cju3g0pu6grvl" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison5.png" id="20_e4ltu"]
[ext_resource type="Texture2D" uid="uid://cnre4g5t6jxk5" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison6.png" id="21_ror5a"]
[ext_resource type="Texture2D" uid="uid://d2ovmbrr68d1r" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison7.png" id="22_y42jl"]
[ext_resource type="Script" uid="uid://v7hi1ir0c8x0" path="res://microjogos/2025S1/paillo_dice/cenas/venenos.gd" id="24_aho0k"]
[ext_resource type="Texture2D" uid="uid://6gr12ynic48r" path="res://microjogos/2025S1/paillo_dice/recursos/imagens/poison8.png" id="27_etbqd"]
[ext_resource type="AudioStream" uid="uid://d26v7wtfsqkgx" path="res://microjogos/2025S1/paillo_dice/recursos/sons/ambiance.wav" id="31_etbqd"]

[sub_resource type="SpriteFrames" id="SpriteFrames_etbqd"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_33gw0")
}, {
"duration": 1.0,
"texture": ExtResource("1_ieclo")
}],
"loop": true,
"name": &"default",
"speed": 4.0
}]

[sub_resource type="SpriteFrames" id="SpriteFrames_sl2b6"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("18_mkbwt")
}],
"loop": true,
"name": &"not_here",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_ut36f")
}, {
"duration": 1.0,
"texture": ExtResource("5_lwvi1")
}, {
"duration": 3.0,
"texture": ExtResource("6_mkbwt")
}, {
"duration": 1.0,
"texture": ExtResource("4_ut36f")
}],
"loop": false,
"name": &"rolls",
"speed": 30.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_cqiw6")
}, {
"duration": 1.0,
"texture": ExtResource("5_aho0k")
}, {
"duration": 1.0,
"texture": ExtResource("6_hdkc0")
}, {
"duration": 1.0,
"texture": ExtResource("7_ieclo")
}, {
"duration": 1.0,
"texture": ExtResource("8_33gw0")
}, {
"duration": 1.0,
"texture": ExtResource("9_ut36f")
}, {
"duration": 1.0,
"texture": ExtResource("10_lwvi1")
}, {
"duration": 1.0,
"texture": ExtResource("11_mkbwt")
}, {
"duration": 1.0,
"texture": ExtResource("12_etbqd")
}],
"loop": true,
"name": &"static",
"speed": 5.0
}]

[sub_resource type="SpriteFrames" id="SpriteFrames_buvel"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_cqiw6")
}, {
"duration": 1.0,
"texture": ExtResource("5_aho0k")
}, {
"duration": 1.0,
"texture": ExtResource("6_hdkc0")
}, {
"duration": 1.0,
"texture": ExtResource("7_ieclo")
}, {
"duration": 1.0,
"texture": ExtResource("8_33gw0")
}, {
"duration": 1.0,
"texture": ExtResource("9_ut36f")
}, {
"duration": 1.0,
"texture": ExtResource("10_lwvi1")
}, {
"duration": 1.0,
"texture": ExtResource("11_mkbwt")
}, {
"duration": 1.0,
"texture": ExtResource("12_etbqd")
}],
"loop": true,
"name": &"values",
"speed": 5.0
}]

[sub_resource type="SpriteFrames" id="SpriteFrames_2qa26"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("16_17o5f")
}, {
"duration": 1.0,
"texture": ExtResource("17_bjo6a")
}, {
"duration": 1.0,
"texture": ExtResource("18_fe2hn")
}, {
"duration": 1.0,
"texture": ExtResource("19_6vemf")
}, {
"duration": 1.0,
"texture": ExtResource("20_e4ltu")
}, {
"duration": 1.0,
"texture": ExtResource("21_ror5a")
}, {
"duration": 1.0,
"texture": ExtResource("22_y42jl")
}, {
"duration": 1.0,
"texture": ExtResource("27_etbqd")
}],
"loop": true,
"name": &"poison",
"speed": 5.0
}]

[node name="Main" type="Node2D"]
texture_filter = 1
script = ExtResource("1_mkbwt")

[node name="Tabuleiro" type="AnimatedSprite2D" parent="."]
position = Vector2(960, 540)
sprite_frames = SubResource("SpriteFrames_etbqd")
frame_progress = 0.463792
script = ExtResource("3_33gw0")

[node name="dadometro" type="AnimatedSprite2D" parent="."]
position = Vector2(281, 849)
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_sl2b6")
animation = &"rolls"
frame_progress = 0.18256

[node name="Node2D" type="Node2D" parent="."]
script = ExtResource("1_6mo7f")

[node name="Dado1" type="AnimatedSprite2D" parent="Node2D"]
position = Vector2(1151, 558)
scale = Vector2(2.42143, 2.45)
sprite_frames = SubResource("SpriteFrames_buvel")
animation = &"values"
script = ExtResource("16_hdkc0")

[node name="Dado2" type="AnimatedSprite2D" parent="Node2D"]
position = Vector2(779, 429)
scale = Vector2(2.42143, 2.45)
sprite_frames = SubResource("SpriteFrames_buvel")
animation = &"values"
script = ExtResource("16_hdkc0")

[node name="Dado3" type="AnimatedSprite2D" parent="Node2D"]
position = Vector2(902, 687)
scale = Vector2(2.42143, 2.45)
sprite_frames = SubResource("SpriteFrames_buvel")
animation = &"values"
script = ExtResource("16_hdkc0")

[node name="Poison1" type="AnimatedSprite2D" parent="Node2D"]
position = Vector2(1152, 686)
scale = Vector2(2.3, 2.15714)
sprite_frames = SubResource("SpriteFrames_2qa26")
animation = &"poison"
script = ExtResource("24_aho0k")

[node name="Poison2" type="AnimatedSprite2D" parent="Node2D"]
position = Vector2(904, 815)
scale = Vector2(2.3, 2.15714)
sprite_frames = SubResource("SpriteFrames_2qa26")
animation = &"poison"
script = ExtResource("24_aho0k")

[node name="Icon" type="Sprite2D" parent="Node2D" node_paths=PackedStringArray("dados")]
position = Vector2(645, 300)
scale = Vector2(1.5, 1.372)
texture = ExtResource("1_npcfk")
script = ExtResource("3_qa4ji")
dados = [NodePath("../Dado1"), NodePath("../Dado3"), NodePath("../Dado2")]

[node name="Musica" type="AudioStreamPlayer" parent="."]
stream = ExtResource("31_etbqd")
Loading