OverviewFilesCommitsIssuesDocsReleasesPeers

godot-tumble_player_demo commits / 60a192e

Added Special Input script for debugging keys (and pressing ESC to quit!)
60a192e63c50be2dc39126058b44844ce8d0e36c
by Patrick McKeever <patrick.arthur.mckeever@gmail.com> · 2022-01-24T20:33:31.000Z

Changed files (2) +26 -2

player/player.tscn +6 -2
……@@ -1,4 +1,4 @@
1[gd_scene load_steps=45 format=2]
1[gd_scene load_steps=46 format=2]
22
33[ext_resource path="res://ui/circle.png" type="Texture" id=1]
44[ext_resource path="res://ui/direction.png" type="Texture" id=2]
……@@ -21,6 +21,7 @@
2121[ext_resource path="res://player/models/tumble_asset.tscn" type="PackedScene" id=19]
2222[ext_resource path="res://player/camera.gd" type="Script" id=20]
2323[ext_resource path="res://player/player.gd" type="Script" id=21]
24[ext_resource path="res://special_input.gd" type="Script" id=22]
2425
2526[sub_resource type="CylinderShape" id=24]
2627radius = 0.42385
……@@ -132,7 +133,7 @@ nodes/strafe/node = SubResource( 20 )
132133nodes/strafe/position = Vector2( -760, 60 )
133134nodes/walk_scale/node = SubResource( 23 )
134135nodes/walk_scale/position = Vector2( -640, 360 )
135node_connections = [ "output", 0, "roll", "roll", 0, "aim_transition", "roll", 1, "roll_scale", "walk_scale", 0, "Animation 3", "TimeScale 3", 0, "strafe", "roll_scale", 0, "Animation", "run_scale", 0, "Animation 4", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale" ]
136node_connections = [ "output", 0, "roll", "roll", 0, "aim_transition", "roll", 1, "roll_scale", "TimeScale 3", 0, "strafe", "run_scale", 0, "Animation 4", "walk_scale", 0, "Animation 3", "iwr_blend", 0, "Animation 2", "iwr_blend", 1, "walk_scale", "iwr_blend", 2, "run_scale", "aim_transition", 0, "TimeScale 3", "aim_transition", 1, "iwr_blend", "roll_scale", 0, "Animation" ]
136137
137138[node name="Player" type="KinematicBody"]
138139script = ExtResource( 21 )
……@@ -530,3 +531,6 @@ parameters/roll_scale/scale = 1.0
530531parameters/run_scale/scale = 1.0
531532parameters/strafe/blend_position = Vector2( 0.000221848, 0.0517242 )
532533parameters/walk_scale/scale = 1.0
534
535[node name="Special Input" type="Node" parent="."]
536script = ExtResource( 22 )
special_input.gd +20 -0
……@@ -0,0 +1,20 @@
1extends Node
2
3var bDebugPaused : bool = false
4
5func _ready():
6 bDebugPaused = false
7 get_tree().paused = false
8
9# Called every frame. 'delta' is the elapsed time since the previous frame.
10func _process(_delta):
11 if Input.is_action_just_pressed("debug_pause"):
12 bDebugPaused = !bDebugPaused
13 if bDebugPaused:
14 get_tree().paused = true
15 else:
16 get_tree().paused = false
17 if Input.is_action_just_pressed("ui_cancel"):
18 get_tree().quit()
19 if Input.is_action_just_pressed("restart_level"):
20 get_tree().reload_current_scene()