mirror of
https://github.com/GDQuest/godot-platformer-2d.git
synced 2026-07-24 03:16:55 +00:00
Fix Game scene & project file
This commit is contained in:
parent
bfb6f449fa
commit
209e41cff8
27 changed files with 44 additions and 48 deletions
|
|
@ -17,7 +17,7 @@ _global_script_classes=[ {
|
|||
"base": "Position2D",
|
||||
"class": "Hook",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/Actors/Player/Hook/Hook.gd"
|
||||
"path": "res://src/Player/Hook/Hook.gd"
|
||||
}, {
|
||||
"base": "Area2D",
|
||||
"class": "HookTarget",
|
||||
|
|
@ -38,9 +38,9 @@ config/icon="res://icon.png"
|
|||
|
||||
[autoload]
|
||||
|
||||
Settings="*res://src/Settings.gd"
|
||||
Events="*res://src/Events.gd"
|
||||
ControlUtils="*res://src/ControlUtils.gd"
|
||||
Settings="*res://src/singletons/Settings.gd"
|
||||
Events="*res://src/singletons/Events.gd"
|
||||
ControlUtils="*res://src/singletons/ControlUtils.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
|
|
@ -115,6 +115,11 @@ aim={
|
|||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
restart={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Events.gd" type="Script" id=1]
|
||||
|
||||
[node name="Events" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://assets/theme/gdquest.theme" type="Theme" id=1]
|
||||
[ext_resource path="res://src/UI/Title.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/UI/InfoLabel.gd" type="Script" id=3]
|
||||
[ext_resource path="res://src/Actors/Player/Player.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://src/HookTarget.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://src/Game.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/theme/gdquest.theme" type="Theme" id=2]
|
||||
[ext_resource path="res://src/UI/Title.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/UI/InfoLabel.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Player/Player.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://src/HookTarget.tscn" type="PackedScene" id=6]
|
||||
|
||||
[sub_resource type="GDScript" id=1]
|
||||
script/source = "extends Label
|
||||
|
|
@ -39,7 +40,6 @@ script = ExtResource( 1 )
|
|||
editor/display_folded = true
|
||||
|
||||
[node name="UI" type="Control" parent="TopLayer"]
|
||||
editor/display_folded = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
|
|
@ -95,7 +95,7 @@ margin_bottom = 138.0
|
|||
text = "Controls"
|
||||
script = SubResource( 2 )
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 4 )]
|
||||
[node name="Player" parent="." instance=ExtResource( 5 )]
|
||||
position = Vector2( 2080, -80 )
|
||||
collision_mask = 6
|
||||
|
||||
|
|
@ -243,7 +243,6 @@ position = Vector2( 1960, 190 )
|
|||
position = Vector2( 1640, -240 )
|
||||
|
||||
[node name="Flag" type="Node2D" parent="."]
|
||||
editor/display_folded = true
|
||||
position = Vector2( 2216, 0 )
|
||||
|
||||
[node name="Line2D2" type="Line2D" parent="Flag"]
|
||||
|
|
@ -263,7 +262,6 @@ begin_cap_mode = 2
|
|||
end_cap_mode = 2
|
||||
|
||||
[node name="ZeroGravityArea" type="Area2D" parent="."]
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
position = Vector2( 2720, -280 )
|
||||
__meta__ = {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func update_position(velocity:Vector2) -> void:
|
|||
_camera.position = distance_ratio * mouse_position.normalized() * offset
|
||||
|
||||
Settings.GAMEPAD:
|
||||
var joystick_direction: = get_aim_joystick_direction()
|
||||
var joystick_direction: Vector2 = ControlUtils.get_aim_joystick_direction()
|
||||
if Input.is_action_pressed("move_right") or Input.is_action_pressed("move_left"):
|
||||
_camera.position.x = sign(velocity.x) * offset.x
|
||||
_camera.position.y = joystick_direction.y * offset.y
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://CameraRig.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/CameraRig.gd" type="Script" id=1]
|
||||
|
||||
|
||||
|
||||
[node name="CameraRig" type="Position2D"]
|
||||
position = Vector2( 0, -30 )
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Player/Hook/Arrow.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/Hook/Arrow.gd" type="Script" id=1]
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Player/Hook/Hook.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Actors/Player/Hook/TargetCircle.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Actors/Player/Hook/Arrow.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/Actors/Player/HookingPoint.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Actors/Player/Hook/SnapDetector/SnapDetector.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://src/Player/Hook/Hook.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/Hook/TargetCircle.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Player/Hook/Arrow.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/Player/HookingPoint.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Player/Hook/SnapDetector/SnapDetector.tscn" type="PackedScene" id=5]
|
||||
|
||||
|
||||
[node name="Hook" type="Position2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Player/Hook/SnapDetector/SnapDetector.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Actors/Player/Hook/SnapDetector/HookingHint.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Player/Hook/SnapDetector/SnapDetector.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/Hook/SnapDetector/HookingHint.tscn" type="PackedScene" id=2]
|
||||
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 90.0002
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Player/LedgeDetector.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/LedgeDetector.gd" type="Script" id=1]
|
||||
|
||||
|
||||
|
||||
[node name="LedgeDetector" type="Position2D"]
|
||||
|
|
@ -1,17 +1,18 @@
|
|||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Player/Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Actors/Player/Hook/Hook.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Actors/Player/LedgeDetector.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/Actors/Player/FloorDetector.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Actors/Player/Skin.gd" type="Script" id=5]
|
||||
[ext_resource path="res://src/Actors/Player/Body.gd" type="Script" id=6]
|
||||
[ext_resource path="res://src/Actors/Player/CameraRig.gd" type="Script" id=7]
|
||||
[ext_resource path="res://src/Player/Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Player/Hook/Hook.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Player/LedgeDetector.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://src/Player/FloorDetector.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Player/Skin.gd" type="Script" id=5]
|
||||
[ext_resource path="res://src/Player/Body.gd" type="Script" id=6]
|
||||
[ext_resource path="res://src/Player/CameraRig.gd" type="Script" id=7]
|
||||
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 30, 30 )
|
||||
|
||||
[node name="Character" type="KinematicBody2D"]
|
||||
[node name="Player" type="KinematicBody2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
@ -22,8 +23,6 @@ shape = SubResource( 1 )
|
|||
position = Vector2( 0, -30 )
|
||||
|
||||
[node name="LedgeDetector" parent="." instance=ExtResource( 3 )]
|
||||
active = true
|
||||
ray_length = 30.0
|
||||
|
||||
[node name="FloorDetector" type="RayCast2D" parent="."]
|
||||
position = Vector2( 0, -30 )
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Settings.gd" type="Script" id=1]
|
||||
|
||||
[node name="Settings" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
extends Node
|
||||
"""Global utility methods to extend what's available from the Input singleton"""
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
extends Node
|
||||
|
||||
|
||||
signal player_info_updated(dict)
|
||||
signal player_state_changed(state_name)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue