scaling objects or the player works

This commit is contained in:
Fabio 2024-08-18 02:48:09 +02:00
parent 2c08e2d99c
commit 138d4c2cfb
9 changed files with 95 additions and 27 deletions

View file

@ -0,0 +1,24 @@
extends StaticBody2D
@export var scale_up_target: Vector2 = Vector2(3.0, 3.0)
@export var scale_down_target: Vector2 = Vector2(0.5, 0.5)
@export var scale_duration: float = 0.5
func scale_up():
var tween = create_tween()
tween.tween_property(self, "scale", scale_up_target, scale_duration)
# TODO: scale the player
func scale_down():
var tween = create_tween()
tween.tween_property(self, "scale", scale_down_target, scale_duration)
# TODO: scale the player
func _on_input_event(viewport, event, shape_idx):
print("works")
if event is InputEventMouseButton and event.pressed:
if Input.is_action_just_pressed("click"):
scale_up()
elif Input.is_action_just_pressed("clickR"):
scale_down()