Created
May 16, 2018 17:29
-
-
Save jedStevens/493e1ac52c8525b2faf2bbd5c9bc80c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Line2D | |
var _prev_pos = Vector2() | |
var points_size = 100 | |
func _ready(): | |
set_process(true) | |
for i in range(points_size): | |
add_point(Vector2()) | |
func _process(delta): | |
if Input.is_mouse_button_pressed(BUTTON_LEFT): | |
set_point_position(points_size-1,get_global_mouse_position()) | |
for i in range(points.size()-1): | |
set_point_position(i, points[i+1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment