Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Sprite
- func _ready():
- set_process_input(true)
- pass
- func _input(event):
- if Input.is_action_pressed("ui_left"):
- set_rot(get_rot() +.785398)
- if Input.is_action_pressed("ui_right"):
- set_rot(get_rot() -.785398)
- if Input.is_action_pressed("ui_down"):
- var bullet = preload("res://bullet.scn").instance()
- var dir = get_node("shootto").get_global_pos() - get_node("shootfrom").get_global_pos()
- bullet.fire(dir)
- get_parent().add_child(bullet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement