lunch timeee
This commit is contained in:
parent
ecd9ebd486
commit
d725e1a0cf
7 changed files with 133 additions and 7 deletions
|
|
@ -111,7 +111,7 @@ func rec_channel_lose():
|
||||||
|
|
||||||
func game_over_gg():
|
func game_over_gg():
|
||||||
zoom_in()
|
zoom_in()
|
||||||
game_over.emit()
|
|
||||||
gameplay = false
|
gameplay = false
|
||||||
main_channel.end_channel()
|
main_channel.end_channel()
|
||||||
for channel in outer_channels:
|
for channel in outer_channels:
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ signal update_data(score : int, lives : int)
|
||||||
signal skip_intro
|
signal skip_intro
|
||||||
signal start_platformer
|
signal start_platformer
|
||||||
signal end_platformer
|
signal end_platformer
|
||||||
|
signal game_over
|
||||||
|
|
||||||
@export var broken_tv_remote : Texture
|
@export var broken_tv_remote : Texture
|
||||||
var are_we_skipping_intro : bool = false
|
var are_we_skipping_intro : bool = false
|
||||||
|
|
@ -53,3 +54,6 @@ func actually_gaming():
|
||||||
|
|
||||||
func send_update_data(score : int, lives: int):
|
func send_update_data(score : int, lives: int):
|
||||||
update_data.emit(score, lives)
|
update_data.emit(score, lives)
|
||||||
|
|
||||||
|
func send_game_over():
|
||||||
|
game_over.emit()
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ func _ready() -> void:
|
||||||
GameManager.update_data.connect(update_ui)
|
GameManager.update_data.connect(update_ui)
|
||||||
GameManager.start_platformer.connect(start_game)
|
GameManager.start_platformer.connect(start_game)
|
||||||
GameManager.end_platformer.connect(end_game)
|
GameManager.end_platformer.connect(end_game)
|
||||||
|
GameManager.game_over.connect(display_game_over)
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,3 +84,7 @@ func _on_timer_timeout() -> void:
|
||||||
end_game()
|
end_game()
|
||||||
|
|
||||||
#if i havent died yet, then win
|
#if i havent died yet, then win
|
||||||
|
|
||||||
|
func display_game_over():
|
||||||
|
stage = GameStage.None
|
||||||
|
#game_active = true
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
[gd_scene load_steps=39 format=4 uid="uid://ckbyiwy0dxbsd"]
|
[gd_scene load_steps=47 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://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="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://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"]
|
[ext_resource type="Texture2D" uid="uid://g5arxk4po7kw" path="res://sprites/platformer_lab_tile.png" id="3_84mot"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d1mo5ecyjgngw" path="res://sprites/platformer_stone_tile.png" id="4_86tx6"]
|
[ext_resource type="Texture2D" uid="uid://d1mo5ecyjgngw" path="res://sprites/platformer_stone_tile.png" id="4_86tx6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://t4vhpibk2yb5" path="res://sprites/neko.png" id="4_g0mja"]
|
||||||
[ext_resource type="PackedScene" uid="uid://q3wdnawp7n63" path="res://games/platformer/lab_platform.tscn" id="4_w58m1"]
|
[ext_resource type="PackedScene" uid="uid://q3wdnawp7n63" path="res://games/platformer/lab_platform.tscn" id="4_w58m1"]
|
||||||
[ext_resource type="Script" uid="uid://43jxroyergh0" path="res://games/platformer/platformerCam.gd" id="5_x2rtd"]
|
[ext_resource type="Script" uid="uid://43jxroyergh0" path="res://games/platformer/platformerCam.gd" id="5_x2rtd"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dyjxtuapxfiip" path="res://sprites/box.png" id="6_02uuf"]
|
[ext_resource type="Texture2D" uid="uid://dyjxtuapxfiip" path="res://sprites/box.png" id="6_02uuf"]
|
||||||
|
|
@ -32,6 +32,73 @@ width = 300
|
||||||
height = 180
|
height = 180
|
||||||
fill_from = Vector2(1, 1)
|
fill_from = Vector2(1, 1)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_4fc0x"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(16, 16, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_1i68h"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(32, 16, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ftlpv"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(16, 48, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7hkwn"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(16, 32, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_pj7n8"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(32, 32, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_3wy10"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(48, 32, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_we8k4"]
|
||||||
|
atlas = ExtResource("4_g0mja")
|
||||||
|
region = Rect2(64, 32, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_i6xil"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_4fc0x")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_1i68h")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ftlpv")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"jump",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7hkwn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_pj7n8")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_3wy10")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_we8k4")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"run",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oyf6i"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oyf6i"]
|
||||||
size = Vector2(32, 32)
|
size = Vector2(32, 32)
|
||||||
|
|
||||||
|
|
@ -219,14 +286,16 @@ grow_vertical = 2
|
||||||
scale = Vector2(2, 2)
|
scale = Vector2(2, 2)
|
||||||
texture = SubResource("GradientTexture2D_84mot")
|
texture = SubResource("GradientTexture2D_84mot")
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D" parent="."]
|
[node name="Player" type="CharacterBody2D" parent="." node_paths=PackedStringArray("player_sprite")]
|
||||||
position = Vector2(-1552, -504)
|
position = Vector2(-1552, -504)
|
||||||
script = ExtResource("1_1wj3w")
|
script = ExtResource("1_1wj3w")
|
||||||
remote_sprite = ExtResource("2_7eu3u")
|
remote_sprite = ExtResource("2_7eu3u")
|
||||||
|
player_sprite = NodePath("Sprite2D")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Player"]
|
[node name="Sprite2D" type="AnimatedSprite2D" parent="Player"]
|
||||||
scale = Vector2(0.25, 0.25)
|
scale = Vector2(2, 2)
|
||||||
texture = ExtResource("1_oyf6i")
|
sprite_frames = SubResource("SpriteFrames_i6xil")
|
||||||
|
animation = &"jump"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||||
shape = SubResource("RectangleShape2D_oyf6i")
|
shape = SubResource("RectangleShape2D_oyf6i")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ signal remote_get
|
||||||
@export var SPEED = 200.0
|
@export var SPEED = 200.0
|
||||||
@export var JUMP_VELOCITY = -450.0
|
@export var JUMP_VELOCITY = -450.0
|
||||||
@export var remote_sprite : Texture
|
@export var remote_sprite : Texture
|
||||||
|
@export var player_sprite : AnimatedSprite2D
|
||||||
var controls_enabled : bool = true
|
var controls_enabled : bool = true
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -15,6 +16,7 @@ func _process(delta: float) -> void:
|
||||||
# Add the gravity.
|
# Add the gravity.
|
||||||
if not is_on_floor():
|
if not is_on_floor():
|
||||||
velocity += get_gravity() * delta
|
velocity += get_gravity() * delta
|
||||||
|
player_sprite.play("jump")
|
||||||
|
|
||||||
|
|
||||||
if(controls_enabled):
|
if(controls_enabled):
|
||||||
|
|
@ -29,12 +31,24 @@ func _process(delta: float) -> void:
|
||||||
velocity.x = direction * SPEED
|
velocity.x = direction * SPEED
|
||||||
else:
|
else:
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
|
if(direction < 0):
|
||||||
|
player_sprite.flip_h = true
|
||||||
|
elif(direction>0):
|
||||||
|
player_sprite.flip_h = false
|
||||||
|
|
||||||
|
if(direction != 0 and is_on_floor()):
|
||||||
|
player_sprite.play("run")
|
||||||
|
elif(is_on_floor()):
|
||||||
|
player_sprite.play("idle")
|
||||||
else:
|
else:
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_hitbox_area_entered(area: Area2D) -> void:
|
func _on_hitbox_area_entered(area: Area2D) -> void:
|
||||||
#print(area.name)
|
#print(area.name)
|
||||||
if(area.name == "Box"):
|
if(area.name == "Box"):
|
||||||
|
|
|
||||||
BIN
sprites/neko.png
Normal file
BIN
sprites/neko.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
34
sprites/neko.png.import
Normal file
34
sprites/neko.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://t4vhpibk2yb5"
|
||||||
|
path="res://.godot/imported/neko.png-4a85987a40e9db1331614a9db944720a.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/neko.png"
|
||||||
|
dest_files=["res://.godot/imported/neko.png-4a85987a40e9db1331614a9db944720a.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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue