better slope handling

This commit is contained in:
Haze Weathers 2023-03-24 21:22:07 -04:00
parent e02288fb3a
commit 64ff2d38df
2 changed files with 11 additions and 10 deletions

View file

@ -101,7 +101,8 @@ func _physics_process(delta):
position.y += 1 position.y += 1
velocity.y = 0 velocity.y = 0
#Apply velocity #Apply velocity
move_and_slide(velocity,Vector2.UP) var snap = Vector2(0.0, 0.0 if velocity.y < 0.0 else 14.0)
move_and_slide_with_snap(velocity, snap, Vector2.UP, true)
#Moon Jump #Moon Jump
if Debug.moon_jump == true: can_doublejump = true if Debug.moon_jump == true: can_doublejump = true
#2011 #2011

View file

@ -8,9 +8,6 @@ points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
[sub_resource type="ConvexPolygonShape2D" id=2] [sub_resource type="ConvexPolygonShape2D" id=2]
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 ) points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
[sub_resource type="ConvexPolygonShape2D" id=3]
points = PoolVector2Array( 8, 8, 2, 8, 5, 6, 8, 4 )
[sub_resource type="ConvexPolygonShape2D" id=4] [sub_resource type="ConvexPolygonShape2D" id=4]
points = PoolVector2Array( 8, 8, 0, 8, 0, 4, 8, 0 ) points = PoolVector2Array( 8, 8, 0, 8, 0, 4, 8, 0 )
@ -29,6 +26,9 @@ points = PoolVector2Array( 4, 8, 0, 8, 0, 3, 4, 3 )
[sub_resource type="ConvexPolygonShape2D" id=25] [sub_resource type="ConvexPolygonShape2D" id=25]
points = PoolVector2Array( 8, 8, 4, 8, 4, 0, 8, 0 ) points = PoolVector2Array( 8, 8, 4, 8, 4, 0, 8, 0 )
[sub_resource type="ConvexPolygonShape2D" id=26]
points = PoolVector2Array( 0, 8, 8, 4, 8, 8, 8, 8 )
[sub_resource type="ConvexPolygonShape2D" id=5] [sub_resource type="ConvexPolygonShape2D" id=5]
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 ) points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
@ -111,12 +111,6 @@ points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
"shape": SubResource( 2 ), "shape": SubResource( 2 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, { }, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 3 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 1 ), "autotile_coord": Vector2( 3, 1 ),
"one_way": false, "one_way": false,
"one_way_margin": 1.0, "one_way_margin": 1.0,
@ -152,6 +146,12 @@ points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
"one_way_margin": 1.0, "one_way_margin": 1.0,
"shape": SubResource( 25 ), "shape": SubResource( 25 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 26 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ] } ]
0/z_index = 0 0/z_index = 0
1/name = "concrete" 1/name = "concrete"