diff options
Diffstat (limited to 'demos/2d/dynamic_collision_shapes')
-rw-r--r-- | demos/2d/dynamic_collision_shapes/ball.gd | 21 | ||||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/ball.png | bin | 0 -> 321 bytes | |||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/ball.scn | bin | 0 -> 1898 bytes | |||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/box.png | bin | 0 -> 253 bytes | |||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/circle.png | bin | 0 -> 889 bytes | |||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/dynamic_colobjs.gd | 23 | ||||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/dynamic_colobjs.scn | bin | 0 -> 4348 bytes | |||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/engine.cfg | 4 | ||||
-rw-r--r-- | demos/2d/dynamic_collision_shapes/poly.png | bin | 0 -> 1638 bytes |
9 files changed, 48 insertions, 0 deletions
diff --git a/demos/2d/dynamic_collision_shapes/ball.gd b/demos/2d/dynamic_collision_shapes/ball.gd new file mode 100644 index 0000000000..c17b20f9c8 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/ball.gd @@ -0,0 +1,21 @@ + +extends RigidBody2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +var timeout=5 + +func _process(delta): + timeout-=delta + if (timeout<1): + set_opacity(timeout) + if (timeout<0): + queue_free() +func _ready(): + set_process(true) + # Initialization here + pass + + diff --git a/demos/2d/dynamic_collision_shapes/ball.png b/demos/2d/dynamic_collision_shapes/ball.png Binary files differnew file mode 100644 index 0000000000..b7cf71da29 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/ball.png diff --git a/demos/2d/dynamic_collision_shapes/ball.scn b/demos/2d/dynamic_collision_shapes/ball.scn Binary files differnew file mode 100644 index 0000000000..e332de276d --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/ball.scn diff --git a/demos/2d/dynamic_collision_shapes/box.png b/demos/2d/dynamic_collision_shapes/box.png Binary files differnew file mode 100644 index 0000000000..f29b83ce38 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/box.png diff --git a/demos/2d/dynamic_collision_shapes/circle.png b/demos/2d/dynamic_collision_shapes/circle.png Binary files differnew file mode 100644 index 0000000000..9fdfa550b1 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/circle.png diff --git a/demos/2d/dynamic_collision_shapes/dynamic_colobjs.gd b/demos/2d/dynamic_collision_shapes/dynamic_colobjs.gd new file mode 100644 index 0000000000..a6a42a1914 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/dynamic_colobjs.gd @@ -0,0 +1,23 @@ + +extends Node2D + +# member variables here, example: +# var a=2 +# var b="textvar" +const EMIT_INTERVAL=0.1 +var timeout=EMIT_INTERVAL + +func _process(delta): + timeout-=delta + if (timeout<0): + timeout=EMIT_INTERVAL + var ball = preload("res://ball.scn").instance() + ball.set_pos( Vector2(randf() * get_viewport_rect().size.x, 0) ) + add_child(ball) + +func _ready(): + set_process(true) + # Initialization here + pass + + diff --git a/demos/2d/dynamic_collision_shapes/dynamic_colobjs.scn b/demos/2d/dynamic_collision_shapes/dynamic_colobjs.scn Binary files differnew file mode 100644 index 0000000000..e6d1ebf9cf --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/dynamic_colobjs.scn diff --git a/demos/2d/dynamic_collision_shapes/engine.cfg b/demos/2d/dynamic_collision_shapes/engine.cfg new file mode 100644 index 0000000000..536b75f2f2 --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Run-Time CollisionShape" +main_scene="res://dynamic_colobjs.scn" diff --git a/demos/2d/dynamic_collision_shapes/poly.png b/demos/2d/dynamic_collision_shapes/poly.png Binary files differnew file mode 100644 index 0000000000..49ed55cc7d --- /dev/null +++ b/demos/2d/dynamic_collision_shapes/poly.png |