Skip to content

Instantly share code, notes, and snippets.

@blackwolf12333
Created February 6, 2015 15:07
Show Gist options
  • Save blackwolf12333/39d22ef96634eab5a17a to your computer and use it in GitHub Desktop.
Save blackwolf12333/39d22ef96634eab5a17a to your computer and use it in GitHub Desktop.
extends Node2D
# member variables here, example:
# var a=2
# var b="textvar"
func _ready():
set_process_input(true)
pass
func _input(event):
if event.type == InputEvent.SCREEN_DRAG:
if event.is_pressed():
# determine whether this is a valid drag
# new action event
# name: right_wing_drag
# handle this action in player.gd
# I am not making a difference here whether this should do anything or not
# that's up to player.gd
print(event.relative_pos)
if (event.relative_pos.y < 0) && (event.relative_pos.x < 0):
print("right_wing_drag")
if event.type == InputEvent.SCREEN_TOUCH:
if event.is_pressed():
# create and setup new action
print("right_wing_touch")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment