cooking
This commit is contained in:
parent
c9286e8c12
commit
ecd9ebd486
22 changed files with 308 additions and 32 deletions
19
games/platformer/existWhenGaming.gd
Normal file
19
games/platformer/existWhenGaming.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Control
|
||||
|
||||
var become_real : bool = false
|
||||
var realness : float = 0
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
GameManager.gaming.connect(appear)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if(become_real):
|
||||
realness += delta/2
|
||||
modulate = Color(1,1,1,clampf(realness, 0,0.5))
|
||||
if(realness > 0.5):
|
||||
become_real = false
|
||||
|
||||
func appear():
|
||||
become_real = true
|
||||
1
games/platformer/existWhenGaming.gd.uid
Normal file
1
games/platformer/existWhenGaming.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bnprbj4be8n7j
|
||||
|
|
@ -19,6 +19,7 @@ enum GameStage{
|
|||
@export var timer : Timer
|
||||
@export var warning_areas : Array[Node2D]
|
||||
@export var laser_areas : Array[Area2D]
|
||||
@export var lifebar : TextureProgressBar
|
||||
|
||||
var game_active : bool = false
|
||||
var stage : GameStage = GameStage.None
|
||||
|
|
@ -49,6 +50,7 @@ func _process(delta: float) -> void:
|
|||
|
||||
func update_ui(score : int, lives :int):
|
||||
score_label.text = str(score)
|
||||
lifebar.value = lives
|
||||
|
||||
func rec_skip_intro():
|
||||
#teleport player to doorway
|
||||
|
|
@ -65,6 +67,7 @@ func start_game():
|
|||
|
||||
func end_game():
|
||||
# set stage back to none?
|
||||
stage = GameStage.None
|
||||
game_active = false
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=36 format=4 uid="uid://ckbyiwy0dxbsd"]
|
||||
[gd_scene load_steps=39 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"]
|
||||
|
|
@ -15,7 +15,10 @@
|
|||
[ext_resource type="Texture2D" uid="uid://r71wb0u4bsxw" path="res://sprites/broken_tv_remote.png" id="11_vuxiy"]
|
||||
[ext_resource type="Script" uid="uid://bl7sx7fl7ye4a" path="res://games/platformer/tv_remote.gd" id="13_7gl5q"]
|
||||
[ext_resource type="PackedScene" uid="uid://dv4ex5tshavff" path="res://games/platformer/door.tscn" id="14_yphhh"]
|
||||
[ext_resource type="Script" uid="uid://bnprbj4be8n7j" path="res://games/platformer/existWhenGaming.gd" id="16_g0mja"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwwqsaepieo3c" path="res://sprites/batteryEmpty.png" id="16_p7238"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvnudttaiaab5" path="res://sprites/platformer_lab_laser.png" id="16_wtveo"]
|
||||
[ext_resource type="Texture2D" uid="uid://bm6lkjpvfdqn3" path="res://sprites/batteryFull.png" id="17_g0mja"]
|
||||
[ext_resource type="Texture2D" uid="uid://dyfubdnvunea2" path="res://sprites/whiteSqaure.png" id="17_x1jr7"]
|
||||
[ext_resource type="Script" uid="uid://bvldm4nv0g3" path="res://games/platformer/flasher.gd" id="18_x1jr7"]
|
||||
|
||||
|
|
@ -191,7 +194,7 @@ font_color = Color(1, 1, 1, 0.439216)
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_gyyvr"]
|
||||
size = Vector2(576, 64)
|
||||
|
||||
[node name="Platformer" type="Node" node_paths=PackedStringArray("score_label", "player", "skip_location", "timer", "warning_areas", "laser_areas")]
|
||||
[node name="Platformer" type="Node" node_paths=PackedStringArray("score_label", "player", "skip_location", "timer", "warning_areas", "laser_areas", "lifebar")]
|
||||
script = ExtResource("1_mauky")
|
||||
score_label = NodePath("Score")
|
||||
player = NodePath("Player")
|
||||
|
|
@ -199,6 +202,7 @@ skip_location = NodePath("IntroSkipLocation")
|
|||
timer = NodePath("Timer")
|
||||
warning_areas = [NodePath("Warnings/WarningNode"), NodePath("Warnings/WarningNode2"), NodePath("Warnings/WarningNode3")]
|
||||
laser_areas = [NodePath("Lasers/LaserSet"), NodePath("Lasers/LaserSet2"), NodePath("Lasers/LaserSet3")]
|
||||
lifebar = NodePath("Lifebar")
|
||||
|
||||
[node name="Parallax2D" type="Parallax2D" parent="."]
|
||||
scroll_scale = Vector2(0, 0)
|
||||
|
|
@ -330,12 +334,27 @@ move_speed = 1000.0
|
|||
[node name="Score" type="Label" parent="."]
|
||||
z_index = -1
|
||||
offset_left = 208.0
|
||||
offset_top = 160.0
|
||||
offset_top = 176.0
|
||||
offset_right = 432.0
|
||||
offset_bottom = 279.0
|
||||
text = "00"
|
||||
offset_bottom = 295.0
|
||||
text = "0"
|
||||
label_settings = SubResource("LabelSettings_yphhh")
|
||||
horizontal_alignment = 1
|
||||
script = ExtResource("16_g0mja")
|
||||
|
||||
[node name="Lifebar" type="TextureProgressBar" parent="."]
|
||||
modulate = Color(1, 1, 1, 0.678431)
|
||||
z_index = -1
|
||||
offset_left = 248.0
|
||||
offset_top = 144.0
|
||||
offset_right = 296.0
|
||||
offset_bottom = 160.0
|
||||
scale = Vector2(3, 3)
|
||||
max_value = 3.0
|
||||
value = 3.0
|
||||
texture_under = ExtResource("16_p7238")
|
||||
texture_progress = ExtResource("17_g0mja")
|
||||
script = ExtResource("16_g0mja")
|
||||
|
||||
[node name="IntroSkipLocation" type="Marker2D" parent="."]
|
||||
position = Vector2(-40, 256)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue