working force push with raycast
This commit is contained in:
1 parent
d62e6ac024
commit
7bac7283dd
5 files changed
+92
-21
No files matched your search
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://r8jj43l4t6is"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://r8jj43l4t6is"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_8i1rq"]
|
||||
[ext_resource type="PackedScene" uid="uid://di3tq4f0xmdqc" path="res://scenes/crate.tscn" id="1_tfj4n"]
|
||||
[ext_resource type="Script" path="res://scripts/charactercontroller.gd" id="2_e3e8k"]
|
||||
[ext_resource type="Script" path="res://scripts/trigger.gd" id="3_hm0br"]
|
||||
[ext_resource type="PackedScene" uid="uid://dcbk086hhrn7y" path="res://scenes/player.tscn" id="3_oy8j2"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jk5qv"]
|
||||
size = Vector2(66, 20)
|
||||
@@ -11,8 +11,6 @@ size = Vector2(66, 20)
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_acecj"]
|
||||
distance = -430.0
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_qrixx"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_8j7te"]
|
||||
radius = 29.0
|
||||
|
||||
@@ -20,14 +18,14 @@ radius = 29.0
|
||||
script = ExtResource("1_8i1rq")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
position = Vector2(542, 371)
|
||||
position = Vector2(547, 333)
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
shape = SubResource("RectangleShape2D_jk5qv")
|
||||
|
||||
[node name="RigidBody2D" parent="." instance=ExtResource("1_tfj4n")]
|
||||
position = Vector2(526, 297)
|
||||
position = Vector2(291, 405)
|
||||
rotation = 2.0228
|
||||
|
||||
[node name="RigidBody2D2" parent="." instance=ExtResource("1_tfj4n")]
|
||||
@@ -46,15 +44,8 @@ rotation = 0.0531393
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="floor"]
|
||||
shape = SubResource("WorldBoundaryShape2D_acecj")
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
|
||||
position = Vector2(441, 314)
|
||||
script = ExtResource("2_e3e8k")
|
||||
PUSH_FORCE = 70
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
|
||||
shape = SubResource("CircleShape2D_qrixx")
|
||||
debug_color = Color(0.345561, 0.615334, 0.230675, 0.42)
|
||||
[node name="CharacterBody2D" parent="." instance=ExtResource("3_oy8j2")]
|
||||
position = Vector2(236, 403)
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
position = Vector2(597, 419)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dcbk086hhrn7y"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/charactercontroller.gd" id="1_6alft"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_qrixx"]
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||
script = ExtResource("1_6alft")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_qrixx")
|
||||
debug_color = Color(0.345561, 0.615334, 0.230675, 0.42)
|
||||
|
||||
[node name="RightRay" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(18, 0)
|
||||
|
||||
[node name="LeftRay" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(-19, 0)
|
||||
Reference in new issue
Block a user