stuff
This commit is contained in:
commit
9c73015b32
10 changed files with 115 additions and 26 deletions
|
@ -4,15 +4,23 @@ extends Node
|
|||
|
||||
var current_selected = "none";
|
||||
|
||||
<<<<<<< HEAD
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("click"):
|
||||
=======
|
||||
@export var scale_duration: float = 0.5
|
||||
var target_scale: Vector2 = Vector2(1, 1)
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("click"):
|
||||
>>>>>>> dev
|
||||
if current_selected == "scale_up":
|
||||
scale_up()
|
||||
elif current_selected == "scale_down":
|
||||
scale_down()
|
||||
elif current_selected == "mirror":
|
||||
mirror();
|
||||
|
||||
|
||||
|
||||
func select_up():
|
||||
current_selected = "scale_up"
|
||||
|
@ -20,14 +28,30 @@ func select_up():
|
|||
func select_down():
|
||||
current_selected = "scale_down"
|
||||
|
||||
|
||||
func select_mirror():
|
||||
current_selected = "mirror"
|
||||
|
||||
|
||||
func scale_up():
|
||||
pass #Hir hochscalieren einbauen
|
||||
|
||||
var pPos = player.position
|
||||
pPos.x += 1280/2
|
||||
pPos.y += 720/2
|
||||
if player.scale.x < 2 and get_viewport().get_mouse_position().distance_to(pPos) < 12:
|
||||
target_scale = Vector2(2.0, 2.0)
|
||||
start_scaling()
|
||||
|
||||
func scale_down():
|
||||
pass #Hir runterscalieren einbauen
|
||||
|
||||
var pPos = player.position
|
||||
pPos.x += 1280/2
|
||||
pPos.y += 720/2
|
||||
if player.scale.x > 1 and get_viewport().get_mouse_position().distance_to(pPos) < 12:
|
||||
target_scale = Vector2(1, 1)
|
||||
start_scaling()
|
||||
|
||||
func start_scaling():
|
||||
var tween = create_tween()
|
||||
tween.tween_property(player, "scale", target_scale, scale_duration)
|
||||
|
||||
func mirror():
|
||||
pass #Hir mirror einbauen einbauen
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue