godot/demos/2d/hdr/beach_cave.gd
Juan Linietsky 53e1694e1e New option to send canvas to render buffer
allows to use 3D environment effects for post processing such as Glow,
Bloom, HDR, etc. in 2D.
2015-03-16 01:14:59 -03:00

27 lines
474 B
GDScript

extends Node2D
# member variables here, example:
# var a=2
# var b="textvar"
const CAVE_LIMIT=1000
func _input(ev):
if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask&1):
var rel_x = ev.relative_x
var cavepos = get_node("cave").get_pos()
cavepos.x+=rel_x
if (cavepos.x<-CAVE_LIMIT):
cavepos.x=-CAVE_LIMIT
elif (cavepos.x>0):
cavepos.x=0
get_node("cave").set_pos(cavepos)
func _ready():
set_process_input(true)
# Initialization here
pass