add basic gameplay state
This commit is contained in:
parent
bd628d669e
commit
22a4af6e35
3 changed files with 23 additions and 1 deletions
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://4eo7g5abxolw"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://4eo7g5abxolw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bio2cjqps6kg1" path="res://scenes/level_director/level_director.gd" id="1_4q8ux"]
|
||||
[ext_resource type="Script" uid="uid://dikxx4j1auywf" path="res://scenes/levels/states/level_starting.gd" id="2_ywjt3"]
|
||||
[ext_resource type="Script" uid="uid://b33kq05ag5tx6" path="res://scenes/levels/states/level_playing.gd" id="3_v2iy6"]
|
||||
|
||||
[node name="LevelDirector" type="Node" node_paths=PackedStringArray("initial_state")]
|
||||
process_mode = 3
|
||||
|
|
@ -12,3 +13,7 @@ metadata/_custom_type_script = "uid://dqjaxgmyxq3rx"
|
|||
[node name="Starting" type="Node" parent="."]
|
||||
script = ExtResource("2_ywjt3")
|
||||
metadata/_custom_type_script = "uid://dioh6egp2x760"
|
||||
|
||||
[node name="Playing" type="Node" parent="."]
|
||||
script = ExtResource("3_v2iy6")
|
||||
metadata/_custom_type_script = "uid://dioh6egp2x760"
|
||||
|
|
|
|||
16
scenes/levels/states/level_playing.gd
Normal file
16
scenes/levels/states/level_playing.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends LevelState
|
||||
|
||||
|
||||
func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
|
||||
get_tree().paused = false
|
||||
|
||||
|
||||
func _handle_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("p1_pause"):
|
||||
finished.emit(PAUSED, {"player": 1})
|
||||
elif event.is_action_pressed("p2_pause"):
|
||||
finished.emit(PAUSED, {"player": 2})
|
||||
|
||||
|
||||
func _state_physics_update(delta: float) -> void:
|
||||
level.camera.follow_gameplay(delta)
|
||||
1
scenes/levels/states/level_playing.gd.uid
Normal file
1
scenes/levels/states/level_playing.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b33kq05ag5tx6
|
||||
Loading…
Add table
Reference in a new issue