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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.godot
/.import
/principal/saves/save.tres
/addons

20 changes: 20 additions & 0 deletions addons/microgame-testing/microgame-testing.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@tool
class_name MicrogameTestingUtil extends EditorPlugin

const CONFIG_PATH: StringName = "user://microgame-testing.cfg"

# Initialization of the plugin goes here.
func _enter_tree() -> void:
pass

func _exit_tree() -> void:
# Clean-up of the plugin goes here.
pass

func _enable_plugin() -> void:
# Add autoloads here.
add_autoload_singleton("TestOverlayRunner", "res://addons/microgame-testing/scripts/autoloads/overlay-runner.gd")

func _disable_plugin() -> void:
# Remove autoloads here.
remove_autoload_singleton("TestOverlayRunner")
1 change: 1 addition & 0 deletions addons/microgame-testing/microgame-testing.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://crxn7jj34pwma
7 changes: 7 additions & 0 deletions addons/microgame-testing/plugin.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[plugin]

name="GamutoWare Microgame Testing Utils"
description="Set of editor tools that simplify microgame testing"
author="https://github.com/grandeisa"
version=""
script="microgame-testing.gd"
48 changes: 48 additions & 0 deletions addons/microgame-testing/scripts/autoloads/overlay-runner.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
extends Node

const DEFAULT_MICROGAME_PATH: String = "res://microjogos"
const MICROGAME_OVERLAY_PATH = "res://principal/cenas/Jogo.tscn"

var current_microgame: MicrogameAsset = null

func _ready() -> void:
verify_microgame_main(get_tree().current_scene)

func verify_microgame_main(scene: Node) -> void:
var path = scene.scene_file_path

# False if node path is not in default microgame path
if not String(path).begins_with(DEFAULT_MICROGAME_PATH):
push_warning("Scene path (%s) does not begin with default microgame path (%s)" % [path, DEFAULT_MICROGAME_PATH])
return

# Attempt to find microgame in folder or parent
var microgame: MicrogameAsset = get_microgame_resource(path)
if not microgame:
push_warning("No microgame found at %s" % path)
return

add_display_with_microgame(microgame)

## Attempts to find a microgame resource file in the specified path folder or parenting folders
func get_microgame_resource(path: StringName) -> MicrogameAsset:
var dir_array: PackedStringArray = String(path).split("/")
var dir_path: String = "/".join(dir_array)

while dir_path.begins_with(DEFAULT_MICROGAME_PATH):
for file in DirAccess.get_files_at(dir_path):
var file_path = dir_path + "/" + file
if not file_path.ends_with(".tres"):
continue
if ResourceLoader.exists(file_path, "MicrogameAsset"):
var asset = ResourceLoader.load(file_path, "MicrogameAsset")
if asset is MicrogameAsset:
return asset

dir_array = dir_array.slice(0, len(dir_array) - 1)
dir_path = "/".join(dir_array)

return null

func add_display_with_microgame(microgame: MicrogameAsset) -> void:
Global.goto_scene_and_call(MICROGAME_OVERLAY_PATH, "setup_arcade_mode", [[microgame]])
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bi65u8xgbv7lt
2 changes: 1 addition & 1 deletion default_env.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="Environment" load_steps=2 format=3 uid="uid://cgfxcxe6jplva"]
[gd_resource type="Environment" format=3 uid="uid://cgfxcxe6jplva"]

[sub_resource type="Sky" id="1"]

Expand Down
2 changes: 1 addition & 1 deletion microjogos/2022S1/gamuturai/cenas/cenas.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Coloque suas cenas aqui! A cena que vai rodar no jogo deve necessariamente ser a Main.tscn
Coloque suas cenas aqui! A cena que vai rodar no jogo deve necessariamente ser a Main.tscn
24 changes: 11 additions & 13 deletions microjogos/2023S1/mail_cleaner/cenas/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://bwf53xp28gd35"]
[gd_scene format=3 uid="uid://bwf53xp28gd35"]

[ext_resource type="Script" uid="uid://c6l0ax4frv2ul" path="res://microjogos/2023S1/mail_cleaner/cenas/scripts/main.gd" id="1_kyp7x"]
[ext_resource type="PackedScene" uid="uid://dsxm54jv86dym" path="res://microjogos/2023S1/mail_cleaner/cenas/phone.tscn" id="2_mtjul"]
Expand Down Expand Up @@ -118,45 +118,43 @@ _data = {
&"background_movement": SubResource("Animation_gt1yq")
}

[node name="Main" type="Node2D"]
[node name="Main" type="Node2D" unique_id=315166068]
script = ExtResource("1_kyp7x")

[node name="Background" type="Sprite2D" parent="."]
[node name="Background" type="Sprite2D" parent="." unique_id=470889655]
modulate = Color(0.580392, 0.580392, 0.580392, 1)
texture_filter = 2
position = Vector2(980, 570)
rotation = -0.0566683
scale = Vector2(18, 18)
texture = ExtResource("2_ti7tx")

[node name="AnimationPlayer" type="AnimationPlayer" parent="Background"]
[node name="AnimationPlayer" type="AnimationPlayer" parent="Background" unique_id=1720170152]
libraries/ = SubResource("AnimationLibrary_vn30i")
speed_scale = 0.25
libraries = {
"": SubResource("AnimationLibrary_vn30i")
}

[node name="Phone" parent="." instance=ExtResource("2_mtjul")]
[node name="Phone" parent="." unique_id=154284354 instance=ExtResource("2_mtjul")]
position = Vector2(726, 121)

[node name="Right" type="Sprite2D" parent="."]
[node name="Right" type="Sprite2D" parent="." unique_id=160343912]
texture_filter = 1
position = Vector2(350, 540)
scale = Vector2(10, 10)
texture = ExtResource("4_vmscg")

[node name="Wrong" type="Sprite2D" parent="."]
[node name="Wrong" type="Sprite2D" parent="." unique_id=1743275317]
texture_filter = 1
position = Vector2(1580, 540)
scale = Vector2(10, 10)
texture = ExtResource("5_6vicc")

[node name="Music" type="AudioStreamPlayer" parent="."]
[node name="Music" type="AudioStreamPlayer" parent="." unique_id=1280436315]
stream = ExtResource("6_cxdmi")
autoplay = true

[node name="Scratch" type="AudioStreamPlayer" parent="."]
[node name="Scratch" type="AudioStreamPlayer" parent="." unique_id=1342274063]
stream = ExtResource("7_7gcfo")

[node name="Hit" type="AudioStreamPlayer" parent="."]
[node name="Hit" type="AudioStreamPlayer" parent="." unique_id=173311625]
stream = ExtResource("8_thm37")
volume_db = -2.0
2 changes: 1 addition & 1 deletion microjogos/2024S1/projeto-guilherme/recursos/gamuto.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=6 format=3 uid="uid://caljb66tgg5bn"]
[gd_resource type="SpriteFrames" format=3 uid="uid://caljb66tgg5bn"]

[ext_resource type="Texture2D" uid="uid://dip3yiadth6c7" path="res://microjogos/2024S1/projeto-guilherme/recursos/gamuto.png" id="1_xbji1"]
[ext_resource type="Texture2D" uid="uid://065x6nka203e" path="res://microjogos/2024S1/projeto-guilherme/recursos/gamuto_derrota.png" id="2_vuyk1"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=32 format=3 uid="uid://cxywvqakj73ah"]
[gd_resource type="SpriteFrames" format=3 uid="uid://cxywvqakj73ah"]

[ext_resource type="Texture2D" uid="uid://bio7c3ddlbkbp" path="res://microjogos/2024S1/projeto_felipe_onorio/recursos/test_spritesheet/flame_fluffy_2.00010.png" id="1_8phj6"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=32 format=3 uid="uid://bra6aicyrxshk"]
[gd_resource type="SpriteFrames" format=3 uid="uid://bra6aicyrxshk"]

[ext_resource type="Texture2D" uid="uid://cnkfmbdothtyi" path="res://microjogos/2024S1/projeto_felipe_onorio/recursos/test_spritesheet/flame_pixely.png" id="1_b6rgj"]

Expand Down
2 changes: 1 addition & 1 deletion microjogos/2024S1/projeto_felipe_onorio/cenas/leaf.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=32 format=3 uid="uid://bsrfju44fce2p"]
[gd_resource type="SpriteFrames" format=3 uid="uid://bsrfju44fce2p"]

[ext_resource type="Texture2D" uid="uid://b4tvg1m1baj7b" path="res://microjogos/2024S1/projeto_felipe_onorio/recursos/test_spritesheet/leaf_2.0.png" id="1_qrnxs"]

Expand Down
2 changes: 1 addition & 1 deletion microjogos/2024S1/projeto_felipe_onorio/cenas/watery.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=32 format=3 uid="uid://dqky6c1et2njd"]
[gd_resource type="SpriteFrames" format=3 uid="uid://dqky6c1et2njd"]

[ext_resource type="Texture2D" uid="uid://08kcmw5ayigj" path="res://microjogos/2024S1/projeto_felipe_onorio/recursos/test_spritesheet/watery_2.0.png" id="1_5jxi1"]

Expand Down
55 changes: 1 addition & 54 deletions microjogos/2025S1/Cookies/recursos/disable.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="VisualShader" load_steps=7 format=3 uid="uid://xhkqq21nsdcy"]
[gd_resource type="VisualShader" format=3 uid="uid://xhkqq21nsdcy"]

[sub_resource type="VisualShaderNodeBooleanParameter" id="VisualShaderNodeBooleanParameter_g275x"]
parameter_name = "Disabled"
Expand All @@ -21,59 +21,6 @@ op_type = 2
operator = 2

[resource]
code = "shader_type canvas_item;
render_mode blend_mix;

uniform bool Disabled;



void fragment() {
// BooleanParameter:3
bool n_out3p0 = Disabled;


// Input:6
vec4 n_out6p0 = COLOR;


// FloatConstant:8
float n_out8p0 = 0.500000;


// VectorOp:9
vec4 n_out9p0 = n_out6p0 * vec4(n_out8p0);


// Input:4
vec4 n_out4p0 = COLOR;


vec3 n_out5p0;
// If:5
float n_in5p1 = 1.00000;
float n_in5p2 = 0.00001;
if(abs((n_out3p0 ? 1.0 : 0.0) - n_in5p1) < n_in5p2)
{
n_out5p0 = vec3(n_out9p0.xyz);
}
else if((n_out3p0 ? 1.0 : 0.0) < n_in5p1)
{
n_out5p0 = vec3(n_out4p0.xyz);
}
else
{
n_out5p0 = vec3(n_out4p0.xyz);
}


// Output:0
COLOR.rgb = n_out5p0;


}
"
graph_offset = Vector2(-392.531, -85.3952)
mode = 1
flags/light_only = false
nodes/fragment/3/node = SubResource("VisualShaderNodeBooleanParameter_g275x")
Expand Down
47 changes: 1 addition & 46 deletions microjogos/2025S1/Cookies/recursos/hit.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="VisualShader" load_steps=5 format=3 uid="uid://qeh5h1c7ld6l"]
[gd_resource type="VisualShader" format=3 uid="uid://qeh5h1c7ld6l"]

[sub_resource type="VisualShaderNodeColorParameter" id="VisualShaderNodeColorParameter_xicxy"]
parameter_name = "ColorParameter"
Expand All @@ -15,51 +15,6 @@ default_input_values = [0, 0.0, 1, 1.0, 2, 1e-05, 3, Vector3(0, 0, 0), 4, Vector
input_name = "color"

[resource]
code = "shader_type canvas_item;
render_mode blend_mix;

uniform bool Enabled = false;
uniform vec4 ColorParameter : source_color = vec4(1.000000, 1.000000, 1.000000, 1.000000);



void fragment() {
// BooleanParameter:3
bool n_out3p0 = Enabled;


// ColorParameter:2
vec4 n_out2p0 = ColorParameter;


// Input:5
vec4 n_out5p0 = COLOR;


vec3 n_out4p0;
// If:4
float n_in4p1 = 1.00000;
float n_in4p2 = 0.00001;
if(abs((n_out3p0 ? 1.0 : 0.0) - n_in4p1) < n_in4p2)
{
n_out4p0 = vec3(n_out2p0.xyz);
}
else if((n_out3p0 ? 1.0 : 0.0) < n_in4p1)
{
n_out4p0 = vec3(n_out5p0.xyz);
}
else
{
n_out4p0 = vec3(n_out5p0.xyz);
}


// Output:0
COLOR.rgb = n_out4p0;


}
"
mode = 1
flags/light_only = false
nodes/fragment/2/node = SubResource("VisualShaderNodeColorParameter_xicxy")
Expand Down
11 changes: 5 additions & 6 deletions principal/cenas/Jogo.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
[ext_resource type="Texture2D" uid="uid://d1pcvjogk0whm" path="res://principal/recursos/sprites/GMTIconSpritesheet.png" id="1"]
[ext_resource type="Script" uid="uid://nuc4ey4h6jxi" path="res://principal/cenas/scripts/Jogo.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://wvr13kxa83wa" path="res://principal/recursos/sprites/Battery.png" id="3"]
[ext_resource type="Theme" uid="uid://n5yo736vdclg" path="res://principal/recursos/themes/GameTheme.tres" id="3_umkw3"]
[ext_resource type="Theme" uid="uid://coxyx4vc65o2x" path="res://principal/recursos/themes/GameTheme.tres" id="3_umkw3"]
[ext_resource type="Script" uid="uid://c5686qim2k0a0" path="res://principal/cenas/scripts/Bateria.gd" id="4"]
[ext_resource type="Script" uid="uid://bo1sbktvlmt0m" path="res://principal/cenas/scripts/Relogio.gd" id="6"]
[ext_resource type="Texture2D" uid="uid://cf6e7k0jprikg" path="res://principal/recursos/sprites/Cursor.png" id="7"]
[ext_resource type="Texture2D" uid="uid://d2g21riptaer" path="res://principal/recursos/sprites/GreenGameIcon.png" id="8"]
[ext_resource type="Texture2D" uid="uid://chkkxnuifd6go" path="res://principal/recursos/sprites/Game.png" id="9"]
[ext_resource type="Script" uid="uid://efo8g4tp4r2f" path="res://principal/cenas/scripts/Vida.gd" id="10"]
[ext_resource type="Theme" uid="uid://cb4tlwb81nq48" path="res://principal/recursos/themes/TitleTheme.tres" id="11_coplq"]
[ext_resource type="Theme" path="res://principal/recursos/themes/TitleTheme.tres" id="11_coplq"]
[ext_resource type="Texture2D" uid="uid://ctijuu2jh4eyo" path="res://principal/recursos/sprites/LifeSpritesheet.png" id="12"]
[ext_resource type="Texture2D" uid="uid://bwhscrkgcredi" path="res://principal/recursos/sprites/excitedParticles.png" id="14"]
[ext_resource type="Script" uid="uid://il22ucs6kg8r" path="res://principal/cenas/scripts/Droppable.gd" id="15"]
Expand Down Expand Up @@ -1508,11 +1508,10 @@ _data = {

[node name="Main" type="Node2D"]
script = ExtResource("2")
microgame_paths = ["res://microjogos/demo/frogger/cenas/main.tscn", "res://microjogos/demo/tiro_ao_alvo/cenas/main.tscn"]

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_6caji")
&"": SubResource("AnimationLibrary_6caji")
}

[node name="GameUI" type="Sprite2D" parent="."]
Expand Down Expand Up @@ -1609,17 +1608,17 @@ script = ExtResource("10")

[node name="AnimationPlayer" type="AnimationPlayer" parent="GameUI/Life"]
libraries = {
"": SubResource("AnimationLibrary_ortrc")
&"": SubResource("AnimationLibrary_ortrc")
}

[node name="GMTConfetti" type="CPUParticles2D" parent="GameUI"]
position = Vector2(0, 700)
emitting = false
amount = 32
texture = ExtResource("14")
lifetime = 5.0
one_shot = true
explosiveness = 0.7
texture = ExtResource("14")
emission_shape = 1
emission_sphere_radius = 100.0
direction = Vector2(0, -1)
Expand Down
4 changes: 2 additions & 2 deletions principal/cenas/Play.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[ext_resource type="Script" uid="uid://du0fi15vmv0gb" path="res://principal/cenas/scripts/Play.gd" id="1_qpmne"]
[ext_resource type="PackedScene" uid="uid://breiq50cu5612" path="res://principal/cenas/BG.tscn" id="2_8138u"]
[ext_resource type="Theme" uid="uid://dt5djib7huxvm" path="res://principal/recursos/themes/ButtonTheme.tres" id="6_wxsur"]
[ext_resource type="Theme" path="res://principal/recursos/themes/ButtonTheme.tres" id="6_wxsur"]
[ext_resource type="Script" uid="uid://i6y2mm407mm6" path="res://principal/cenas/scripts/TranslatableText.gd" id="7_hwa0h"]
[ext_resource type="Script" uid="uid://d3d5dcab6cyxj" path="res://principal/cenas/scripts/PressableButton.gd" id="8_ttu2n"]
[ext_resource type="Theme" uid="uid://v3d547aawndh" path="res://principal/recursos/themes/BodyTheme.tres" id="10_rybv5"]
[ext_resource type="Theme" path="res://principal/recursos/themes/BodyTheme.tres" id="10_rybv5"]
[ext_resource type="Script" uid="uid://blgobgb0ujtkr" path="res://principal/cenas/scripts/TransitionButton.gd" id="10_ukb4k"]

[node name="Play" type="Node2D"]
Expand Down
1 change: 0 additions & 1 deletion principal/microgame_asset.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ class_name MicrogameAsset
@export var main_scene: PackedScene

@export var difficulty: int

2 changes: 1 addition & 1 deletion principal/recursos/shaders/Diamond.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3]
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dhgwmuqlcucbr"]

[sub_resource type="Shader" id="3"]
code = "shader_type canvas_item;
Expand Down
4 changes: 2 additions & 2 deletions principal/recursos/themes/GameTheme.tres
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_resource type="Theme" load_steps=4 format=3]
[gd_resource type="Theme" load_steps=4 format=3 uid="uid://coxyx4vc65o2x"]

[ext_resource type="FontFile" path="res://principal/recursos/fonts/coolvetica/coolvetica rg.otf" id="1_ws0p3"]
[ext_resource type="FontFile" uid="uid://bh37fuggg4bip" path="res://principal/recursos/fonts/coolvetica/coolvetica rg.otf" id="1_ws0p3"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_horhx"]

Expand Down
Loading