diff options
Diffstat (limited to 'demos/2d/hdr')
-rw-r--r-- | demos/2d/hdr/beach_cave.gd | 29 | ||||
-rw-r--r-- | demos/2d/hdr/beach_cave.scn | bin | 2972 -> 4834 bytes | |||
-rw-r--r-- | demos/2d/hdr/engine.cfg | 1 | ||||
-rw-r--r-- | demos/2d/hdr/icon.png | bin | 0 -> 3962 bytes |
4 files changed, 13 insertions, 17 deletions
diff --git a/demos/2d/hdr/beach_cave.gd b/demos/2d/hdr/beach_cave.gd index 9dffbc4662..fcc878e565 100644 --- a/demos/2d/hdr/beach_cave.gd +++ b/demos/2d/hdr/beach_cave.gd @@ -1,26 +1,21 @@ extends Node2D -# member variables here, example: -# var a=2 -# var b="textvar" -const CAVE_LIMIT=1000 +# Member variables +const CAVE_LIMIT = 1000 -func _input(ev): - if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask&1): - var rel_x = ev.relative_x + +func _input(event): + if (event.type == InputEvent.MOUSE_MOTION and event.button_mask&1): + var rel_x = event.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 + 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 - - diff --git a/demos/2d/hdr/beach_cave.scn b/demos/2d/hdr/beach_cave.scn Binary files differindex 4147a130ad..6a4108e7a5 100644 --- a/demos/2d/hdr/beach_cave.scn +++ b/demos/2d/hdr/beach_cave.scn diff --git a/demos/2d/hdr/engine.cfg b/demos/2d/hdr/engine.cfg index 3d8b4222d5..ab53a022f0 100644 --- a/demos/2d/hdr/engine.cfg +++ b/demos/2d/hdr/engine.cfg @@ -2,6 +2,7 @@ name="HDR for 2D" main_scene="res://beach_cave.scn" +icon="res://icon.png" [display] diff --git a/demos/2d/hdr/icon.png b/demos/2d/hdr/icon.png Binary files differnew file mode 100644 index 0000000000..461cd4638a --- /dev/null +++ b/demos/2d/hdr/icon.png |