FishGame/World.gd
2022-01-20 23:33:07 -05:00

10 lines
269 B
GDScript

extends Node2D
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("Spawn Food"):
var food = load("res://Food.tscn").instance()
food.position = Vector2(get_global_mouse_position().x, -25)
food.rotation = deg2rad(360)
add_child(food)