Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gsscala's project #105

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bkvcg7ivmjl0d"
path="res://.godot/imported/capa.png-8a1b289eccd6e7f3202cf5a91f689be2.ctex"
path="res://.godot/imported/capa.png-567df73ba4572a3f5f6e1c70041bac79.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://microjogos/2024S1/seu_projeto/capa.png"
dest_files=["res://.godot/imported/capa.png-8a1b289eccd6e7f3202cf5a91f689be2.ctex"]
source_file="res://microjogos/2024S1/projeto-de-gsscala/capa.png"
dest_files=["res://.godot/imported/capa.png-567df73ba4572a3f5f6e1c70041bac79.ctex"]

[params]

Expand Down
11 changes: 11 additions & 0 deletions microjogos/2024S1/projeto-de-gsscala/cenas/ParallaxBackground.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends ParallaxBackground


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
scroll_base_offset -= Vector2(50,0)* delta
86 changes: 86 additions & 0 deletions microjogos/2024S1/projeto-de-gsscala/cenas/main.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
extends Node2D

signal win
signal lose

var index = 0
var combo_list = ["UD","UL","UR","UA","DL","DR","DA","LR","LA","RA"]

var translated_combos = []

var dicionario = {
"U" : "cima",
"D" : "baixo",
"A" : "acao",
"L" : "esquerda",
"R" : "direita"
}

# Called when the node enters the scene tree for the first time.
func _ready():

match Global.language:
Global.LANGUAGE.EN:
NotificationCenter.notify("MATCH THE COMBOS!")
Global.LANGUAGE.PT:
NotificationCenter.notify("ACERTE OS COMBOS!")
$"hero".play("default")
$"boss".play("default")
randomize()
combo_list.shuffle()

combo_list = combo_list.slice(0, 8)


for combo in combo_list:
var temp = []
for l in combo:
temp.append(dicionario.get(l))
translated_combos.append(temp)
update_animations()

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if index > 7:
return

if not false in translated_combos[index].map(func(x): return Input.is_action_pressed(x)):
index += 1
if index > 7:
register_win()
#TODO Remove Before PR merge
get_parent().get_tree().quit()
return

update_animations()



func register_win():
emit_signal("win")


func register_lose():
emit_signal("lose")

func update_animations():
if "esquerda" in translated_combos[index]:
$"arrow_left".play("true")
else:
$"arrow_left".play("false")
if "direita" in translated_combos[index]:
$"arrow_right".play("true")
else:
$"arrow_right".play("false")
if "cima" in translated_combos[index]:
$"arrow_up".play("true")
else:
$"arrow_up".play("false")
if "baixo" in translated_combos[index]:
$"arrow_down".play("true")
else:
$"arrow_down".play("false")
if "acao" in translated_combos[index]:
$"action".play("true")
else:
$"action".play("false")
Loading