init
This commit is contained in:
commit
f389e4e807
186 changed files with 10853 additions and 0 deletions
BIN
player/hair.aseprite
Normal file
BIN
player/hair.aseprite
Normal file
Binary file not shown.
21
player/hair.aseprite.import
Normal file
21
player/hair.aseprite.import
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[remap]
|
||||
|
||||
importer="aseprite_wizard.plugin.static-texture"
|
||||
type="PortableCompressedTexture2D"
|
||||
uid="uid://blw6f2ktsrcmg"
|
||||
path="res://.godot/imported/hair.aseprite-a1ccf5e1ff2b4f4d12f383bca2b18875.res"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://player/hair.aseprite"
|
||||
dest_files=["res://.godot/imported/hair.aseprite-a1ccf5e1ff2b4f4d12f383bca2b18875.res"]
|
||||
|
||||
[params]
|
||||
|
||||
layer/exclude_layers_pattern=""
|
||||
layer/only_visible_layers=false
|
||||
layer/split_layers=false
|
||||
first_frame_only=true
|
||||
sheet/sheet_type="packed"
|
||||
sheet/sheet_columns=12
|
||||
sheet/scale=1
|
||||
BIN
player/player.aseprite
Normal file
BIN
player/player.aseprite
Normal file
Binary file not shown.
21
player/player.aseprite.import
Normal file
21
player/player.aseprite.import
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[remap]
|
||||
|
||||
importer="aseprite_wizard.plugin.spriteframes"
|
||||
type="SpriteFrames"
|
||||
uid="uid://d0dy3j0qdycqf"
|
||||
path="res://.godot/imported/player.aseprite-704c4b9b828702113ecb71676625aeb4.res"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://player/player.aseprite"
|
||||
dest_files=["res://.godot/imported/player.aseprite-704c4b9b828702113ecb71676625aeb4.res"]
|
||||
|
||||
[params]
|
||||
|
||||
layer/exclude_layers_pattern=""
|
||||
layer/only_visible_layers=true
|
||||
sheet/sheet_type="packed"
|
||||
sheet/sheet_columns=12
|
||||
sheet/frame_padding=0
|
||||
sheet/scale=1
|
||||
animation/round_fps=true
|
||||
179
player/player.gd
Normal file
179
player/player.gd
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
class_name Player
|
||||
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:s")
|
||||
var max_input_buffer_time := 0.15
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:s⁻¹")
|
||||
var grounded_speed_decay := 0.1
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:s⁻¹")
|
||||
var grounded_speed_stop_decay := 0.005
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px/s")
|
||||
var walk_max_speed := 130.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px/s²")
|
||||
var walk_accel := 600.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px/s²")
|
||||
var air_accel := 200.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:s")
|
||||
var jump_ascent_max_time := 0.2
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px/s")
|
||||
var jump_ascent_speed := 200.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:s")
|
||||
var late_jump_time_limit := 0.15
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px/s")
|
||||
var slash_speed_boost := 90.0
|
||||
|
||||
var _max_input_buffer_time_usec:
|
||||
get():
|
||||
return max_input_buffer_time * 1_000_000
|
||||
var _jump_ascent_remaining_time := 0.0
|
||||
var _is_jumping := false
|
||||
var _jump_allowed_time := 0.0
|
||||
var _current_direction := Vector2.ZERO
|
||||
var _is_facing_right := true
|
||||
|
||||
var _input_buffer: Array[BufferedInput] = []
|
||||
|
||||
|
||||
class BufferedInput:
|
||||
var direction: Vector2
|
||||
var event: InputEvent
|
||||
var time: int
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
%Body.play()
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_echo():
|
||||
return
|
||||
if (event.is_action(&"move_left")
|
||||
or event.is_action(&"move_right")
|
||||
or event.is_action(&"move_up")
|
||||
or event.is_action(&"move_down") ):
|
||||
_current_direction = Vector2(
|
||||
Input.get_axis(&"move_left", &"move_right"),
|
||||
Input.get_axis(&"move_up", &"move_down"),
|
||||
)
|
||||
if _current_direction.x < 0:
|
||||
_is_facing_right = false
|
||||
elif _current_direction.x > 0:
|
||||
_is_facing_right = true
|
||||
if event.is_action(&"jump") or event.is_action(&"attack"):
|
||||
var buffered_input := BufferedInput.new()
|
||||
buffered_input.direction = _current_direction
|
||||
buffered_input.event = event
|
||||
buffered_input.time = Time.get_ticks_usec()
|
||||
_input_buffer.push_back(buffered_input)
|
||||
handle_buffered_inputs()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Walking on the floor
|
||||
if is_on_floor():
|
||||
if sign(velocity.x) != sign(_current_direction.x):
|
||||
velocity.x *= grounded_speed_stop_decay ** delta
|
||||
else:
|
||||
velocity.x *= grounded_speed_decay ** delta
|
||||
var target_vel_x := _current_direction.x * walk_max_speed
|
||||
var is_walking := target_vel_x != 0
|
||||
if not is_walking or abs(velocity.x) < walk_max_speed:
|
||||
velocity.x = move_toward(
|
||||
velocity.x,
|
||||
target_vel_x,
|
||||
walk_accel * delta,
|
||||
)
|
||||
# Air control
|
||||
else:
|
||||
velocity.x += _current_direction.x * air_accel * delta
|
||||
|
||||
# Move up while holding jump
|
||||
if _jump_ascent_remaining_time > 0:
|
||||
velocity.y = -jump_ascent_speed
|
||||
_jump_ascent_remaining_time -= delta
|
||||
if _jump_ascent_remaining_time < 0:
|
||||
velocity += get_gravity() * -_jump_ascent_remaining_time
|
||||
elif not is_on_floor():
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
# Drag while in air
|
||||
if not is_on_floor() and _jump_ascent_remaining_time <= 0:
|
||||
var drag_force := -0.01 * velocity * velocity.abs()
|
||||
velocity += drag_force * delta
|
||||
|
||||
move_and_slide()
|
||||
|
||||
_jump_allowed_time = max(0, _jump_allowed_time - delta)
|
||||
if is_on_floor():
|
||||
_jump_allowed_time = late_jump_time_limit
|
||||
|
||||
if is_on_ceiling():
|
||||
_is_jumping = false
|
||||
_jump_ascent_remaining_time = 0
|
||||
|
||||
if _is_holding_wall():
|
||||
velocity.y = min(5.0, velocity.y)
|
||||
_is_facing_right = sign(get_wall_normal().x) > 0
|
||||
|
||||
|
||||
func _is_holding_wall() -> bool:
|
||||
return (not is_on_floor()
|
||||
and is_on_wall()
|
||||
and sign(get_wall_normal().x) != sign(_current_direction.x)
|
||||
and _current_direction.x != 0 )
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
handle_buffered_inputs()
|
||||
%Body.scale.x = 1 if _is_facing_right else -1
|
||||
if _is_holding_wall():
|
||||
%Body.play(&"wall_grab")
|
||||
elif is_on_floor() and _current_direction.x != 0.0:
|
||||
%Body.play(&"walk")
|
||||
else:
|
||||
%Body.play(&"idle")
|
||||
|
||||
|
||||
func handle_buffered_inputs() -> void:
|
||||
var input_found := false
|
||||
var current_time := Time.get_ticks_usec()
|
||||
|
||||
# Clear expired input buffer items
|
||||
while (not _input_buffer.is_empty()
|
||||
and _input_buffer[0].time + _max_input_buffer_time_usec < current_time ):
|
||||
_input_buffer.pop_front()
|
||||
|
||||
# Check new commands
|
||||
for i in _input_buffer.size():
|
||||
var input := _input_buffer[i]
|
||||
if input.event.is_action(&"jump"):
|
||||
# Grounded jump
|
||||
if (input.event.is_pressed()
|
||||
and _jump_allowed_time > 0
|
||||
and (not is_on_floor() or input.direction.y <= 0) ):
|
||||
input_found = true
|
||||
_jump_allowed_time = 0
|
||||
_jump_ascent_remaining_time = jump_ascent_max_time
|
||||
_is_jumping = true
|
||||
elif (input.event.is_pressed()
|
||||
and is_on_wall() ):
|
||||
input_found = true
|
||||
_jump_allowed_time = 0
|
||||
velocity += get_wall_normal() * 200.0
|
||||
velocity.y = min(0, velocity.y)
|
||||
# Jump cuts
|
||||
elif input.event.is_released() and _is_jumping:
|
||||
_is_jumping = false
|
||||
_jump_ascent_remaining_time = 0
|
||||
# Jump cut only once, if we're still moving up
|
||||
if velocity.y < 0:
|
||||
velocity.y *= 0.1
|
||||
elif input.event.is_action_pressed(&"attack"):
|
||||
input_found = true
|
||||
velocity.x += (1 if _is_facing_right else -1) * slash_speed_boost
|
||||
$AnimationPlayer.play("slash")
|
||||
|
||||
if input_found:
|
||||
_input_buffer = _input_buffer.slice(i + 1)
|
||||
break
|
||||
1
player/player.gd.uid
Normal file
1
player/player.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bx500kvj301vt
|
||||
155
player/player.tscn
Normal file
155
player/player.tscn
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
[gd_scene format=3 uid="uid://ce2k04khaub8n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bx500kvj301vt" path="res://player/player.gd" id="1_g1dw6"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://d0dy3j0qdycqf" path="res://player/player.aseprite" id="2_yw30f"]
|
||||
[ext_resource type="Texture2D" uid="uid://blw6f2ktsrcmg" path="res://player/hair.aseprite" id="3_qjkh3"]
|
||||
[ext_resource type="Script" uid="uid://b7shvbf7iv6an" path="res://spring2d.gd" id="4_yw30f"]
|
||||
[ext_resource type="Script" uid="uid://bk0k3j7th00wu" path="res://player/ribbon.gd" id="5_qjkh3"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_e2o6t"]
|
||||
radius = 4.0
|
||||
height = 14.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_g6k8r"]
|
||||
length = 0.001
|
||||
step = 0.016666668
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Body/Ribbon:position:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(2),
|
||||
"points": PackedFloat32Array(1, -0.1666675, 0, 0.1666675, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Body/Ribbon:position:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(2),
|
||||
"points": PackedFloat32Array(1, -0.1666675, 0, 0.1666675, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Body/Ribbon:new_segments_damage")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qjkh3"]
|
||||
resource_name = "slash"
|
||||
length = 0.20000167
|
||||
step = 0.016666668
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Body/Ribbon:position:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 2, 2, 2, 2, 2, 2, 2, 0),
|
||||
"points": PackedFloat32Array(3, 0, 0, 0.027242973, 2.1666667, 5, -6.0920916e-05, 0.02146086, 0.002777778, -0.9785392, -5, -0.002777778, 0.5833334, 0.002777778, -0.5833334, -3, -0.002777778, -0.75, 0.0027777783, 0.75000006, 21, -0.0027777783, -2.2500002, 0.0027777776, 2.2499998, 46, -0.0027777776, 0.45238093, 0.016666668, -2.7142859, 9, -0.016666668, 5.7148743, 0.005692142, -1.9517924, 2, -0.005555558, 1.4640074, 0.00013658404, -0.035992794, 0, -0.0029143642, 0.16666667, 0, 0),
|
||||
"times": PackedFloat32Array(-0.00036552548, 0, 0.016666668, 0.033333335, 0.050000004, 0.06666667, 0.16666667, 0.20000002, 0.20081952)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Body/Ribbon:position:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 2, 2, 2, 2, 2, 2, 2, 0),
|
||||
"points": PackedFloat32Array(2, 0, 0, 0.027242973, -0.33333334, 5, -6.0920916e-05, 0, 0.002777778, 0, 3, -0.002777778, 0.6666667, 0.002777778, -0.6666667, -4, -0.002777778, 0.49999997, 0.0027777783, -0.5, -6, -0.0027777783, -0.33333337, 0.0027777776, 0.33333328, 0, -0.0027777776, -0.23809522, 0.016666668, 1.4285715, 8, -0.016666668, 0, 0.005692142, 0, 3, -0.005555558, 1.3013397, 0.00013658404, -0.03199359, 0, -0.0029143642, -0.16666667, 0, 0),
|
||||
"times": PackedFloat32Array(-0.00036552548, 0, 0.016666668, 0.033333335, 0.050000004, 0.06666667, 0.16666667, 0.20000002, 0.20081952)
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Body/Ribbon:new_segments_damage")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.016666668, 0.16666667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true, false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_g6k8r"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_g6k8r"),
|
||||
&"slash": SubResource("Animation_qjkh3")
|
||||
}
|
||||
|
||||
[node name="Player" type="CharacterBody2D" unique_id=500011307]
|
||||
physics_interpolation_mode = 1
|
||||
collision_layer = 2
|
||||
floor_constant_speed = true
|
||||
floor_max_angle = 0.24783675
|
||||
script = ExtResource("1_g1dw6")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=84142517]
|
||||
position = Vector2(0, 1)
|
||||
shape = SubResource("CapsuleShape2D_e2o6t")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="." unique_id=1975474809]
|
||||
limit_enabled = false
|
||||
|
||||
[node name="Body" type="AnimatedSprite2D" parent="." unique_id=559621433]
|
||||
unique_name_in_owner = true
|
||||
sprite_frames = ExtResource("2_yw30f")
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
metadata/_aseprite_wizard_interface_config_ = {
|
||||
"animation_section": true,
|
||||
"layer_section": false,
|
||||
"output_section": false,
|
||||
"pending_changes": {
|
||||
"source": "res://player/player.aseprite"
|
||||
},
|
||||
"slice_section": false
|
||||
}
|
||||
metadata/_aseprite_wizard_config_ = {
|
||||
"embed_tex": true,
|
||||
"layers": [],
|
||||
"o_ex_p": "",
|
||||
"o_folder": "",
|
||||
"o_name": "",
|
||||
"only_visible": false,
|
||||
"scale": "1.0",
|
||||
"should_round_fps": true,
|
||||
"slice": "",
|
||||
"source": "res://player.aseprite",
|
||||
"source_uid": 8921683997410207965
|
||||
}
|
||||
metadata/_aseprite_wizard_source_file_hash_ = "61168df4a163c039cfaab97f4fccb905"
|
||||
|
||||
[node name="Spring2D" type="Node2D" parent="Body" unique_id=1050714188]
|
||||
show_behind_parent = true
|
||||
script = ExtResource("4_yw30f")
|
||||
max_offset = Vector2(1, 2)
|
||||
|
||||
[node name="Hair" type="Sprite2D" parent="Body/Spring2D" unique_id=796557000]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-2, 2)
|
||||
texture = ExtResource("3_qjkh3")
|
||||
|
||||
[node name="Ribbon" type="Node2D" parent="Body" unique_id=45519559]
|
||||
position = Vector2(1, 1)
|
||||
script = ExtResource("5_qjkh3")
|
||||
color = Color(0.49411765, 0.76862746, 0.75686276, 1)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1251324400]
|
||||
libraries/ = SubResource("AnimationLibrary_g6k8r")
|
||||
114
player/ribbon.gd
Normal file
114
player/ribbon.gd
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
extends Node2D
|
||||
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
|
||||
var max_length: float = 120.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
|
||||
var distance_limit: float = 2000.0
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
|
||||
var segment_length: float = 5.0
|
||||
@export var color: Color
|
||||
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
|
||||
var width: float = 1.4
|
||||
@export var fall_speed: float = 5.5
|
||||
## The amount of different update groups to split points into.
|
||||
@export var point_update_groups: int = 3
|
||||
@export var new_segments_damage: bool = false
|
||||
|
||||
var _points: Array[RibbonPoint] = []
|
||||
class RibbonPoint:
|
||||
var position: Vector2
|
||||
|
||||
var _length: float:
|
||||
get():
|
||||
var current_length := 0.0
|
||||
for i in _points.size() - 1:
|
||||
var from = _points[i]
|
||||
var to = _points[i+1]
|
||||
current_length += from.position.distance_to(to.position)
|
||||
return current_length
|
||||
var _point_shape: Shape2D
|
||||
|
||||
func _ready() -> void:
|
||||
_point_shape = CircleShape2D.new()
|
||||
_point_shape.radius = width / 2.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var space_state = get_world_2d().direct_space_state
|
||||
var target := global_position
|
||||
if _points.is_empty() or _points.back().position.distance_to(position) > distance_limit:
|
||||
var point := RibbonPoint.new()
|
||||
point.position = target
|
||||
_points = [point]
|
||||
else:
|
||||
var head: RibbonPoint = _points.back()
|
||||
var distance = target.distance_to(head.position)
|
||||
if (distance > segment_length / 2.0):
|
||||
var point_count := ceili(distance / segment_length)
|
||||
for i in point_count:
|
||||
var t: float = float(i + 1) / point_count
|
||||
var point: RibbonPoint = RibbonPoint.new()
|
||||
point.position = lerp(head.position, target, t)
|
||||
_points.push_back(point)
|
||||
|
||||
if new_segments_damage:
|
||||
var query := PhysicsShapeQueryParameters2D.new()
|
||||
var shape = SegmentShape2D.new()
|
||||
shape.a = head.position
|
||||
shape.b = target
|
||||
query.shape = shape
|
||||
query.collision_mask = 0x0000_0004
|
||||
var results := space_state.intersect_shape(query)
|
||||
for result in results:
|
||||
print("hit creature", result.collider)
|
||||
|
||||
var current_length := _length
|
||||
while current_length > max_length:
|
||||
var popped = _points.pop_front()
|
||||
var tail = _points.front()
|
||||
current_length -= popped.position.distance_to(tail.position)
|
||||
|
||||
_update_points(delta)
|
||||
|
||||
func _update_points(delta: float) -> void:
|
||||
var space_state = get_world_2d().direct_space_state
|
||||
var query = PhysicsShapeQueryParameters2D.new()
|
||||
query.shape = _point_shape
|
||||
query.collision_mask = 0x0000_0001
|
||||
|
||||
for i in range(randi() % point_update_groups, _points.size() - 1, point_update_groups):
|
||||
# Skipping the head on purpose, so it doesn't keep falling away,
|
||||
# crating more and more points.
|
||||
var point = _points[i]
|
||||
var next = _points[i+1]
|
||||
|
||||
# Gravity
|
||||
if (point.position.distance_to(next.position) <= segment_length * 1.5
|
||||
or point.position.y < next.position.y):
|
||||
var fall_distance = fall_speed * delta * point_update_groups
|
||||
query.transform = Transform2D.IDENTITY.translated(point.position)
|
||||
query.motion = Vector2.DOWN * fall_distance
|
||||
var result := space_state.cast_motion(query)
|
||||
var safe_proportion := result[0]
|
||||
point.position = point.position + query.motion * safe_proportion
|
||||
|
||||
# Pull together
|
||||
var distance_to_next: float = point.position.distance_to(next.position)
|
||||
if distance_to_next > segment_length:
|
||||
var move_distance = distance_to_next - segment_length
|
||||
query.transform = Transform2D.IDENTITY.translated(point.position)
|
||||
query.motion = (next.position - point.position).normalized() * move_distance
|
||||
var result := space_state.cast_motion(query)
|
||||
var safe_proportion := result[0]
|
||||
point.position = point.position + query.motion * safe_proportion
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
queue_redraw()
|
||||
|
||||
var _packed_points = PackedVector2Array()
|
||||
func _draw() -> void:
|
||||
draw_set_transform_matrix(global_transform.affine_inverse())
|
||||
if (_points.size() < 2): return
|
||||
_packed_points.resize(_points.size())
|
||||
for i in _points.size():
|
||||
_packed_points[i] = _points[i].position
|
||||
draw_polyline(_packed_points, color, width, false)
|
||||
1
player/ribbon.gd.uid
Normal file
1
player/ribbon.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bk0k3j7th00wu
|
||||
Loading…
Add table
Add a link
Reference in a new issue