Fixed test platform rotation. Added standing check area to the platform
This commit is contained in:
@@ -36,6 +36,7 @@ const MAX_WIDTH = TILE_SIZE * 32
|
||||
|
||||
|
||||
@onready var collision: CollisionShape2D = $CollisionShape2D
|
||||
@onready var standing_check_collision: CollisionShape2D = $Area2D/CollisionShape2D
|
||||
@onready var sub_viewport: SubViewport = $SubViewport
|
||||
@onready var platform_sprite: Sprite2D = $Sprite2D
|
||||
@onready var platform_rect: ColorRect = $SubViewport/PlatformRect
|
||||
@@ -50,8 +51,8 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func rebuild_platform() -> void:
|
||||
var shape := collision.shape as RectangleShape2D
|
||||
shape.size.x = platform_width
|
||||
collision.shape.size.x = platform_width
|
||||
standing_check_collision.shape.size.x = platform_width - 4
|
||||
|
||||
var platfor_size := Vector2(platform_width, TILE_SIZE)
|
||||
|
||||
|
||||
@@ -493,6 +493,9 @@ animations = [{
|
||||
resource_local_to_scene = true
|
||||
size = Vector2(16, 7)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bhunq"]
|
||||
size = Vector2(12, 1)
|
||||
|
||||
[node name="AbstractPlatform" type="AnimatableBody2D" unique_id=137546339]
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_426vp")
|
||||
@@ -532,3 +535,10 @@ sprite_frames = SubResource("SpriteFrames_j4n83")
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=175449124]
|
||||
position = Vector2(0, -0.5)
|
||||
shape = SubResource("RectangleShape2D_jsq8n")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=1655744842]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1261028767]
|
||||
position = Vector2(0, -4.5)
|
||||
shape = SubResource("RectangleShape2D_bhunq")
|
||||
debug_color = Color(0.9020316, 0.24375501, 0.4918024, 0.41960785)
|
||||
|
||||
@@ -66,7 +66,7 @@ func _select_animation() -> void:
|
||||
icon_sprite.play(ANIMATION_SELF_MOVING)
|
||||
return
|
||||
|
||||
var direction : String = ANIMATION_MAP[type][not is_reverse]
|
||||
var direction : String = ANIMATION_MAP[type][is_reverse]
|
||||
var suffix := ANIMATION_ACTIVE_SUFFIX if is_moving else ANIMATION_STATIC_SUFFIX
|
||||
icon_sprite.play(ANIMATION_MOVING_PREFIX + direction + suffix)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user