wea re cooking 🔥

This commit is contained in:
Tabby 2025-05-16 22:13:34 +10:00
parent 2b90112231
commit 34eb42616d
25 changed files with 247 additions and 77 deletions

View file

@ -1,8 +1,7 @@
extends Control
class_name Channel
signal channel_win
signal channel_lose
enum Mode{
Online,
@ -34,12 +33,12 @@ func _process(delta: float) -> void:
static_channel_cover.visible = channel_mode == Mode.Static
func start_channel():
var new_scene = channel_scene.instantiate()
game_viewport.add_child(new_scene)
channel_mode = Mode.Online
start_specific_channel(channel_scene)
func start_specific_channel(scene : PackedScene):
var new_scene = scene.instantiate()
new_scene.game_win.connect(win_channel)
new_scene.game_lose.connect(lose_channel)
game_viewport.add_child(new_scene)
channel_mode = Mode.Online
@ -54,9 +53,9 @@ func make_offline():
channel_mode = Mode.Offline
func win_channel():
channel_win.emit()
GameManager.channel_win.emit()
end_channel()
func lose_channel():
channel_lose.emit()
GameManager.channel_lose.emit()
end_channel()

View file

@ -7,6 +7,8 @@ enum Gamemode{
#mode settings
signal game_over(score : int)
@export var max_lives = 3
@export var lives = 3
@export var platformer_game : PackedScene
@ -23,15 +25,21 @@ enum Gamemode{
var gamemode : Gamemode = Gamemode.Story #will be set by manager/menu option
var zooming_out : bool = false
var gameplay : bool = false # becomes true when the game starts
var score : int = 0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.zoom_out_signal.connect(zoom_out)
GameManager.prepare.connect(get_ready)
GameManager.gaming.connect(start_game)
GameManager.channel_win.connect(rec_channel_win)
GameManager.channel_lose.connect(rec_channel_lose)
if(gamemode == Gamemode.Story):
main_camera.zoom = Vector2(3.1,3.1)
main_channel.start_specific_channel(platformer_game)
if(GameManager.are_we_skipping_intro):
main_camera.zoom = Vector2(1,1)
GameManager.skip_intro.emit()
# Called every frame. 'delta' is the elapsed time since the previous frame.
@ -69,7 +77,19 @@ func game_loop(delta : float):
else:
offline_channels.append(channel)
# if i need to switch a channel online, then pick one and run tis start channel method
print("Online Channels: " + str(online_channels.size()))
#print("Online Channels: " + str(online_channels.size()))
if(online_channels.size() < target_channels and offline_channels.size() > 0):
var random_channel_number = randi_range(0, offline_channels.size()-1)
offline_channels[random_channel_number].start_channel()
var random_game = randi_range(0, games.size()-1)
#offline_channels[random_channel_number].start_channel()
offline_channels[random_channel_number].start_specific_channel(games[random_game])
func rec_channel_win():
score += 1
GameManager.send_update_data(score, lives)
func rec_channel_lose():
lives -= 1
GameManager.send_update_data(score, lives)
if(lives <= 0):
game_over.emit()

View file

@ -8,8 +8,13 @@ signal show_chat_signal(String)
signal show_item_signal(String, Texture)
signal prepare
signal gaming
signal channel_win
signal channel_lose
signal update_data(score : int, lives : int)
signal skip_intro
@export var broken_tv_remote : Texture
var are_we_skipping_intro : bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@ -42,3 +47,6 @@ func prepare_for_gaming():
func actually_gaming():
gaming.emit()
func send_update_data(score : int, lives: int):
update_data.emit(score, lives)

View file

@ -1,8 +1,7 @@
[gd_scene load_steps=16 format=3 uid="uid://ct8axfbvd2wn4"]
[gd_scene load_steps=15 format=3 uid="uid://ct8axfbvd2wn4"]
[ext_resource type="Script" uid="uid://d2q6xfk8htbyy" path="res://game_logic.gd" id="1_j5hk1"]
[ext_resource type="PackedScene" uid="uid://63rik2noj8id" path="res://base modules/test_channel.tscn" id="1_mlf6e"]
[ext_resource type="PackedScene" uid="uid://ch1x8pfdu2b1g" path="res://test_game.tscn" id="2_mixcd"]
[ext_resource type="PackedScene" uid="uid://bw1hhx7lyfonr" path="res://games/asteroids/asteroids.tscn" id="3_mj2jn"]
[ext_resource type="PackedScene" uid="uid://ckbyiwy0dxbsd" path="res://games/platformer/platformer.tscn" id="4_mj2jn"]
[ext_resource type="PackedScene" uid="uid://b5lh8cnwu8xhg" path="res://games/ddr/ddr.tscn" id="5_e35lh"]
@ -53,7 +52,7 @@ columns = 3
[node name="Control" parent="GridContainer" instance=ExtResource("1_mlf6e")]
layout_mode = 2
channel_scene = ExtResource("2_mixcd")
channel_scene = ExtResource("7_6e45b")
[node name="Control2" parent="GridContainer" instance=ExtResource("1_mlf6e")]
layout_mode = 2

View file

@ -0,0 +1,13 @@
extends Node
signal game_win
signal game_lose
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View file

@ -0,0 +1 @@
uid://carkc2diu0xwd

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=7 format=3 uid="uid://bw1hhx7lyfonr"]
[gd_scene load_steps=8 format=3 uid="uid://bw1hhx7lyfonr"]
[ext_resource type="Script" uid="uid://brih2jftm2tsa" path="res://games/asteroids/ship_controller.gd" id="1_6dc0m"]
[ext_resource type="Script" uid="uid://carkc2diu0xwd" path="res://games/asteroids/asteroids.gd" id="1_j0tb1"]
[ext_resource type="Texture2D" uid="uid://dqorec3q3h3pp" path="res://sprites/asteroidsShip.png" id="2_j0tb1"]
[sub_resource type="Gradient" id="Gradient_6dc0m"]
@ -20,6 +21,7 @@ noise = SubResource("FastNoiseLite_j0tb1")
radius = 26.0192
[node name="Asteroids" type="Node"]
script = ExtResource("1_j0tb1")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 15

View file

@ -1,5 +1,8 @@
extends Node
signal game_win
signal game_lose
@export var code_length : int = 8
@export_group("Node References")
@ -49,7 +52,10 @@ func enter_number(number : int):
pick_new_number()
else:
#womp womp (lose channel)
game_lose.emit()
pass
if(numbers_typed >= code_length):
game_win.emit()
func pick_new_number():
var new_number = current_number

View file

@ -0,0 +1,13 @@
extends Node
signal game_win
signal game_lose
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View file

@ -0,0 +1 @@
uid://dld4egumb2u0o

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=7 format=3 uid="uid://cnpyrh4c6a7cg"]
[gd_scene load_steps=8 format=3 uid="uid://cnpyrh4c6a7cg"]
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_jfgig"]
[ext_resource type="Script" uid="uid://dld4egumb2u0o" path="res://games/bullet_hell/bullet_hell.gd" id="1_uvm3w"]
[ext_resource type="Script" uid="uid://c100m60xe4k3r" path="res://games/bullet_hell/bulletHellMovement.gd" id="1_x66ke"]
[sub_resource type="Gradient" id="Gradient_x66ke"]
@ -18,6 +19,7 @@ noise = SubResource("FastNoiseLite_uvm3w")
size = Vector2(38, 38)
[node name="BulletHell" type="Node"]
script = ExtResource("1_uvm3w")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 15

View file

@ -1,4 +1,8 @@
extends Node
signal game_win
signal game_lose
@export var keys : Array[String]
@export var time_limit : float = 25

View file

@ -1,5 +1,7 @@
extends Node
signal game_win
signal game_lose
@export var note_frequency : float = 2
@export var paths : Array[Node2D]

View file

@ -0,0 +1,29 @@
extends Node
signal game_win
signal game_lose
@export_group("Node References")
@export var score_label : Label
@export var player : CharacterBody2D
@export var skip_location : Marker2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.skip_intro.connect(rec_skip_intro)
GameManager.update_data.connect(update_ui)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func update_ui(score : int, lives :int):
score_label.text = str(score)
func rec_skip_intro():
#teleport player to doorway
player.global_position = skip_location.global_position
#maybe bring up an invis wall behind them but it doesnt matter
pass

View file

@ -0,0 +1 @@
uid://bs4keltwfbrrn

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=30 format=4 uid="uid://ckbyiwy0dxbsd"]
[gd_scene load_steps=32 format=4 uid="uid://ckbyiwy0dxbsd"]
[ext_resource type="Script" uid="uid://dqyddqx8xm0gw" path="res://games/platformer/player.gd" id="1_1wj3w"]
[ext_resource type="Script" uid="uid://bs4keltwfbrrn" path="res://games/platformer/platformer.gd" id="1_mauky"]
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_oyf6i"]
[ext_resource type="Texture2D" uid="uid://baf30tscdkl0i" path="res://sprites/tv_remote.png" id="2_7eu3u"]
[ext_resource type="Texture2D" uid="uid://g5arxk4po7kw" path="res://sprites/platformer_lab_tile.png" id="3_84mot"]
@ -57,6 +58,57 @@ size = Vector2(20, 150)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpnel"]
[sub_resource type="Animation" id="Animation_yphhh"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationProps/TVRemote:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(40, 272)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationProps/TVRemote:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimationProps/TVRemote:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimationProps/TVRemote:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_7gl5q"]
resource_name = "trip"
length = 0.8
@ -109,57 +161,6 @@ tracks/3/keys = {
"values": [false, true]
}
[sub_resource type="Animation" id="Animation_yphhh"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationProps/TVRemote:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(40, 272)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationProps/TVRemote:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimationProps/TVRemote:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimationProps/TVRemote:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mauky"]
_data = {
&"RESET": SubResource("Animation_yphhh"),
@ -180,7 +181,15 @@ animations = [{
"speed": 5.0
}]
[node name="Platformer" type="Node"]
[sub_resource type="LabelSettings" id="LabelSettings_yphhh"]
font_size = 86
font_color = Color(1, 1, 1, 0.439216)
[node name="Platformer" type="Node" node_paths=PackedStringArray("score_label", "player", "skip_location")]
script = ExtResource("1_mauky")
score_label = NodePath("Score")
player = NodePath("Player")
skip_location = NodePath("IntroSkipLocation")
[node name="Parallax2D" type="Parallax2D" parent="."]
scroll_scale = Vector2(0, 0)
@ -306,8 +315,21 @@ move_speed = 1000.0
position = Vector2(624, 152)
open_pos_y = 152.0
close_pos_y = 240.0
open = false
move_speed = 1000.0
[node name="Score" type="Label" parent="."]
offset_left = 208.0
offset_top = 160.0
offset_right = 432.0
offset_bottom = 279.0
text = "00"
label_settings = SubResource("LabelSettings_yphhh")
horizontal_alignment = 1
[node name="IntroSkipLocation" type="Marker2D" parent="."]
position = Vector2(-40, 256)
[connection signal="area_entered" from="Player/hitbox" to="Player" method="_on_hitbox_area_entered"]
[connection signal="area_entered" from="TheBitWhereYouTrip" to="TripAnimation" method="_on_the_bit_where_you_trip_area_entered"]
[connection signal="area_entered" from="BrokenRemote" to="AnimationProps/TVRemote" method="_on_broken_remote_area_entered"]

View file

@ -6,16 +6,17 @@ func _process(delta: float) -> void:
func start_specific_channel(scene : PackedScene):
var new_scene = scene.instantiate()
new_scene.game_win.connect(win_channel)
new_scene.game_lose.connect(lose_channel)
game_viewport.add_child(new_scene)
channel_mode = Mode.Online
func start_channel():
var new_scene = channel_scene.instantiate()
game_viewport.add_child(new_scene)
channel_mode = Mode.Online
start_specific_channel(channel_scene)
func end_channel():
channel_mode = Mode.Static
modulate = Color.DIM_GRAY
# TODO: a bunch of stuff here
## bro what did you mean when you meant this T_T
#game_viewport.get_child(0).queue_free()

View file

@ -1,5 +1,8 @@
extends Node
signal game_win
signal game_lose
@export var reaction_window : float = 1
@export_group("Node References")
@export var prepare_node : Control

View file

@ -0,0 +1,13 @@
extends Node
signal game_win
signal game_lose
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View file

@ -0,0 +1 @@
uid://0v0y62pyhpq4

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=9 format=3 uid="uid://bkabgl6p44c5b"]
[gd_scene load_steps=10 format=3 uid="uid://bkabgl6p44c5b"]
[ext_resource type="Texture2D" uid="uid://dqorec3q3h3pp" path="res://sprites/asteroidsShip.png" id="1_8m3yy"]
[ext_resource type="Script" uid="uid://c1e46eu5tbni0" path="res://games/space invaders/ship.gd" id="1_jsxp6"]
[ext_resource type="Script" uid="uid://0v0y62pyhpq4" path="res://games/space invaders/space_invaders.gd" id="1_k5cbn"]
[ext_resource type="Texture2D" uid="uid://by327tfhk6xrs" path="res://sprites/invadersBarrier.png" id="2_jsxp6"]
[sub_resource type="Gradient" id="Gradient_4laqq"]
@ -24,6 +25,7 @@ radius = 24.1868
size = Vector2(56, 28)
[node name="SpaceInvaders" type="Node"]
script = ExtResource("1_k5cbn")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 15

21
menu/menu.gd Normal file
View file

@ -0,0 +1,21 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_intro_button_pressed() -> void:
GameManager.are_we_skipping_intro = false
get_tree().change_scene_to_file("res://game_scene.tscn")
func _on_skip_button_pressed() -> void:
GameManager.are_we_skipping_intro = true
get_tree().change_scene_to_file("res://game_scene.tscn")

1
menu/menu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://bjkqa4cowhacd

View file

@ -1,4 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://0ajx46iu2l51"]
[gd_scene load_steps=4 format=3 uid="uid://0ajx46iu2l51"]
[ext_resource type="Script" uid="uid://bjkqa4cowhacd" path="res://menu/menu.gd" id="1_j0t7f"]
[sub_resource type="Gradient" id="Gradient_jc4t8"]
interpolation_color_space = 2
@ -21,6 +23,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_j0t7f")
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 0
@ -65,15 +68,15 @@ fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
[node name="StoryButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
[node name="IntroButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
modulate = Color(1, 0.403922, 1, 1)
layout_mode = 2
text = "Play Story"
text = "Play Intro"
[node name="EndlessButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
[node name="SkipButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
modulate = Color(1, 0.403922, 1, 1)
layout_mode = 2
text = "Play Endless"
text = "Skip Intro"
[node name="CreditsButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
modulate = Color(0.388235, 1, 1, 1)
@ -84,3 +87,6 @@ text = "Credits"
modulate = Color(1, 0.346577, 0.280009, 1)
layout_mode = 2
text = "Exit Game"
[connection signal="pressed" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/IntroButton" to="." method="_on_intro_button_pressed"]
[connection signal="pressed" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/SkipButton" to="." method="_on_skip_button_pressed"]

View file

@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Alternate - Playmakers Jam"
run/main_scene="uid://ct8axfbvd2wn4"
run/main_scene="uid://0ajx46iu2l51"
config/features=PackedStringArray("4.4", "GL Compatibility")
config/icon="res://icon.svg"