working on intro

This commit is contained in:
Tabby 2025-05-15 14:35:32 +10:00
parent 4f4e703886
commit 8be34b6c12
31 changed files with 497 additions and 23 deletions

View file

@ -4,13 +4,21 @@ class_name Channel
signal channel_win
signal channel_lose
enum Mode{
Online,
Static,
Offline
}
@export var channel_name : String
@export var channel_scene : PackedScene
@export_group("Node References")
@export var offline_channel_cover : TextureRect
@export var static_channel_cover : TextureRect
@export var game_viewport : SubViewport
var channel_online : bool = false
var channel_mode : Mode = Mode.Offline
func _ready() -> void:
#var new_scene = channel_scene.instantiate()
@ -22,17 +30,24 @@ func _ready() -> void:
func _process(delta: float) -> void:
offline_channel_cover.visible = !channel_online
offline_channel_cover.visible = channel_mode == Mode.Offline
static_channel_cover.visible = channel_mode == Mode.Static
func start_channel(scene : PackedScene):
var new_scene = scene.instantiate()
game_viewport.add_child(new_scene)
channel_online = true
channel_mode = Mode.Online
func end_channel():
channel_online = false
channel_mode = Mode.Static
game_viewport.get_child(0).queue_free()
func make_static():
channel_mode = Mode.Static
func make_offline():
channel_mode = Mode.Offline
func win_channel():
channel_win.emit()
end_channel()

View file

@ -1,11 +1,29 @@
[gd_scene load_steps=4 format=3 uid="uid://63rik2noj8id"]
[gd_scene load_steps=10 format=3 uid="uid://63rik2noj8id"]
[ext_resource type="Script" uid="uid://h43mmpjmmir4" path="res://base modules/channel_controller.gd" id="1_r07ln"]
[ext_resource type="Texture2D" uid="uid://cyo0wl4dt3td1" path="res://sprites/offline_channel.png" id="2_01b3p"]
[ext_resource type="Texture2D" uid="uid://d2xkwf58dxlvh" path="res://sprites/static/Television_static.gif_frame_00000.jpg" id="3_w8dl7"]
[ext_resource type="Texture2D" uid="uid://qr2f4j3tofos" path="res://sprites/static/Television_static.gif_frame_00001.jpg" id="4_sawva"]
[ext_resource type="Texture2D" uid="uid://55teduyyhqhs" path="res://sprites/static/Television_static.gif_frame_00002.jpg" id="5_7qn6j"]
[ext_resource type="Texture2D" uid="uid://b2x8kmjcv1te" path="res://sprites/static/Television_static.gif_frame_00003.jpg" id="6_2hkew"]
[ext_resource type="Texture2D" uid="uid://ce44420oiv8ag" path="res://sprites/static/Television_static.gif_frame_00004.jpg" id="7_5mkxt"]
[sub_resource type="ViewportTexture" id="ViewportTexture_iix04"]
viewport_path = NodePath("GameViewport")
[sub_resource type="AnimatedTexture" id="AnimatedTexture_8t1w7"]
frames = 5
speed_scale = 20.0
frame_0/texture = ExtResource("3_w8dl7")
frame_1/texture = ExtResource("4_sawva")
frame_1/duration = 1.0
frame_2/texture = ExtResource("5_7qn6j")
frame_2/duration = 1.0
frame_3/texture = ExtResource("6_2hkew")
frame_3/duration = 1.0
frame_4/texture = ExtResource("7_5mkxt")
frame_4/duration = 1.0
[node name="Control" type="Control" node_paths=PackedStringArray("offline_channel_cover", "game_viewport")]
layout_mode = 3
anchors_preset = 15
@ -42,6 +60,17 @@ grow_vertical = 2
texture = ExtResource("2_01b3p")
expand_mode = 2
[node name="Static" type="TextureRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AnimatedTexture_8t1w7")
expand_mode = 2
[node name="GameViewport" type="SubViewport" parent="."]
handle_input_locally = false
canvas_item_default_texture_filter = 0

1
credits.md Normal file
View file

@ -0,0 +1 @@
- https://commons.wikimedia.org/wiki/File:Television_static.gif

6
gameManager.tscn Normal file
View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ip51kjj5sl6v"]
[ext_resource type="Script" uid="uid://cuct36ytrc3mu" path="res://game_manager.gd" id="1_d8p07"]
[node name="GameManager" type="Node"]
script = ExtResource("1_d8p07")

View file

@ -15,9 +15,11 @@ enum Gamemode{
@export var outer_channels : Array[Channel]
@export var main_channel : Channel
var gamemode : Gamemode = Gamemode.Story #will be set by manager/menu option
var zooming_out : bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.zoom_out_signal.connect(zoom_out)
if(gamemode == Gamemode.Story):
main_camera.zoom = Vector2(3.1,3.1)
main_channel.start_channel(platformer_game)
@ -25,4 +27,11 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
#if(Input.is_action_just_pressed("ui_down")):
#zoom_out()
if(zooming_out):
var zoom_amount : float = clampf(main_camera.zoom.x - delta,1, 4 )
main_camera.zoom = Vector2(zoom_amount,zoom_amount)
func zoom_out():
zooming_out = true

17
game_manager.gd Normal file
View file

@ -0,0 +1,17 @@
extends Node
# it is I, the manaegr of the games~
signal zoom_out_signal
# 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 play_zoom_out():
zoom_out_signal.emit()

1
game_manager.gd.uid Normal file
View file

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

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://ct8axfbvd2wn4"]
[gd_scene load_steps=12 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"]
@ -10,6 +10,7 @@
[ext_resource type="PackedScene" uid="uid://d0qteaieltywg" path="res://games/bomb defusal/bomb_defusal.tscn" id="7_6e45b"]
[ext_resource type="PackedScene" uid="uid://bkabgl6p44c5b" path="res://games/space invaders/space_invaders.tscn" id="9_miq82"]
[ext_resource type="PackedScene" uid="uid://drk2fwkv816qv" path="res://games/crafting/crafting.tscn" id="9_udeyl"]
[ext_resource type="Texture2D" uid="uid://baf30tscdkl0i" path="res://sprites/tv_remote.png" id="11_j5hk1"]
[node name="GameScene" type="Control" node_paths=PackedStringArray("main_camera", "outer_channels", "main_channel")]
layout_mode = 3
@ -89,3 +90,74 @@ channel_scene = ExtResource("9_udeyl")
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2(320, 180)
[node name="Chat" type="PanelContainer" parent="."]
custom_minimum_size = Vector2(500, 0)
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -250.0
offset_top = -76.0
offset_right = 250.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 0
[node name="MarginContainer" type="MarginContainer" parent="Chat"]
layout_mode = 2
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="RichTextLabel" type="RichTextLabel" parent="Chat/MarginContainer"]
layout_mode = 2
text = "Uh oh...."
[node name="Item Get Popup" type="PanelContainer" parent="."]
custom_minimum_size = Vector2(200, 200)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -5.0
offset_top = -5.0
offset_right = 5.0
offset_bottom = 5.0
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="Item Get Popup"]
layout_mode = 2
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="VBoxContainer" type="VBoxContainer" parent="Item Get Popup/MarginContainer"]
layout_mode = 2
[node name="Label" type="RichTextLabel" parent="Item Get Popup/MarginContainer/VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "[wave]You got an Item!"
fit_content = true
horizontal_alignment = 1
[node name="TextureRect" type="TextureRect" parent="Item Get Popup/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("11_j5hk1")
stretch_mode = 5
[node name="Label2" type="RichTextLabel" parent="Item Get Popup/MarginContainer/VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "[b]TV Remote"
fit_content = true
horizontal_alignment = 1

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if(following):
global_position.x = target.global_position.x
global_position = target.global_position
if(Input.is_action_just_pressed("ui_right")):
start_arena_cam()
pass

View file

@ -1,31 +1,38 @@
extends CharacterBody2D
signal remote_get
@export var SPEED = 200.0
@export var JUMP_VELOCITY = -450.0
var controls_enabled : bool = true
func _process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta
# Handle jump.
if Input.is_action_just_pressed("platformer_jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
if(controls_enabled):
# Handle jump.
if Input.is_action_just_pressed("platformer_jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction := Input.get_axis("platformer_left", "platformer_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction := Input.get_axis("platformer_left", "platformer_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
move_and_slide()
func _on_hitbox_area_entered(area: Area2D) -> void:
#print(area.name)
if(area.name == "Box"):
GameManager.play_zoom_out()
#box event
#laser event
#sticky tape event

View file

@ -15,6 +15,10 @@ run/main_scene="uid://ct8axfbvd2wn4"
config/features=PackedStringArray("4.4", "GL Compatibility")
config/icon="res://icon.svg"
[autoload]
GameManager="*res://gameManager.tscn"
[display]
window/size/viewport_width=640

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://r71wb0u4bsxw"
path="res://.godot/imported/broken_tv_remote.png-c105e102c7bd3da8b9828b6216f06e78.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/broken_tv_remote.png"
dest_files=["res://.godot/imported/broken_tv_remote.png-c105e102c7bd3da8b9828b6216f06e78.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 not shown.

After

Width:  |  Height:  |  Size: 398 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1mo5ecyjgngw"
path="res://.godot/imported/platformer_stone_tile.png-ba85e59543af055d289b20a29e7bda81.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/platformer_stone_tile.png"
dest_files=["res://.godot/imported/platformer_stone_tile.png-ba85e59543af055d289b20a29e7bda81.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 not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d2xkwf58dxlvh"
path="res://.godot/imported/Television_static.gif_frame_00000.jpg-1334baf91b197a7e17d24e42d73a0e34.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/static/Television_static.gif_frame_00000.jpg"
dest_files=["res://.godot/imported/Television_static.gif_frame_00000.jpg-1334baf91b197a7e17d24e42d73a0e34.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 not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qr2f4j3tofos"
path="res://.godot/imported/Television_static.gif_frame_00001.jpg-5c8646be39405763b70b021eff7b8cb1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/static/Television_static.gif_frame_00001.jpg"
dest_files=["res://.godot/imported/Television_static.gif_frame_00001.jpg-5c8646be39405763b70b021eff7b8cb1.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 not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://55teduyyhqhs"
path="res://.godot/imported/Television_static.gif_frame_00002.jpg-0fa84a0dae0beb21246466a558c91f86.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/static/Television_static.gif_frame_00002.jpg"
dest_files=["res://.godot/imported/Television_static.gif_frame_00002.jpg-0fa84a0dae0beb21246466a558c91f86.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 not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2x8kmjcv1te"
path="res://.godot/imported/Television_static.gif_frame_00003.jpg-58e193bb56f0584ce4f5101bf4bb43d8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/static/Television_static.gif_frame_00003.jpg"
dest_files=["res://.godot/imported/Television_static.gif_frame_00003.jpg-58e193bb56f0584ce4f5101bf4bb43d8.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 not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ce44420oiv8ag"
path="res://.godot/imported/Television_static.gif_frame_00004.jpg-b80d11906735c34734763218a5480d14.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/static/Television_static.gif_frame_00004.jpg"
dest_files=["res://.godot/imported/Television_static.gif_frame_00004.jpg-b80d11906735c34734763218a5480d14.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

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dldibaqo7kobr"
path="res://.godot/imported/tvStatic.png-1714cce7e42f1b368ebe38d17352986d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/tvStatic.png"
dest_files=["res://.godot/imported/tvStatic.png-1714cce7e42f1b368ebe38d17352986d.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

BIN
sprites/tv_remote.pdn Normal file

Binary file not shown.

BIN
sprites/tv_remote.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://baf30tscdkl0i"
path="res://.godot/imported/tv_remote.png-4ed37827d714bb9b08c7788fe25c47b3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/tv_remote.png"
dest_files=["res://.godot/imported/tv_remote.png-4ed37827d714bb9b08c7788fe25c47b3.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