From 0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 9 Feb 2014 22:10:30 -0300 Subject: GODOT IS OPEN SOURCE --- demos/2d/platformer/bullet.gd | 20 + demos/2d/platformer/bullet.png | Bin 0 -> 319 bytes demos/2d/platformer/bullet.xml | 285 +++++++++++++ demos/2d/platformer/coin.gd | 20 + demos/2d/platformer/coin.png | Bin 0 -> 3133 bytes demos/2d/platformer/coin.xml | 437 ++++++++++++++++++++ demos/2d/platformer/enemy.gd | 97 +++++ demos/2d/platformer/enemy.png | Bin 0 -> 3552 bytes demos/2d/platformer/enemy.xml | 481 ++++++++++++++++++++++ demos/2d/platformer/engine.cfg | 28 ++ demos/2d/platformer/icon.png | Bin 0 -> 1002 bytes demos/2d/platformer/moving_platform.gd | 27 ++ demos/2d/platformer/moving_platform.png | Bin 0 -> 2143 bytes demos/2d/platformer/moving_platform.xml | 196 +++++++++ demos/2d/platformer/music.ogg | Bin 0 -> 1692019 bytes demos/2d/platformer/osb_fire.png | Bin 0 -> 2233 bytes demos/2d/platformer/osb_jump.png | Bin 0 -> 1374 bytes demos/2d/platformer/osb_left.png | Bin 0 -> 1366 bytes demos/2d/platformer/osb_right.png | Bin 0 -> 1368 bytes demos/2d/platformer/parallax_bg.xml | 174 ++++++++ demos/2d/platformer/plank.png | Bin 0 -> 270 bytes demos/2d/platformer/plankpin.png | Bin 0 -> 253 bytes demos/2d/platformer/player.gd | 259 ++++++++++++ demos/2d/platformer/player.xml | 660 ++++++++++++++++++++++++++++++ demos/2d/platformer/robot_demo.png | Bin 0 -> 12399 bytes demos/2d/platformer/scroll_bg_cloud_1.png | Bin 0 -> 531 bytes demos/2d/platformer/scroll_bg_cloud_2.png | Bin 0 -> 719 bytes demos/2d/platformer/scroll_bg_cloud_3.png | Bin 0 -> 394 bytes demos/2d/platformer/scroll_bg_fg_1.png | Bin 0 -> 12137 bytes demos/2d/platformer/scroll_bg_fg_2.png | Bin 0 -> 13073 bytes demos/2d/platformer/scroll_bg_sky.png | Bin 0 -> 3023 bytes demos/2d/platformer/seesaw.xml | 197 +++++++++ demos/2d/platformer/sound_coin.wav | Bin 0 -> 63952 bytes demos/2d/platformer/sound_explode.wav | Bin 0 -> 75832 bytes demos/2d/platformer/sound_hit.wav | Bin 0 -> 71932 bytes demos/2d/platformer/sound_jump.wav | Bin 0 -> 82076 bytes demos/2d/platformer/sound_shoot.wav | Bin 0 -> 78888 bytes demos/2d/platformer/stage.xml | 324 +++++++++++++++ demos/2d/platformer/tiles_demo.png | Bin 0 -> 11736 bytes demos/2d/platformer/tileset.xml | 134 ++++++ demos/2d/platformer/tileset_edit.xml | 285 +++++++++++++ demos/2d/platformer/types.cache | 64 +++ 42 files changed, 3688 insertions(+) create mode 100644 demos/2d/platformer/bullet.gd create mode 100644 demos/2d/platformer/bullet.png create mode 100644 demos/2d/platformer/bullet.xml create mode 100644 demos/2d/platformer/coin.gd create mode 100644 demos/2d/platformer/coin.png create mode 100644 demos/2d/platformer/coin.xml create mode 100644 demos/2d/platformer/enemy.gd create mode 100644 demos/2d/platformer/enemy.png create mode 100644 demos/2d/platformer/enemy.xml create mode 100644 demos/2d/platformer/engine.cfg create mode 100644 demos/2d/platformer/icon.png create mode 100644 demos/2d/platformer/moving_platform.gd create mode 100644 demos/2d/platformer/moving_platform.png create mode 100644 demos/2d/platformer/moving_platform.xml create mode 100644 demos/2d/platformer/music.ogg create mode 100644 demos/2d/platformer/osb_fire.png create mode 100644 demos/2d/platformer/osb_jump.png create mode 100644 demos/2d/platformer/osb_left.png create mode 100644 demos/2d/platformer/osb_right.png create mode 100644 demos/2d/platformer/parallax_bg.xml create mode 100644 demos/2d/platformer/plank.png create mode 100644 demos/2d/platformer/plankpin.png create mode 100644 demos/2d/platformer/player.gd create mode 100644 demos/2d/platformer/player.xml create mode 100644 demos/2d/platformer/robot_demo.png create mode 100644 demos/2d/platformer/scroll_bg_cloud_1.png create mode 100644 demos/2d/platformer/scroll_bg_cloud_2.png create mode 100644 demos/2d/platformer/scroll_bg_cloud_3.png create mode 100644 demos/2d/platformer/scroll_bg_fg_1.png create mode 100644 demos/2d/platformer/scroll_bg_fg_2.png create mode 100644 demos/2d/platformer/scroll_bg_sky.png create mode 100644 demos/2d/platformer/seesaw.xml create mode 100644 demos/2d/platformer/sound_coin.wav create mode 100644 demos/2d/platformer/sound_explode.wav create mode 100644 demos/2d/platformer/sound_hit.wav create mode 100644 demos/2d/platformer/sound_jump.wav create mode 100644 demos/2d/platformer/sound_shoot.wav create mode 100644 demos/2d/platformer/stage.xml create mode 100644 demos/2d/platformer/tiles_demo.png create mode 100644 demos/2d/platformer/tileset.xml create mode 100644 demos/2d/platformer/tileset_edit.xml create mode 100644 demos/2d/platformer/types.cache (limited to 'demos/2d/platformer') diff --git a/demos/2d/platformer/bullet.gd b/demos/2d/platformer/bullet.gd new file mode 100644 index 0000000000..6836116aa4 --- /dev/null +++ b/demos/2d/platformer/bullet.gd @@ -0,0 +1,20 @@ + +extends RigidBody2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +var disabled=false + +func disable(): + if (disabled): + return + get_node("anim").play("shutdown") + disabled=true + +func _ready(): + # Initalization here + pass + + diff --git a/demos/2d/platformer/bullet.png b/demos/2d/platformer/bullet.png new file mode 100644 index 0000000000..5c722219ec Binary files /dev/null and b/demos/2d/platformer/bullet.png differ diff --git a/demos/2d/platformer/bullet.xml b/demos/2d/platformer/bullet.xml new file mode 100644 index 0000000000..9de518c703 --- /dev/null +++ b/demos/2d/platformer/bullet.xml @@ -0,0 +1,285 @@ + + + + + + "" + 0 + 10 + + + + "shutdown" + 1.5 + False + 0 + "value" + "particles:config/emitting" + 1 + + "cont" + False + "transitions" + 1 + "values" + + False + + "times" + 0 + + "value" + "sprite:visibility/self_opacity" + 1 + + "cont" + True + "transitions" + 1, 1 + "values" + + 1 + 0 + + "times" + 0, 1.00394 + + "method" + "." + 1 + + "transitions" + 1 + "values" + + + "args" + + + "method" + "queue_free" + + + "times" + 1.31 + + + + + "" + + "names" + + "bullet" + "RigidBody2D" + "process/process" + "process/fixed_process" + "process/input" + "process/unhandled_input" + "process/mode" + "visibility/visible" + "visibility/toplevel" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "visibility/blend_mode" + "transform/notify" + "transform/pos" + "transform/rot" + "transform/scale" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "mode" + "mass" + "friction" + "bounce" + "custom_integrator" + "continuous_cd" + "contacts_reported" + "contact_monitor" + "active" + "can_sleep" + "velocity/linear" + "velocity/angular" + "script/script" + "__meta__" + "particles" + "Particles2D" + "config/amount" + "config/lifetime" + "config/preprocess" + "config/emit_timeout" + "config/emitting" + "config/offset" + "config/half_extents" + "config/local_space" + "config/explosiveness" + "config/texture" + "params/direction" + "params/spread" + "params/linear_velocity" + "params/spin_velocity" + "params/gravity_direction" + "params/gravity_strength" + "params/radial_accel" + "params/tangential_accel" + "params/damping" + "params/initial_size" + "params/final_size" + "params/hue_variation" + "randomness/direction" + "randomness/spread" + "randomness/linear_velocity" + "randomness/spin_velocity" + "randomness/gravity_direction" + "randomness/gravity_strength" + "randomness/radial_accel" + "randomness/tangential_accel" + "randomness/damping" + "randomness/initial_size" + "randomness/final_size" + "randomness/hue_variation" + "color_phases/count" + "phase_0/pos" + "phase_0/color" + "phase_1/pos" + "phase_1/color" + "phase_2/pos" + "phase_2/color" + "phase_3/pos" + "phase_3/color" + "sprite" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "CollisionShape2D" + "shape" + "Timer" + "wait_time" + "one_shot" + "autostart" + "anim" + "AnimationPlayer" + "playback/process_mode" + "playback/default_blend_time" + "root/root" + "speed" + "anims/shutdown" + "blend_times" + "autoplay" + "disable" + "timeout" + + "version" + 1 + "conn_count" + 1 + "node_count" + 6 + "variants" + + False + 0 + True + 1 + 0, 0 + 0 + 1, 1 + 1 + + 1, 0, 0, 1, 0, 0 + + + "__editor_plugin_states__" + + "Script" + + "current" + 0 + "sources" + + "res://enemy.gd" + "res://player.gd" + "res://bullet.gd" + + + "2D" + + "zoom" + 3.424785 + "ofs" + -74.7573, -35.9676 + + "3D" + + "zfar" + 500 + "fov" + 45 + "window_mode" + 0 + "window_0" + + "distance" + 10.07268 + "default_light" + True + "x_rot" + 0.337 + "y_rot" + -0.575 + "show_grid" + True + "show_origin" + True + "pos" + 0, 0, 0 + + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "Script" + + 0.559322 + 24 + 0.1 + + 10 + 2 + 1, 1, 1, 1 + 1, 0, 0, 0 + 0, 0, 0, 1 + 0, 0, 0, 0 + ".." + + + + "" + + "nodes" + -1, -1, 1, 0, -1, 32, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 7, 2, 8, 0, 9, 3, 10, 3, 11, 2, 12, 1, 13, 2, 14, 4, 15, 5, 16, 6, 17, 7, 18, 8, 19, 9, 20, 1, 21, 3, 22, 3, 23, 5, 24, 0, 25, 0, 26, 1, 27, 0, 28, 2, 29, 2, 30, 4, 31, 5, 32, 10, 33, 11, 0, 0, 0, 35, 34, -1, 59, 2, 2, 3, 0, 4, 0, 5, 0, 6, 1, 7, 2, 8, 0, 9, 12, 10, 3, 11, 2, 12, 7, 13, 0, 14, 4, 15, 5, 16, 6, 36, 13, 37, 14, 38, 5, 39, 5, 40, 2, 41, 4, 42, 4, 43, 0, 44, 3, 45, 15, 46, 5, 47, 16, 48, 5, 49, 5, 50, 5, 51, 5, 52, 5, 53, 5, 54, 5, 55, 3, 56, 5, 57, 5, 58, 5, 59, 5, 60, 5, 61, 5, 62, 5, 63, 5, 64, 5, 65, 5, 66, 5, 67, 5, 68, 5, 69, 5, 70, 17, 71, 5, 72, 18, 73, 3, 74, 19, 75, 3, 76, 20, 77, 3, 78, 20, 32, 21, 0, 0, 0, 80, 79, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 7, 2, 8, 0, 9, 3, 10, 3, 11, 2, 12, 1, 13, 0, 14, 4, 15, 5, 16, 6, 81, 15, 82, 2, 83, 4, 84, 0, 85, 0, 86, 7, 87, 7, 88, 1, 89, 18, 90, 0, 91, 22, 32, 21, 0, 0, 0, 92, 92, -1, 17, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 7, 2, 8, 0, 9, 3, 10, 3, 11, 2, 12, 1, 13, 2, 14, 4, 15, 5, 16, 6, 93, 8, 32, 21, 0, 0, 0, 94, 94, -1, 9, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 95, 3, 96, 2, 97, 2, 32, 21, 0, 0, 0, 99, 98, -1, 13, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 100, 7, 101, 5, 102, 23, 103, 3, 104, 24, 105, 25, 106, 26, 32, 21, 0 + "conns" + 4, 0, 108, 107, 2, 0 + + + + \ No newline at end of file diff --git a/demos/2d/platformer/coin.gd b/demos/2d/platformer/coin.gd new file mode 100644 index 0000000000..3e31a395ae --- /dev/null +++ b/demos/2d/platformer/coin.gd @@ -0,0 +1,20 @@ + +extends Area2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +var taken=false + + +func _on_body_enter( body ): + if (not taken and body extends preload("res://player.gd")): + get_node("anim").play("taken") + taken=true + + +func _ready(): + # Initalization here + pass + diff --git a/demos/2d/platformer/coin.png b/demos/2d/platformer/coin.png new file mode 100644 index 0000000000..c35c5ebf28 Binary files /dev/null and b/demos/2d/platformer/coin.png differ diff --git a/demos/2d/platformer/coin.xml b/demos/2d/platformer/coin.xml new file mode 100644 index 0000000000..194ea711b0 --- /dev/null +++ b/demos/2d/platformer/coin.xml @@ -0,0 +1,437 @@ + + + + + + + + 0 + 10 + + + + "taken" + 8 + False + 0 + "value" + "sprite:frame" + 1 + + "cont" + True + "transitions" + 1 + "values" + + 0 + + "times" + 0 + + "value" + "sound:play/play" + 1 + + "cont" + False + "transitions" + 1 + "values" + + "coin" + + "times" + 0 + + "value" + "particles:visibility/self_opacity" + 1 + + "cont" + True + "transitions" + 1, 1 + "values" + + 1 + 0 + + "times" + 0, 1.66 + + "value" + "sprite:visibility/self_opacity" + 1 + + "cont" + True + "transitions" + 1, 1 + "values" + + 1 + 0 + + "times" + 0, 0.4 + + "value" + "particles:config/emitting" + 1 + + "cont" + False + "transitions" + 1 + "values" + + True + + "times" + 0 + + "method" + "." + 1 + + "transitions" + 1 + "values" + + + "args" + + + "method" + "queue_free" + + + "times" + 2.7 + + + + + "spin" + 1.5 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1, 1 + "values" + + 0 + 1 + 2 + 3 + 2 + 1 + 0 + + "times" + 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 + + + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + + + + "names" + + "coin" + "Area2D" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "shapes/0/trigger" + "gravity_point" + "gravity_vec" + "gravity" + "density" + "monitoring" + "script/script" + "__meta__" + "sprite" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "anim" + "AnimationPlayer" + "playback/process_mode" + "playback/default_blend_time" + "root/root" + "anims/taken" + "anims/spin" + "playback/active" + "playback/speed" + "blend_times" + "autoplay" + "collision" + "CollisionShape2D" + "shape" + "trigger" + "sound" + "SamplePlayer2D" + "params/volume_db" + "params/pitch_scale" + "params/attenuation/min_distance" + "params/attenuation/max_distance" + "params/attenuation/distance_exp" + "config/polyphony" + "config/samples" + "config/pitch_random" + "particles" + "Particles2D" + "visibility/blend_mode" + "config/amount" + "config/lifetime" + "config/time_scale" + "config/preprocess" + "config/emit_timeout" + "config/emitting" + "config/offset" + "config/half_extents" + "config/local_space" + "config/explosiveness" + "config/texture" + "params/direction" + "params/spread" + "params/linear_velocity" + "params/spin_velocity" + "params/orbit_velocity" + "params/gravity_direction" + "params/gravity_strength" + "params/radial_accel" + "params/tangential_accel" + "params/damping" + "params/initial_size" + "params/final_size" + "params/hue_variation" + "randomness/direction" + "randomness/spread" + "randomness/linear_velocity" + "randomness/spin_velocity" + "randomness/orbit_velocity" + "randomness/gravity_direction" + "randomness/gravity_strength" + "randomness/radial_accel" + "randomness/tangential_accel" + "randomness/damping" + "randomness/initial_size" + "randomness/final_size" + "randomness/hue_variation" + "color_phases/count" + "phase_0/pos" + "phase_0/color" + "phase_1/pos" + "phase_1/color" + "phase_2/pos" + "phase_2/color" + "phase_3/pos" + "phase_3/color" + "emission_points" + "enabler" + "VisibilityEnabler2D" + "rect" + "enabler/pause_animations" + "enabler/freeze_bodies" + "_on_body_enter" + "body_enter" + + "version" + 1 + "conn_count" + 1 + "node_count" + 7 + "variants" + + True + 1 + 0, 0 + 0 + 1, 1 + 1 + + 1, 0, 0, 1, 0, 0 + False + 0, 1 + 98 + 0.1 + + + "__editor_plugin_states__" + + "Script" + + "current" + 2 + "sources" + + "res://enemy.gd" + "res://player.gd" + "res://coin.gd" + + + "2D" + + "pixel_snap" + False + "zoom" + 3.794776 + "ofs" + -34.3697, -21.6562 + + "3D" + + "zfar" + 500 + "fov" + 45 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + + 4 + 0 + 1, 1, 1, 1 + 0, 0, 0, 0 + ".." + + + 3 + + + "spin" + 2048 + + 8 + 0.4 + 5, 5 + + 10 + 0.2 + 2 + 0, 0, 0, 1 + + -10, -10, 20, 20 + + "nodes" + -1, -1, 1, 0, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12, 8, 13, 8, 14, 9, 15, 10, 16, 11, 17, 0, 18, 12, 19, 13, 0, 0, 0, 21, 20, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 22, 14, 23, 0, 24, 2, 25, 8, 26, 8, 27, 5, 28, 15, 29, 16, 30, 17, 31, 8, 32, 18, 0, 0, 0, 34, 33, -1, 9, 35, 5, 36, 3, 37, 19, 38, 20, 39, 21, 40, 0, 41, 22, 42, 23, 43, 24, 0, 0, 0, 45, 44, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 46, 6, 47, 8, 0, 0, 0, 49, 48, -1, 15, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 50, 3, 51, 1, 52, 1, 53, 25, 54, 1, 55, 5, 56, 26, 57, 3, 0, 0, 0, 59, 58, -1, 55, 2, 0, 3, 1, 4, 1, 5, 0, 60, 5, 6, 2, 7, 3, 8, 4, 61, 27, 62, 28, 63, 1, 64, 3, 65, 3, 66, 8, 67, 2, 68, 29, 69, 0, 70, 1, 71, 30, 72, 3, 73, 31, 74, 3, 75, 3, 76, 3, 77, 3, 78, 3, 79, 3, 80, 3, 81, 3, 82, 32, 83, 32, 84, 3, 85, 3, 86, 3, 87, 3, 88, 3, 89, 3, 90, 3, 91, 3, 92, 3, 93, 3, 94, 3, 95, 3, 96, 3, 97, 3, 98, 33, 99, 3, 100, 17, 101, 1, 102, 34, 103, 1, 104, 34, 105, 1, 106, 34, 107, 35, 0, 0, 0, 109, 108, -1, 10, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 110, 36, 111, 0, 112, 0, 0 + "conns" + 0, 0, 114, 113, 2, 0 + + + + \ No newline at end of file diff --git a/demos/2d/platformer/enemy.gd b/demos/2d/platformer/enemy.gd new file mode 100644 index 0000000000..5ec7cb28a7 --- /dev/null +++ b/demos/2d/platformer/enemy.gd @@ -0,0 +1,97 @@ + +extends RigidBody2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +const STATE_WALKING = 0 +const STATE_DYING = 1 + + +var state = STATE_WALKING + + +var direction = -1 +var anim="" + +var rc_left=null +var rc_right=null +var WALK_SPEED = 50 + +var bullet_class = preload("res://bullet.gd") + +func _die(): + queue_free() + +func _pre_explode(): + #stay there + clear_shapes() + set_mode(MODE_STATIC) + get_node("sound").play("explode") + + +func _integrate_forces(s): + + var lv = s.get_linear_velocity() + var new_anim=anim + + if (state==STATE_DYING): + new_anim="explode" + elif (state==STATE_WALKING): + + new_anim="walk" + + var wall_side=0.0 + + for i in range(s.get_contact_count()): + var cc = s.get_contact_collider_object(i) + var dp = s.get_contact_local_normal(i) + + if (cc): + + + if (cc extends bullet_class and not cc.disabled): + set_mode(MODE_RIGID) + state=STATE_DYING + #lv=s.get_contact_local_normal(i)*400 + s.set_angular_velocity(sign(dp.x)*33.0) + set_friction(true) + cc.disable() + get_node("sound").play("hit") + + break + + + if (dp.x>0.9): + wall_side=1.0 + elif (dp.x<-0.9): + wall_side=-1.0 + + if (wall_side!=0 and wall_side!=direction): + + direction=-direction + get_node("sprite").set_scale( Vector2(-direction,1) ) + if (direction<0 and not rc_left.is_colliding() and rc_right.is_colliding()): + direction=-direction + get_node("sprite").set_scale( Vector2(-direction,1) ) + elif (direction>0 and not rc_right.is_colliding() and rc_left.is_colliding()): + direction=-direction + get_node("sprite").set_scale( Vector2(-direction,1) ) + + + lv.x = direction * WALK_SPEED + + if( anim!=new_anim ): + anim=new_anim + get_node("anim").play(anim) + + s.set_linear_velocity(lv) + + +func _ready(): + # Initalization here + rc_left=get_node("raycast_left") + rc_right=get_node("raycast_right") + + diff --git a/demos/2d/platformer/enemy.png b/demos/2d/platformer/enemy.png new file mode 100644 index 0000000000..37fe468b0f Binary files /dev/null and b/demos/2d/platformer/enemy.png differ diff --git a/demos/2d/platformer/enemy.xml b/demos/2d/platformer/enemy.xml new file mode 100644 index 0000000000..470797db46 --- /dev/null +++ b/demos/2d/platformer/enemy.xml @@ -0,0 +1,481 @@ + + + + + + + + + 0 + 14 + + + + "idle" + 6.75 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + "values" + + 5 + 6 + 5 + 6 + 5 + 6 + 7 + 6 + 7 + 5 + + "times" + 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 + + + + + "explode" + 6 + False + 0 + "value" + "sprite:visibility/self_opacity" + 1 + + "cont" + True + "transitions" + 1, 1 + "values" + + 1 + 0 + + "times" + 3.58422, 4.33851 + + "value" + "sprite:frame" + 1 + + "cont" + True + "transitions" + 1 + "values" + + 4 + + "times" + 0 + + "value" + "Particles2D:config/emitting" + 1 + + "cont" + False + "transitions" + 1 + "values" + + True + + "times" + 3.47394 + + "method" + "." + 1 + + "transitions" + 1, 1 + "values" + + + "args" + + + "method" + "_pre_explode" + + + "args" + + + "method" + "_die" + + + "times" + 3.20357, 5.07305 + + + + + "walk" + 1.25 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1 + "values" + + 0 + 1 + 2 + 3 + 4 + 0 + + "times" + 0, 0.25, 0.5, 0.75, 1, 1.25 + + + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + + + + "names" + + "enemy" + "RigidBody2D" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "shapes/0/trigger" + "shapes/1/shape" + "shapes/1/transform" + "shapes/1/trigger" + "shapes/2/shape" + "shapes/2/transform" + "shapes/2/trigger" + "mode" + "mass" + "friction" + "bounce" + "custom_integrator" + "continuous_cd" + "contacts_reported" + "contact_monitor" + "active" + "can_sleep" + "velocity/linear" + "velocity/angular" + "script/script" + "__meta__" + "enabler" + "VisibilityEnabler2D" + "rect" + "enabler/pause_animations" + "enabler/freeze_bodies" + "anim" + "AnimationPlayer" + "playback/process_mode" + "playback/default_blend_time" + "root/root" + "anims/idle" + "anims/explode" + "anims/walk" + "playback/active" + "playback/speed" + "blend_times" + "autoplay" + "CollisionShape2D" + "shape" + "trigger" + "CollisionShape2D 2" + "CollisionShape2D 3" + "sprite" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "raycast_left" + "RayCast2D" + "enabled" + "cast_to" + "raycast_right" + "Particles2D" + "visibility/blend_mode" + "config/amount" + "config/lifetime" + "config/time_scale" + "config/preprocess" + "config/emit_timeout" + "config/emitting" + "config/offset" + "config/half_extents" + "config/local_space" + "config/explosiveness" + "config/texture" + "params/direction" + "params/spread" + "params/linear_velocity" + "params/spin_velocity" + "params/orbit_velocity" + "params/gravity_direction" + "params/gravity_strength" + "params/radial_accel" + "params/tangential_accel" + "params/damping" + "params/initial_size" + "params/final_size" + "params/hue_variation" + "randomness/direction" + "randomness/spread" + "randomness/linear_velocity" + "randomness/spin_velocity" + "randomness/orbit_velocity" + "randomness/gravity_direction" + "randomness/gravity_strength" + "randomness/radial_accel" + "randomness/tangential_accel" + "randomness/damping" + "randomness/initial_size" + "randomness/final_size" + "randomness/hue_variation" + "color_phases/count" + "phase_0/pos" + "phase_0/color" + "phase_1/pos" + "phase_1/color" + "phase_2/pos" + "phase_2/color" + "phase_3/pos" + "phase_3/color" + "emission_points" + "sound" + "SamplePlayer2D" + "params/volume_db" + "params/pitch_scale" + "params/attenuation/min_distance" + "params/attenuation/max_distance" + "params/attenuation/distance_exp" + "config/polyphony" + "config/samples" + "config/pitch_random" + + "version" + 1 + "conn_count" + 0 + "node_count" + 11 + "variants" + + True + 1 + 0, 0 + 0 + 1, 1 + 3 + + 1, -0, 0, 1, -1.08072, -2.16144 + False + 1, -0, 0, 1, 6.48431, 3.24216 + 1, -0, 0, 1, -12.495, 3.53415 + 2 + 4 + + + "__editor_plugin_states__" + + "Script" + + "current" + 0 + "sources" + + "res://enemy.gd" + + + "2D" + + "pixel_snap" + False + "zoom" + 1.108033 + "ofs" + -227.625, -197.9 + + "3D" + + "zfar" + 500 + "fov" + 45 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + 16.2569, 11.0034 + 23.5056, 10.8629 + -10, -10, 20, 20 + 1 + ".." + + + + 3 + + + "" + -1.08072, -2.16144 + 6.48431, 3.24216 + -12.495, 3.53415 + + 8 + 1, 1, 1, 1 + 0, 0, 0, 0 + -33.2868, -9.34363 + 0, 45 + 29.1987, -9.34363 + 0.121212 + 32 + 0.5 + 0.1 + + 180 + 90 + 2 + 9.8 + 1, 0.884956, 0.823009, 1 + 0.768627, 0.389381, 0, 0 + 0, 0, 0, 1 + + 2048 + + + "nodes" + -1, -1, 1, 0, -1, 31, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12, 8, 13, 6, 14, 9, 15, 8, 16, 6, 17, 10, 18, 8, 19, 11, 20, 1, 21, 3, 22, 3, 23, 8, 24, 8, 25, 12, 26, 8, 27, 0, 28, 0, 29, 2, 30, 3, 31, 13, 32, 14, 0, 0, 0, 34, 33, -1, 10, 2, 0, 3, 1, 4, 1, 5, 0, 6, 15, 7, 3, 8, 16, 35, 17, 36, 0, 37, 0, 0, 0, 0, 39, 38, -1, 10, 40, 18, 41, 3, 42, 19, 43, 20, 44, 21, 45, 22, 46, 0, 47, 23, 48, 24, 49, 25, 0, 0, 0, 50, 50, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 26, 7, 3, 8, 4, 51, 6, 52, 8, 0, 0, 0, 50, 53, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 27, 7, 3, 8, 4, 51, 6, 52, 8, 0, 0, 0, 50, 54, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 28, 7, 3, 8, 4, 51, 6, 52, 8, 0, 0, 0, 56, 55, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 57, 29, 58, 0, 59, 2, 60, 8, 61, 8, 62, 18, 63, 30, 64, 12, 65, 31, 66, 8, 67, 32, 0, 0, 0, 69, 68, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 33, 7, 3, 8, 4, 70, 0, 71, 34, 0, 0, 0, 69, 72, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 35, 7, 3, 8, 4, 70, 0, 71, 34, 0, 0, 0, 73, 73, -1, 55, 2, 0, 3, 1, 4, 36, 5, 0, 74, 18, 6, 2, 7, 3, 8, 4, 75, 37, 76, 38, 77, 1, 78, 3, 79, 38, 80, 8, 81, 2, 82, 2, 83, 0, 84, 39, 85, 40, 86, 3, 87, 41, 88, 42, 89, 43, 90, 3, 91, 3, 92, 44, 93, 3, 94, 3, 95, 3, 96, 43, 97, 23, 98, 3, 99, 3, 100, 3, 101, 3, 102, 1, 103, 3, 104, 3, 105, 3, 106, 3, 107, 3, 108, 3, 109, 3, 110, 3, 111, 3, 112, 11, 113, 3, 114, 45, 115, 1, 116, 46, 117, 1, 118, 47, 119, 1, 120, 47, 121, 48, 0, 0, 0, 123, 122, -1, 15, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 124, 3, 125, 1, 126, 1, 127, 49, 128, 1, 129, 5, 130, 50, 131, 3, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/engine.cfg b/demos/2d/platformer/engine.cfg new file mode 100644 index 0000000000..0ca951ed00 --- /dev/null +++ b/demos/2d/platformer/engine.cfg @@ -0,0 +1,28 @@ +[application] + +name="Platformer" +main_scene="res://stage.xml" +icon="res://icon.png" +name_es="Plataformero" + +[display] + +width=800 +height=480 +stretch_2d=true + +[input] + +move_left=[key(Left), jbutton(0, 14)] +move_right=[key(Right), jbutton(0, 15)] +jump=[key(Up), jbutton(0, 0)] +shoot=[key(Space), jbutton(0, 2)] +spawn=[key(F1), jbutton(0, 11)] + +[physics_2d] + +default_gravity=700 + +[render] + +mipmap_policy=1 diff --git a/demos/2d/platformer/icon.png b/demos/2d/platformer/icon.png new file mode 100644 index 0000000000..da2c08eb53 Binary files /dev/null and b/demos/2d/platformer/icon.png differ diff --git a/demos/2d/platformer/moving_platform.gd b/demos/2d/platformer/moving_platform.gd new file mode 100644 index 0000000000..719d9e460e --- /dev/null +++ b/demos/2d/platformer/moving_platform.gd @@ -0,0 +1,27 @@ + +extends Node2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +export var motion = Vector2() +export var cycle = 1.0 +var accum=0.0 + +func _fixed_process(delta): + + accum += delta * (1.0/cycle) * PI * 2.0 + accum = fmod(accum,PI*2.0) + var d = sin(accum) + var xf = Matrix32() + xf[2]= motion * d + get_node("platform").set_transform(xf) + + +func _ready(): + # Initalization here + set_fixed_process(true) + pass + + diff --git a/demos/2d/platformer/moving_platform.png b/demos/2d/platformer/moving_platform.png new file mode 100644 index 0000000000..f01c6ea37f Binary files /dev/null and b/demos/2d/platformer/moving_platform.png differ diff --git a/demos/2d/platformer/moving_platform.xml b/demos/2d/platformer/moving_platform.xml new file mode 100644 index 0000000000..8f4e4c7741 --- /dev/null +++ b/demos/2d/platformer/moving_platform.xml @@ -0,0 +1,196 @@ + + + + + + 0 + -88, 24, -88, -24, 88, -24, 88, 24 + + + + + "names" + + "moving_platform" + "Node2D" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "script/script" + "__meta__" + "motion" + "cycle" + "platform" + "StaticBody2D" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "shapes/0/trigger" + "simulate_motion" + "constant_linear_velocity" + "constant_angular_velocity" + "friction" + "bounce" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "CollisionPolygon2D" + "build_mode" + "polygon" + + "version" + 1 + "conn_count" + 0 + "node_count" + 4 + "variants" + + True + 1 + 0, 0 + 0 + 1, 1 + + + "__editor_plugin_states__" + + "Script" + + "current" + 0 + "sources" + + "res://moving_platform.gd" + "res://enemy.gd" + "res://player.gd" + "res://coin.gd" + + + "2D" + + "pixel_snap" + False + "zoom" + 1.360373 + "ofs" + -210.652, -172.81 + + "3D" + + "zfar" + 500 + "fov" + 400 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + 1 + + 1, -0, 0, 1, 0, 0 + False + + 0 + 1, 1, 1, 1 + 0, 0, 0, 0 + -88, -24, 88, -24, 88, 24, -88, 24 + + "nodes" + -1, -1, 1, 0, -1, 11, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 2, 12, 1, 0, 0, 0, 14, 13, -1, 16, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 15, 7, 16, 8, 17, 9, 18, 10, 19, 0, 20, 2, 21, 3, 22, 1, 23, 3, 0, 1, 0, 24, 24, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 25, 11, 26, 0, 27, 2, 28, 10, 29, 10, 30, 7, 31, 7, 32, 12, 33, 13, 34, 10, 35, 14, 0, 1, 0, 36, 36, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 37, 12, 38, 15, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/music.ogg b/demos/2d/platformer/music.ogg new file mode 100644 index 0000000000..ed3e9f0a01 Binary files /dev/null and b/demos/2d/platformer/music.ogg differ diff --git a/demos/2d/platformer/osb_fire.png b/demos/2d/platformer/osb_fire.png new file mode 100644 index 0000000000..6f914cfe49 Binary files /dev/null and b/demos/2d/platformer/osb_fire.png differ diff --git a/demos/2d/platformer/osb_jump.png b/demos/2d/platformer/osb_jump.png new file mode 100644 index 0000000000..72ba032daa Binary files /dev/null and b/demos/2d/platformer/osb_jump.png differ diff --git a/demos/2d/platformer/osb_left.png b/demos/2d/platformer/osb_left.png new file mode 100644 index 0000000000..b8e08c2ce7 Binary files /dev/null and b/demos/2d/platformer/osb_left.png differ diff --git a/demos/2d/platformer/osb_right.png b/demos/2d/platformer/osb_right.png new file mode 100644 index 0000000000..0e5cbb0d54 Binary files /dev/null and b/demos/2d/platformer/osb_right.png differ diff --git a/demos/2d/platformer/parallax_bg.xml b/demos/2d/platformer/parallax_bg.xml new file mode 100644 index 0000000000..cc8cfe5de0 --- /dev/null +++ b/demos/2d/platformer/parallax_bg.xml @@ -0,0 +1,174 @@ + + + + + + + + + + "" + + "names" + + "parallax_bg" + "ParallaxBackground" + "process/process" + "process/fixed_process" + "process/input" + "process/unhandled_input" + "process/mode" + "layer" + "offset" + "rotation" + "scale" + "scroll/offset" + "scroll/base_offset" + "scroll/base_scale" + "scroll/limit_begin" + "scroll/limit_end" + "script/script" + "__meta__" + "sky" + "ParallaxLayer" + "visibility/visible" + "visibility/toplevel" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "visibility/blend_mode" + "transform/notify" + "transform/pos" + "transform/rot" + "transform/scale" + "motion/scale" + "motion/mirroring" + "Sprite" + "texture" + "centered" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "clouds" + "Sprite 2" + "Sprite 3" + "Sprite 4" + "Sprite 5" + "Sprite 6" + "mount_ 2" + "mount_1" + + "version" + 1 + "conn_count" + 0 + "node_count" + 14 + "variants" + + False + 0 + -1 + 0, 0 + 0 + 1, 1 + 0.7, 0 + + "__editor_plugin_states__" + + "Script" + + "current" + 0 + "sources" + + "res://moving_platform.gd" + "res://enemy.gd" + "res://player.gd" + "res://coin.gd" + + + "2D" + + "zoom" + 1 + "ofs" + -5, -25 + + "3D" + + "zfar" + 500 + "fov" + 45 + "window_mode" + 0 + "window_0" + + "distance" + 4 + "default_light" + True + "x_rot" + 0.337 + "y_rot" + -0.575 + "show_grid" + True + "show_origin" + True + "pos" + 0, 0, 0 + + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + True + 1 + 800, 0 + 32, 0.94 + + 1 + 1, 1, 1, 1 + 0, 0, 0, 0 + 0.1, 1 + 28, 127 + + 404, 24 + 154, 46 + + 525, 130 + 255, 158 + + 674, 70 + 0.2, 1 + 0, 225 + + 0, 0, 800, 256 + 0.4, 1 + + + "nodes" + -1, -1, 1, 0, -1, 16, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 3, 12, 3, 13, 6, 14, 3, 15, 3, 16, 7, 17, 8, 0, 0, 0, 19, 18, -1, 18, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 3, 28, 4, 29, 5, 30, 5, 31, 11, 16, 7, 0, 1, 0, 32, 32, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 3, 28, 4, 29, 12, 33, 13, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 0, 0, 19, 43, -1, 18, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 3, 28, 4, 29, 5, 30, 17, 31, 11, 16, 7, 0, 3, 0, 32, 32, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 18, 28, 4, 29, 5, 33, 19, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 3, 0, 32, 44, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 20, 28, 4, 29, 5, 33, 19, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 3, 0, 32, 45, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 21, 28, 4, 29, 5, 33, 22, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 3, 0, 32, 46, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 23, 28, 4, 29, 5, 33, 22, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 3, 0, 32, 47, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 24, 28, 4, 29, 5, 33, 25, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 3, 0, 32, 48, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 26, 28, 4, 29, 5, 33, 25, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 0, 42, 16, 16, 7, 0, 0, 0, 19, 49, -1, 18, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 3, 28, 4, 29, 5, 30, 27, 31, 11, 16, 7, 0, 10, 0, 32, 32, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 28, 28, 4, 29, 5, 33, 29, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 9, 42, 30, 16, 7, 0, 0, 0, 19, 50, -1, 18, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 3, 28, 4, 29, 5, 30, 31, 31, 11, 16, 7, 0, 12, 0, 32, 32, -1, 27, 2, 0, 3, 0, 4, 0, 5, 0, 6, 1, 20, 9, 21, 0, 22, 10, 23, 10, 24, 9, 25, 1, 26, 0, 27, 28, 28, 4, 29, 5, 33, 32, 34, 0, 8, 3, 35, 0, 36, 0, 37, 14, 38, 14, 39, 1, 40, 15, 41, 9, 42, 30, 16, 7, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/plank.png b/demos/2d/platformer/plank.png new file mode 100644 index 0000000000..b4f6addee5 Binary files /dev/null and b/demos/2d/platformer/plank.png differ diff --git a/demos/2d/platformer/plankpin.png b/demos/2d/platformer/plankpin.png new file mode 100644 index 0000000000..46e104a3fe Binary files /dev/null and b/demos/2d/platformer/plankpin.png differ diff --git a/demos/2d/platformer/player.gd b/demos/2d/platformer/player.gd new file mode 100644 index 0000000000..481f340ab8 --- /dev/null +++ b/demos/2d/platformer/player.gd @@ -0,0 +1,259 @@ +extends RigidBody2D + +# Character Demo, written by Juan Linietsky. +# +# Implementation of a 2D Character controller. +# This implementation uses the physics engine for +# controlling a character, in a very similar way +# than a 3D character controller would be implemented. +# +# Using the physics engine for this has the main +# advantages: +# -Easy to write. +# -Interaction with other physics-based objects is free +# -Only have to deal with the object linear velocity, not position +# -All collision/area framework available +# +# But also has the following disadvantages: +# +# -Objects may bounce a little bit sometimes +# -Going up ramps sends the chracter flying up, small hack is needed. +# -A ray collider is needed to avoid sliding down on ramps and +# undesiderd bumps, small steps and rare numerical precision errors. +# (another alternative may be to turn on friction when the character is not moving). +# -Friction cant be used, so floor velocity must be considered +# for moving platforms. + +var anim="" +var siding_left=false +var jumping=false +var stopping_jump=false +var shooting=false + +var WALK_ACCEL = 800.0 +var WALK_DEACCEL= 800.0 +var WALK_MAX_VELOCITY= 200.0 +var GRAVITY = 700.0 +var AIR_ACCEL = 200.0 +var AIR_DEACCEL= 200.0 +var JUMP_VELOCITY=460 +var STOP_JUMP_FORCE=900.0 + +var MAX_FLOOR_AIRBORNE_TIME = 0.15 + +var airborne_time=1e20 +var shoot_time=1e20 + +var MAX_SHOOT_POSE_TIME = 0.3 + +var bullet = preload("res://bullet.xml") + +var floor_h_velocity=0.0 +var enemy + +func _integrate_forces(s): + + var lv = s.get_linear_velocity() + var step = s.get_step() + + var new_anim=anim + var new_siding_left=siding_left + + # Get the controls + var move_left = Input.is_action_pressed("move_left") + var move_right = Input.is_action_pressed("move_right") + var jump = Input.is_action_pressed("jump") + var shoot = Input.is_action_pressed("shoot") + var spawn = Input.is_action_pressed("spawn") + + if spawn: + var e = enemy.instance() + var p = get_pos() + p.y = p.y - 100 + e.set_pos(p) + get_parent().add_child(e) + + + #deapply prev floor velocity + lv.x-=floor_h_velocity + floor_h_velocity=0.0 + + + # Find the floor (a contact with upwards facing collision normal) + var found_floor=false + var floor_index=-1 + + for x in range(s.get_contact_count()): + + var ci = s.get_contact_local_normal(x) + if (ci.dot(Vector2(0,-1))>0.6): + found_floor=true + floor_index=x + + # A good idea when impementing characters of all kinds, + # Compensates for physics imprecission, as well as human + # reaction delay. + + if (shoot and not shooting): + shoot_time=0 + var bi = bullet.instance() + var ss + if (siding_left): + ss=-1.0 + else: + ss=1.0 + var pos = get_pos() + get_node("bullet_shoot").get_pos()*Vector2(ss,1.0) + + bi.set_pos(pos) + get_parent().add_child(bi) + + bi.set_linear_velocity( Vector2(800.0*ss,-80) ) + get_node("sprite/smoke").set_emitting(true) + get_node("sound").play("shoot") + PS2D.body_add_collision_exception(bi.get_rid(),get_rid()) # make bullet and this not collide + + + else: + shoot_time+=step + + + if (found_floor): + airborne_time=0.0 + else: + airborne_time+=step #time it spent in the air + + var on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME + + # Process jump + if (jumping): + if (lv.y>0): + #set off the jumping flag if going down + jumping=false + elif (not jump): + stopping_jump=true + + if (stopping_jump): + lv.y+=STOP_JUMP_FORCE*step + + if (on_floor): + + # Process logic when character is on floor + + if (move_left and not move_right): + if (lv.x > -WALK_MAX_VELOCITY): + lv.x-=WALK_ACCEL*step + elif (move_right and not move_left): + if (lv.x < WALK_MAX_VELOCITY): + lv.x+=WALK_ACCEL*step + else: + var xv = abs(lv.x) + xv-=WALK_DEACCEL*step + if (xv<0): + xv=0 + lv.x=sign(lv.x)*xv + + #Check jump + if (not jumping and jump): + lv.y=-JUMP_VELOCITY + jumping=true + stopping_jump=false + get_node("sound").play("jump") + + #check siding + + if (lv.x < 0 and move_left): + new_siding_left=true + elif (lv.x > 0 and move_right): + new_siding_left=false + if (jumping): + new_anim="jumping" + elif (abs(lv.x)<0.1): + if (shoot_time -WALK_MAX_VELOCITY): + lv.x-=AIR_ACCEL*step + elif (move_right and not move_left): + if (lv.x < WALK_MAX_VELOCITY): + lv.x+=AIR_ACCEL*step + else: + var xv = abs(lv.x) + xv-=AIR_DEACCEL*step + if (xv<0): + xv=0 + lv.x=sign(lv.x)*xv + + if (lv.y<0): + if (shoot_time + + + + + + + + + + + + + 0.5 + 20 + + + + 0 + -19.902, -24.8691, 19.3625, -24.6056, -0.138023, 16.5036 + + + + "idle" + 7 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1, 1, 1 + "values" + + 16 + 17 + 18 + 16 + 19 + 20 + 19 + 16 + + "times" + 0, 1.25, 1.5, 2, 4.5, 4.75, 5, 5.25 + + + + + "jumping" + 0.5 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1 + "values" + + 23 + 24 + 23 + + "times" + 0, 0.25, 0.5 + + + + + "run" + 1.25 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1 + "values" + + 0 + 1 + 2 + 3 + 4 + 0 + + "times" + 0, 0.25, 0.5, 0.75, 1, 1.25 + + + + + "falling_weapon" + 0.5 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1 + "values" + + 26 + + "times" + 0 + + + + + "falling" + 0.01 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1 + "values" + + 21 + + "times" + 0 + + + + + "run_weapon" + 1.25 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1 + "values" + + 5 + 6 + 7 + 8 + 9 + 5 + + "times" + 0, 0.25, 0.5, 0.75, 1, 1.25 + + + + + "run_gun_fire" + 1.25 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1, 1, 1, 1, 1, 1 + "values" + + 10 + 11 + 12 + 13 + 14 + 5 + + "times" + 0, 0.25, 0.5, 0.75, 1, 1.25 + + + + + "jumping_weapon" + 0.5 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1 + "values" + + 26 + + "times" + 0 + + + + + "crouch" + 0.01 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1 + "values" + + 22 + + "times" + 0 + + + + + "idle_weapon" + 0.5 + True + 0.25 + "value" + "sprite:frame" + 1 + + "cont" + False + "transitions" + 1 + "values" + + 25 + + "times" + 0 + + + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + "db" + 0 + "pitch" + 1 + "sample" + + + + + + + "names" + + "player" + "RigidBody2D" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "shapes/0/trigger" + "shapes/1/shape" + "shapes/1/transform" + "shapes/1/trigger" + "mode" + "mass" + "friction" + "bounce" + "custom_integrator" + "continuous_cd" + "contacts_reported" + "contact_monitor" + "active" + "can_sleep" + "velocity/linear" + "velocity/angular" + "script/script" + "__meta__" + "sprite" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "smoke" + "Particles2D" + "visibility/blend_mode" + "config/amount" + "config/lifetime" + "config/time_scale" + "config/preprocess" + "config/emit_timeout" + "config/emitting" + "config/offset" + "config/half_extents" + "config/local_space" + "config/explosiveness" + "config/texture" + "params/direction" + "params/spread" + "params/linear_velocity" + "params/spin_velocity" + "params/orbit_velocity" + "params/gravity_direction" + "params/gravity_strength" + "params/radial_accel" + "params/tangential_accel" + "params/damping" + "params/initial_size" + "params/final_size" + "params/hue_variation" + "randomness/direction" + "randomness/spread" + "randomness/linear_velocity" + "randomness/spin_velocity" + "randomness/orbit_velocity" + "randomness/gravity_direction" + "randomness/gravity_strength" + "randomness/radial_accel" + "randomness/tangential_accel" + "randomness/damping" + "randomness/initial_size" + "randomness/final_size" + "randomness/hue_variation" + "color_phases/count" + "phase_0/pos" + "phase_0/color" + "phase_1/pos" + "phase_1/color" + "phase_2/pos" + "phase_2/color" + "phase_3/pos" + "phase_3/color" + "emission_points" + "anim" + "AnimationPlayer" + "playback/process_mode" + "playback/default_blend_time" + "root/root" + "anims/idle" + "anims/jumping" + "anims/run" + "anims/falling_weapon" + "anims/falling" + "anims/run_weapon" + "anims/standing_weapon_ready" + "anims/jumping_weapon" + "anims/crouch" + "anims/idle_weapon" + "playback/active" + "playback/speed" + "blend_times" + "autoplay" + "camera" + "Camera2D" + "current" + "smoothing" + "zoom" + "limit/left" + "limit/top" + "limit/right" + "limit/bottom" + "drag_margin/h_enabled" + "drag_margin/v_enabled" + "drag_margin/left" + "drag_margin/top" + "drag_margin/right" + "drag_margin/bottom" + "bullet_shoot" + "Position2D" + "CollisionShape2D" + "shape" + "trigger" + "sound" + "SamplePlayer" + "config/voices" + "config/samples" + "default/volume_db" + "default/pitch_scale" + "default/pan" + "default/depth" + "default/height" + "default/filter/type" + "default/filter/cutoff" + "default/filter/resonance" + "default/filter/gain" + "default/reverb_room" + "default/reverb_send" + "default/chorus_send" + "CollisionPolygon2D" + "build_mode" + "polygon" + "ui" + "CanvasLayer" + "layer" + "rotation" + "scale" + "left" + "TouchScreenButton" + "normal" + "pressed" + "bitmask" + "passby_press" + "action" + "visibility_mode" + "right" + "jump" + "fire" + + "version" + 1 + "conn_count" + 0 + "node_count" + 14 + "variants" + + True + 1 + 0, 0 + 0 + 1, 1 + 2 + + 1, -0, 0, 1.76469, 0.291992, -12.1587 + False + + 1, -0, 0, 1, 0, 0 + 3 + 3 + + + "__editor_plugin_states__" + + "Script" + + "current" + 0 + "sources" + + "res://player.gd" + + + "2D" + + "pixel_snap" + False + "zoom" + 2.272073 + "ofs" + -125.17, -137.776 + + "3D" + + "zfar" + 500 + "fov" + 45 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + + 16 + 1 + 1, 1, 1, 1 + 0, 0, 0, 0 + 0.363636 + 20.7312, 3.21187 + 83.450417 + 4 + 0.3 + 0.1 + + 180 + 20 + 9.8 + 2 + 0, 0, 0, 0.0442478 + 1, 0, 0, 1 + 0, 0, 0, 1 + + ".." + + + + + + + + + + + + + "" + 0 + 10000000 + 0.2 + 31.2428, 4.08784 + 0.291992, -12.1587 + 1, 1.76469 + + + -0.138023, 16.5036, -19.902, -24.8691, 19.3625, -24.6056 + 27.7593, 360.87 + 1.49157, 1.46265 + + "move_left" + 121.542, 361.415 + + "move_right" + 666.224, 359.02 + + "jump" + 668.073, 262.788 + + "shoot" + + "nodes" + -1, -1, 1, 0, -1, 28, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12, 8, 13, 9, 14, 10, 15, 8, 16, 5, 17, 11, 18, 3, 19, 3, 20, 0, 21, 8, 22, 12, 23, 8, 24, 0, 25, 0, 26, 2, 27, 3, 28, 13, 29, 14, 0, 0, 0, 31, 30, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 32, 15, 33, 0, 34, 2, 35, 8, 36, 8, 37, 5, 38, 16, 39, 17, 40, 18, 41, 8, 42, 19, 0, 1, 0, 44, 43, -1, 55, 2, 0, 3, 1, 4, 20, 5, 0, 45, 17, 6, 21, 7, 22, 8, 4, 46, 23, 47, 24, 48, 1, 49, 3, 50, 24, 51, 8, 52, 2, 53, 2, 54, 8, 55, 25, 56, 26, 57, 3, 58, 27, 59, 28, 60, 1, 61, 3, 62, 3, 63, 29, 64, 3, 65, 3, 66, 3, 67, 30, 68, 30, 69, 3, 70, 3, 71, 3, 72, 3, 73, 30, 74, 3, 75, 3, 76, 3, 77, 3, 78, 3, 79, 3, 80, 3, 81, 3, 82, 3, 83, 5, 84, 3, 85, 18, 86, 1, 87, 31, 88, 1, 89, 32, 90, 1, 91, 33, 92, 34, 0, 0, 0, 94, 93, -1, 17, 95, 17, 96, 3, 97, 35, 98, 36, 99, 37, 100, 38, 101, 39, 102, 40, 103, 41, 104, 42, 105, 43, 106, 44, 107, 45, 108, 0, 109, 30, 110, 46, 111, 47, 0, 0, 0, 113, 112, -1, 21, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 33, 0, 114, 0, 115, 3, 116, 4, 117, 48, 118, 48, 119, 49, 120, 49, 121, 0, 122, 0, 123, 50, 124, 50, 125, 50, 126, 50, 0, 0, 0, 128, 127, -1, 7, 2, 0, 3, 1, 4, 1, 5, 0, 6, 51, 7, 3, 8, 4, 0, 0, 0, 129, 129, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 52, 7, 3, 8, 53, 130, 6, 131, 8, 0, 0, 0, 133, 132, -1, 14, 134, 12, 135, 54, 136, 3, 137, 1, 138, 3, 139, 3, 140, 3, 141, 55, 142, 55, 143, 55, 144, 55, 145, 5, 146, 3, 147, 3, 0, 0, 0, 148, 148, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 149, 48, 150, 56, 0, 0, 0, 152, 151, -1, 4, 153, 48, 34, 2, 154, 3, 155, 4, 0, 9, 0, 157, 156, -1, 13, 2, 0, 3, 1, 4, 1, 5, 0, 6, 57, 7, 3, 8, 58, 158, 59, 159, 60, 160, 60, 161, 0, 162, 61, 163, 17, 0, 9, 0, 157, 164, -1, 13, 2, 0, 3, 1, 4, 1, 5, 0, 6, 62, 7, 3, 8, 58, 158, 63, 159, 60, 160, 60, 161, 0, 162, 64, 163, 17, 0, 9, 0, 157, 165, -1, 13, 2, 0, 3, 1, 4, 1, 5, 0, 6, 65, 7, 3, 8, 58, 158, 66, 159, 60, 160, 60, 161, 8, 162, 67, 163, 17, 0, 9, 0, 157, 166, -1, 13, 2, 0, 3, 1, 4, 1, 5, 0, 6, 68, 7, 3, 8, 58, 158, 69, 159, 60, 160, 60, 161, 8, 162, 70, 163, 17, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/robot_demo.png b/demos/2d/platformer/robot_demo.png new file mode 100644 index 0000000000..bba8c63874 Binary files /dev/null and b/demos/2d/platformer/robot_demo.png differ diff --git a/demos/2d/platformer/scroll_bg_cloud_1.png b/demos/2d/platformer/scroll_bg_cloud_1.png new file mode 100644 index 0000000000..728d454b5c Binary files /dev/null and b/demos/2d/platformer/scroll_bg_cloud_1.png differ diff --git a/demos/2d/platformer/scroll_bg_cloud_2.png b/demos/2d/platformer/scroll_bg_cloud_2.png new file mode 100644 index 0000000000..66e0cf2fb5 Binary files /dev/null and b/demos/2d/platformer/scroll_bg_cloud_2.png differ diff --git a/demos/2d/platformer/scroll_bg_cloud_3.png b/demos/2d/platformer/scroll_bg_cloud_3.png new file mode 100644 index 0000000000..3586bb4072 Binary files /dev/null and b/demos/2d/platformer/scroll_bg_cloud_3.png differ diff --git a/demos/2d/platformer/scroll_bg_fg_1.png b/demos/2d/platformer/scroll_bg_fg_1.png new file mode 100644 index 0000000000..e64c446f65 Binary files /dev/null and b/demos/2d/platformer/scroll_bg_fg_1.png differ diff --git a/demos/2d/platformer/scroll_bg_fg_2.png b/demos/2d/platformer/scroll_bg_fg_2.png new file mode 100644 index 0000000000..ef9601183b Binary files /dev/null and b/demos/2d/platformer/scroll_bg_fg_2.png differ diff --git a/demos/2d/platformer/scroll_bg_sky.png b/demos/2d/platformer/scroll_bg_sky.png new file mode 100644 index 0000000000..04c196510f Binary files /dev/null and b/demos/2d/platformer/scroll_bg_sky.png differ diff --git a/demos/2d/platformer/seesaw.xml b/demos/2d/platformer/seesaw.xml new file mode 100644 index 0000000000..ed879a9319 --- /dev/null +++ b/demos/2d/platformer/seesaw.xml @@ -0,0 +1,197 @@ + + + + + + 0 + 128, 8 + + + + + "names" + + "seesaw" + "Node2D" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "__meta__" + "plank" + "RigidBody2D" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "shapes/0/trigger" + "mode" + "mass" + "friction" + "bounce" + "custom_integrator" + "continuous_cd" + "contacts_reported" + "contact_monitor" + "active" + "can_sleep" + "velocity/linear" + "velocity/angular" + "sprite" + "Sprite" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "CollisionShape2D" + "shape" + "trigger" + "pin" + "PinJoint2D" + "node_a" + "node_b" + "bias/bias" + + "version" + 1 + "conn_count" + 0 + "node_count" + 6 + "variants" + + True + 1 + 0, 0 + 0 + 1, 1 + + "__editor_plugin_states__" + + "2D" + + "pixel_snap" + False + "zoom" + 2.050547 + "ofs" + -116.979, -109.897 + + "3D" + + "zfar" + 500 + "fov" + 400 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + 1 + + 1, 0, 0, 1, 0, 0 + False + 0 + 5.102041 + + 1, 1, 1, 1 + 0, 0, 0, 0 + "../plank" + "" + -0.290825, 20.2425 + + + "nodes" + -1, -1, 1, 0, -1, 8, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 9, 5, 0, 0, 0, 11, 10, -1, 23, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 12, 6, 13, 7, 14, 8, 15, 9, 16, 10, 17, 11, 18, 1, 19, 3, 20, 9, 21, 9, 22, 10, 23, 9, 24, 0, 25, 0, 26, 2, 27, 3, 0, 1, 0, 29, 28, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 30, 12, 31, 0, 32, 2, 33, 9, 34, 9, 35, 6, 36, 6, 37, 10, 38, 13, 39, 9, 40, 14, 0, 1, 0, 41, 41, -1, 9, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 42, 7, 43, 9, 0, 0, 0, 45, 44, -1, 10, 2, 0, 3, 1, 4, 1, 5, 0, 6, 2, 7, 3, 8, 4, 46, 15, 47, 16, 48, 3, 0, 0, 0, 29, 29, -1, 18, 2, 0, 3, 1, 4, 1, 5, 0, 6, 17, 7, 3, 8, 4, 30, 18, 31, 0, 32, 2, 33, 9, 34, 9, 35, 6, 36, 6, 37, 10, 38, 13, 39, 9, 40, 14, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/sound_coin.wav b/demos/2d/platformer/sound_coin.wav new file mode 100644 index 0000000000..e78579f461 Binary files /dev/null and b/demos/2d/platformer/sound_coin.wav differ diff --git a/demos/2d/platformer/sound_explode.wav b/demos/2d/platformer/sound_explode.wav new file mode 100644 index 0000000000..229c85399c Binary files /dev/null and b/demos/2d/platformer/sound_explode.wav differ diff --git a/demos/2d/platformer/sound_hit.wav b/demos/2d/platformer/sound_hit.wav new file mode 100644 index 0000000000..4fb3b13812 Binary files /dev/null and b/demos/2d/platformer/sound_hit.wav differ diff --git a/demos/2d/platformer/sound_jump.wav b/demos/2d/platformer/sound_jump.wav new file mode 100644 index 0000000000..e9942e65e6 Binary files /dev/null and b/demos/2d/platformer/sound_jump.wav differ diff --git a/demos/2d/platformer/sound_shoot.wav b/demos/2d/platformer/sound_shoot.wav new file mode 100644 index 0000000000..ad74f328cb Binary files /dev/null and b/demos/2d/platformer/sound_shoot.wav differ diff --git a/demos/2d/platformer/stage.xml b/demos/2d/platformer/stage.xml new file mode 100644 index 0000000000..b8a54537d8 --- /dev/null +++ b/demos/2d/platformer/stage.xml @@ -0,0 +1,324 @@ + + + + + + + + + + + + + "names" + + "stage" + "Node" + "__meta__" + "tile_map" + "TileMap" + "visibility/visible" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "transform/pos" + "transform/rot" + "transform/scale" + "cell_size" + "quadrant_size" + "tile_set" + "tile_data" + "coins" + "coin" + "Area2D" + "coin 2" + "coin 3" + "coin 4" + "coin 5" + "coin 6" + "coin 7" + "coin 8" + "coin 9" + "coin 10" + "coin 11" + "coin 12" + "coin 13" + "coin 14" + "coin 15" + "coin 16" + "coin 17" + "coin 18" + "coin 19" + "coin 20" + "coin 21" + "coin 22" + "coin 23" + "coin 24" + "coin 25" + "coin 26" + "coin 27" + "coin 28" + "coin 29" + "coin 30" + "coin 31" + "coin 31 2" + "coin 31 3" + "coin 31 4" + "coin 31 5" + "coin 31 6" + "coin 32" + "coin 31 7" + "coin 31 7 2" + "coin 31 7 3" + "coin 31 7 4" + "coin 31 7 5" + "player" + "RigidBody2D" + "props" + "moving_platform" + "Node2D" + "motion" + "cycle" + "moving_platform 2" + "moving_platform 3" + "seesaw" + "music" + "StreamPlayer" + "stream/stream" + "stream/play" + "stream/loop" + "stream/volume_db" + "stream/autoplay" + "stream/paused" + "enemies" + "enemy 5" + "enemy 6" + "enemy 7" + "enemy 8" + "enemy 9" + "enemy 10" + "enemy 11" + "enemy 12" + "enemy 13" + "enemy 14" + "enemy 15" + "parallax_bg" + "ParallaxBackground" + + "version" + 1 + "conn_count" + 0 + "node_count" + 65 + "variants" + + + "__editor_plugin_states__" + + "Script" + + "current" + 2 + "sources" + + "res://moving_platform.gd" + "res://enemy.gd" + "res://player.gd" + "res://coin.gd" + + + "2D" + + "pixel_snap" + False + "zoom" + 0.598736 + "ofs" + -37.7393, 205.061 + + "3D" + + "zfar" + 500 + "fov" + 45 + "viewports" + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "distance" + 4 + "x_rot" + 0 + "y_rot" + 0 + "use_orthogonal" + False + "use_environment" + False + "pos" + 0, 0, 0 + + + "viewport_mode" + 1 + "default_light" + True + "show_grid" + True + "show_origin" + True + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + True + 1 + 0, 0 + 0 + 1, 1 + 64 + 16 + + 0, 2, 70, 536870914, 71, 10, 72, 10, 73, 10, 74, 10, 75, 10, 76, 10, 77, 10, 78, 10, 65536, 2, 65606, 536870914, 65607, 10, 65608, 10, 65609, 10, 65610, 10, 65611, 10, 65612, 10, 65613, 10, 65614, 10, 131072, 2, 131142, 536870914, 131143, 10, 131144, 10, 131145, 10, 131146, 10, 131147, 10, 131148, 10, 131149, 10, 131150, 10, 196608, 2, 196626, 9, 196678, 536870914, 196679, 10, 196680, 10, 196681, 10, 196682, 10, 196683, 10, 196684, 10, 196685, 10, 196686, 10, 262144, 2, 262162, 8, 262214, 536870914, 262215, 10, 262216, 10, 262217, 10, 262218, 10, 262219, 10, 262220, 10, 262221, 10, 262222, 10, 327680, 2, 327697, 536870921, 327698, 7, 327733, 9, 327750, 536870914, 327751, 10, 327752, 10, 327753, 10, 327754, 10, 327755, 10, 327756, 10, 327757, 10, 327758, 10, 393216, 2, 393233, 536870920, 393234, 7, 393257, 9, 393269, 7, 393286, 536870914, 393287, 10, 393288, 10, 393289, 10, 393290, 10, 393291, 10, 393292, 10, 393293, 10, 393294, 10, 458752, 2, 458769, 7, 458770, 8, 458790, 9, 458793, 8, 458805, 8, 458822, 536870914, 458823, 10, 458824, 10, 458825, 10, 458826, 10, 458827, 10, 458828, 10, 458829, 10, 458830, 10, 524288, 4, 524289, 1, 524304, 536870913, 524305, 536870918, 524306, 6, 524307, 5, 524308, 1, 524326, 8, 524329, 7, 524341, 7, 524358, 536870914, 524359, 10, 524360, 10, 524361, 10, 524362, 10, 524363, 10, 524364, 10, 524365, 10, 524366, 10, 589824, 10, 589825, 13, 589840, 536870914, 589841, 10, 589842, 10, 589843, 10, 589844, 2, 589862, 7, 589865, 7, 589876, 536870913, 589877, 6, 589878, 1, 589894, 536870914, 589895, 10, 589896, 10, 589897, 10, 589898, 10, 589899, 10, 589900, 10, 589901, 10, 589902, 10, 655360, 2, 655376, 536870914, 655377, 10, 655378, 10, 655379, 10, 655380, 2, 655398, 7, 655401, 8, 655412, 536870925, 655413, 11, 655414, 13, 655430, 536870914, 655431, 10, 655432, 10, 655433, 10, 655434, 10, 655435, 10, 655436, 10, 655437, 10, 655438, 10, 720896, 2, 720912, 536870914, 720913, 10, 720914, 10, 720915, 10, 720916, 2, 720934, 8, 720937, 7, 720958, 536870913, 720959, 5, 720960, 536870917, 720961, 5, 720962, 5, 720963, 536870917, 720964, 5, 720965, 0, 720966, 536870916, 720967, 10, 720968, 10, 720969, 10, 720970, 10, 720971, 10, 720972, 10, 720973, 10, 720974, 10, 786432, 2, 786437, 9, 786448, 536870914, 786449, 10, 786450, 10, 786451, 10, 786452, 2, 786464, 536870913, 786465, 1, 786470, 7, 786473, 7, 786474, 536870924, 786475, 1, 786494, 536870914, 786495, 10, 786496, 10, 786497, 10, 786498, 10, 786499, 10, 786500, 10, 786501, 10, 786502, 10, 786503, 10, 786504, 10, 786505, 10, 786506, 10, 786507, 10, 786508, 10, 786509, 10, 851968, 2, 851973, 7, 851984, 536870914, 851985, 10, 851986, 10, 851987, 10, 851988, 2, 851996, 536870913, 851997, 1, 852000, 536870914, 852001, 3, 852006, 7, 852009, 536870913, 852011, 2, 852030, 536870914, 852031, 10, 852032, 10, 852033, 10, 852034, 10, 852035, 10, 852036, 10, 852037, 10, 852038, 10, 852039, 10, 852040, 10, 852041, 10, 852042, 10, 852043, 10, 852044, 10, 852045, 10, 917504, 2, 917506, 9, 917509, 7, 917512, 536870921, 917520, 536870925, 917521, 11, 917522, 11, 917523, 11, 917524, 13, 917532, 536870925, 917533, 13, 917536, 536870914, 917537, 4, 917538, 1, 917540, 536870913, 917541, 0, 917542, 1, 917545, 536870914, 917546, 10, 917547, 4, 917548, 1, 917566, 536870914, 917567, 10, 917568, 10, 917569, 10, 917570, 10, 917571, 10, 917572, 10, 917573, 10, 917574, 10, 917575, 10, 917576, 10, 917577, 10, 917578, 10, 917579, 10, 917580, 10, 917581, 10, 983040, 2, 983042, 7, 983045, 7, 983048, 536870920, 983050, 536870913, 983051, 1, 983064, 536870913, 983065, 1, 983072, 536870914, 983073, 10, 983074, 4, 983075, 0, 983076, 536870916, 983077, 10, 983078, 4, 983079, 536870912, 983080, 536870912, 983081, 536870916, 983082, 10, 983083, 10, 983084, 2, 983095, 9, 983102, 536870914, 983103, 10, 983104, 10, 983105, 10, 983106, 10, 983107, 10, 983108, 10, 983109, 10, 983110, 10, 983111, 10, 983112, 10, 983113, 10, 983114, 10, 983115, 10, 983116, 10, 983117, 10, 1048576, 2, 1048578, 8, 1048581, 8, 1048584, 536870919, 1048586, 536870925, 1048587, 13, 1048600, 536870925, 1048601, 13, 1048604, 9, 1048608, 536870925, 1048609, 536870923, 1048610, 536870923, 1048611, 536870923, 1048612, 10, 1048613, 10, 1048614, 10, 1048615, 10, 1048616, 10, 1048617, 10, 1048618, 10, 1048619, 10, 1048620, 4, 1048621, 1, 1048630, 536870921, 1048631, 8, 1048638, 536870914, 1048639, 10, 1048640, 10, 1048641, 10, 1048642, 10, 1048643, 10, 1048644, 10, 1048645, 10, 1048646, 10, 1048647, 10, 1048648, 10, 1048649, 10, 1048650, 10, 1048651, 10, 1048652, 10, 1048653, 10, 1114112, 4, 1114113, 0, 1114114, 6, 1114115, 0, 1114116, 0, 1114117, 6, 1114118, 1, 1114120, 536870920, 1114128, 536870913, 1114129, 5, 1114130, 536870917, 1114131, 5, 1114132, 0, 1114133, 1, 1114140, 7, 1114141, 536870921, 1114148, 536870914, 1114149, 10, 1114150, 10, 1114151, 10, 1114152, 10, 1114153, 10, 1114154, 10, 1114155, 10, 1114156, 10, 1114157, 2, 1114166, 536870920, 1114167, 8, 1114174, 536870914, 1114175, 10, 1114176, 10, 1114177, 10, 1114178, 10, 1114179, 10, 1114180, 10, 1114181, 10, 1114182, 10, 1114183, 10, 1114184, 10, 1114185, 10, 1114186, 10, 1114187, 10, 1114188, 10, 1179648, 10, 1179649, 10, 1179650, 10, 1179651, 10, 1179652, 10, 1179653, 10, 1179654, 2, 1179656, 536870919, 1179663, 536870915, 1179665, 10, 1179666, 10, 1179667, 10, 1179668, 10, 1179669, 4, 1179670, 12, 1179675, 9, 1179676, 8, 1179677, 8, 1179684, 536870914, 1179685, 10, 1179686, 10, 1179687, 10, 1179688, 10, 1179689, 10, 1179690, 10, 1179691, 10, 1179692, 10, 1179693, 4, 1179694, 1, 1179701, 9, 1179702, 536870919, 1179703, 7, 1179710, 536870914, 1179711, 10, 1179712, 10, 1179713, 10, 1179714, 10, 1179715, 10, 1179716, 10, 1179717, 10, 1179718, 10, 1179719, 10, 1179720, 10, 1179721, 10, 1179722, 10, 1245184, 10, 1245185, 10, 1245186, 10, 1245187, 10, 1245188, 10, 1245189, 10, 1245190, 2, 1245192, 536870919, 1245199, 536870913, 1245200, 536870916, 1245201, 10, 1245202, 10, 1245203, 10, 1245204, 10, 1245205, 10, 1245207, 1, 1245211, 7, 1245212, 7, 1245213, 536870920, 1245220, 536870914, 1245221, 10, 1245222, 10, 1245223, 10, 1245224, 10, 1245225, 10, 1245226, 10, 1245227, 10, 1245228, 10, 1245229, 10, 1245230, 2, 1245237, 8, 1245238, 536870919, 1245239, 8, 1245240, 536870921, 1245246, 536870914, 1245247, 10, 1245248, 10, 1245249, 10, 1245250, 10, 1245251, 10, 1245252, 10, 1245253, 10, 1245254, 10, 1245255, 10, 1245256, 10, 1245257, 10, 1245258, 10, 1310720, 10, 1310721, 10, 1310722, 10, 1310723, 10, 1310724, 10, 1310725, 10, 1310726, 2, 1310728, 536870920, 1310730, 536870913, 1310731, 1, 1310734, 536870913, 1310735, 536870916, 1310736, 10, 1310737, 10, 1310738, 10, 1310739, 10, 1310740, 10, 1310741, 10, 1310742, 10, 1310743, 4, 1310744, 1, 1310747, 8, 1310748, 7, 1310749, 536870919, 1310756, 536870914, 1310757, 10, 1310758, 10, 1310759, 10, 1310760, 10, 1310761, 10, 1310762, 10, 1310763, 10, 1310764, 10, 1310765, 10, 1310766, 4, 1310767, 5, 1310768, 12, 1310773, 7, 1310774, 536870919, 1310775, 7, 1310776, 536870919, 1310782, 536870914, 1310783, 10, 1310784, 10, 1310785, 10, 1310786, 10, 1310787, 10, 1310788, 10, 1310789, 10, 1310790, 10, 1310791, 10, 1310792, 10, 1310793, 10, 1376256, 10, 1376257, 10, 1376258, 10, 1376259, 10, 1376260, 10, 1376261, 10, 1376262, 4, 1376263, 0, 1376264, 536870918, 1376265, 0, 1376266, 536870916, 1376267, 4, 1376268, 0, 1376269, 0, 1376270, 536870916, 1376271, 10, 1376272, 10, 1376273, 10, 1376274, 10, 1376275, 10, 1376276, 10, 1376277, 10, 1376278, 10, 1376279, 10, 1376280, 4, 1376281, 12, 1376283, 8, 1376284, 8, 1376285, 536870920, 1376287, 536870924, 1376288, 0, 1376289, 5, 1376290, 536870917, 1376291, 0, 1376292, 536870916, 1376293, 10, 1376294, 10, 1376295, 10, 1376296, 10, 1376297, 10, 1376298, 10, 1376299, 10, 1376300, 10, 1376301, 10, 1376302, 10, 1376303, 10, 1376305, 12, 1376309, 7, 1376310, 536870920, 1376311, 7, 1376312, 536870920, 1376318, 536870914, 1376319, 10, 1376320, 10, 1376321, 10, 1376322, 10, 1376323, 10, 1376324, 10, 1376325, 10, 1376326, 10, 1376327, 10, 1376328, 10, 1441792, 10, 1441793, 10, 1441794, 10, 1441795, 10, 1441796, 10, 1441797, 10, 1441798, 10, 1441799, 10, 1441800, 10, 1441801, 10, 1441802, 10, 1441803, 10, 1441804, 10, 1441805, 10, 1441806, 10, 1441807, 10, 1441808, 10, 1441809, 10, 1441810, 10, 1441811, 10, 1441812, 10, 1441813, 10, 1441814, 10, 1441815, 10, 1441816, 10, 1441818, 0, 1441819, 6, 1441820, 6, 1441821, 536870918, 1441822, 5, 1441824, 10, 1441825, 10, 1441826, 10, 1441827, 10, 1441828, 10, 1441829, 10, 1441830, 10, 1441831, 10, 1441832, 10, 1441833, 10, 1441834, 10, 1441835, 10, 1441836, 10, 1441837, 10, 1441838, 10, 1441839, 10, 1441840, 10, 1441842, 0, 1441843, 0, 1441844, 0, 1441845, 6, 1441846, 536870918, 1441847, 6, 1441848, 536870918, 1441849, 0, 1441850, 5, 1441851, 536870917, 1441852, 5, 1441853, 0, 1441854, 536870916, 1441855, 10, 1441856, 10, 1441857, 10, 1441858, 10, 1441859, 10, 1441860, 10, 1441861, 10, 1441862, 10, 1441863, 10, 1507328, 10, 1507329, 10, 1507330, 10, 1507331, 10, 1507332, 10, 1507333, 10, 1507334, 10, 1507335, 10, 1507336, 10, 1507337, 10, 1507338, 10, 1507339, 10, 1507340, 10, 1507341, 10, 1507342, 10, 1507343, 10, 1507344, 10, 1507345, 10, 1507346, 10, 1507347, 10, 1507348, 10, 1507349, 10, 1507350, 10, 1507351, 10, 1507352, 10, 1507353, 10, 1507354, 10, 1507355, 10, 1507356, 10, 1507357, 10, 1507358, 10, 1507359, 10, 1507360, 10, 1507361, 10, 1507362, 10, 1507363, 10, 1507364, 10, 1507365, 10, 1507366, 10, 1507367, 10, 1507368, 10, 1507369, 10, 1507370, 10, 1507371, 10, 1507372, 10, 1507373, 10, 1507374, 10, 1507375, 10, 1507376, 10, 1507377, 10, 1507378, 10, 1507379, 10, 1507380, 10, 1507381, 10, 1507382, 10, 1507383, 10, 1507384, 10, 1507385, 10, 1507386, 10, 1507387, 10, 1507388, 10, 1507389, 10, 1507390, 10, 1507391, 10, 1507392, 10, 1507393, 10, 1507394, 10, 1507395, 10, 1507396, 10, 1507397, 10, 1507398, 10, 1507399, 10, 1572864, 10, 1572865, 10, 1572866, 10, 1572867, 10, 1572868, 10, 1572869, 10, 1572870, 10, 1572871, 10, 1572872, 10, 1572873, 10, 1572874, 10, 1572875, 10, 1572876, 10, 1572877, 10, 1572878, 10, 1572879, 10, 1572880, 10, 1572881, 10, 1572882, 10, 1572883, 10, 1572884, 10, 1572885, 10, 1572886, 10, 1572887, 10, 1572888, 10, 1572889, 10, 1572890, 10, 1572891, 10, 1572892, 10, 1572893, 10, 1572894, 10, 1572895, 10, 1572896, 10, 1572897, 10, 1572898, 10, 1572899, 10, 1572900, 10, 1572901, 10, 1572902, 10, 1572903, 10, 1572904, 10, 1572905, 10, 1572906, 10, 1572907, 10, 1572908, 10, 1572909, 10, 1572910, 10, 1572911, 10, 1572912, 10, 1572913, 10, 1572914, 10, 1572915, 10, 1572916, 10, 1572917, 10, 1572918, 10, 1572919, 10, 1572920, 10, 1572921, 10, 1572922, 10, 1572923, 10, 1572924, 10, 1572925, 10, 1572926, 10, 1572927, 10, 1572928, 10, 1572929, 10, 1572930, 10, 1572931, 10, 1572932, 10, 1572933, 10, 1572934, 10, 1572935, 10, 1638400, 10, 1638401, 10, 1638402, 10, 1638403, 10, 1638404, 10, 1638405, 10, 1638406, 10, 1638407, 10, 1638408, 10, 1638409, 10, 1638410, 10, 1638411, 10, 1638412, 10, 1638413, 10, 1638414, 10, 1638415, 10, 1638416, 10, 1638417, 10, 1638418, 10, 1638419, 10, 1638420, 10, 1638421, 10, 1638422, 10, 1638423, 10, 1638424, 10, 1638425, 10, 1638426, 10, 1638427, 10, 1638428, 10, 1638429, 10, 1638430, 10, 1638431, 10, 1638432, 10, 1638433, 10, 1638434, 10, 1638435, 10, 1638436, 10, 1638437, 10, 1638438, 10, 1638439, 10, 1638440, 10, 1638441, 10, 1638442, 10, 1638443, 10, 1638444, 10, 1638445, 10, 1638446, 10, 1638447, 10, 1638448, 10, 1638449, 10, 1638450, 10, 1638451, 10, 1638452, 10, 1638453, 10, 1638454, 10, 1638455, 10, 1638456, 10, 1638457, 10, 1638458, 10, 1638459, 10, 1638460, 10, 1638461, 10, 1638462, 10, 1638463, 10, 1638464, 10, 1638465, 10, 1638466, 10, 1638467, 10, 1638468, 10, 1638469, 10, 1638470, 10, 1638471, 10, 1703952, 10, 1703953, 10, 1703954, 10, 1703955, 10, 1703956, 10, 1703957, 10, 1703958, 10, 1703959, 10, 1703960, 10, 1703961, 10, 1703962, 10, 1703963, 10, 1703964, 10, 1703965, 10, 1703966, 10, 1703967, 10, 1703968, 10, 1703969, 10, 1703970, 10, 1703971, 10, 1703972, 10, 1703973, 10, 1703974, 10, 1703975, 10, 1703976, 10, 1703977, 10, 1703978, 10, 1703979, 10, 1703980, 10, 1703981, 10, 1703982, 10, 1703983, 10, 1703984, 10, 1703985, 10, 1703986, 10, 1703987, 10, 1703988, 10, 1703989, 10, 1703990, 10, 1703991, 10, 1703992, 10, 1703993, 10, 1703994, 10, 1703995, 10, 1703996, 10, 1703997, 10, 1703998, 10, 1703999, 10, 1704000, 10, 1704001, 10, 1704002, 10, 1704003, 10, 1704004, 10, 1704005, 10, 1704006, 10, 1704007, 10, 1769488, 10, 1769489, 10, 1769490, 10, 1769491, 10, 1769492, 10, 1769493, 10, 1769494, 10, 1769495, 10, 1769496, 10, 1769497, 10, 1769498, 10, 1769499, 10, 1769500, 10, 1769501, 10, 1769502, 10, 1769503, 10, 1769504, 10, 1769505, 10, 1769506, 10, 1769507, 10, 1769508, 10, 1769509, 10, 1769510, 10, 1769511, 10, 1769512, 10, 1769513, 10, 1769514, 10, 1769515, 10, 1769516, 10, 1769517, 10, 1769518, 10, 1769519, 10, 1769520, 10, 1769521, 10, 1769522, 10, 1769523, 10, 1769524, 10, 1769525, 10, 1769526, 10, 1769527, 10, 1769528, 10, 1769529, 10, 1769530, 10, 1769531, 10, 1769532, 10, 1769533, 10, 1769534, 10, 1769535, 10, 1769536, 10, 1769537, 10, 1769538, 10, 1769539, 10, 1769540, 10, 1769541, 10 + + "_edit_lock_" + True + + + "_editor_collapsed" + True + + + 672, 1120 + 704, 1120 + 736, 1120 + 1120, 992 + 1152, 992 + 1184, 992 + 1216, 992 + 1248, 992 + 1568, 864 + 1632, 864 + 1824, 768 + 1888, 768 + 2080, 672 + 2144, 672 + 1792, 1248 + 1856, 1248 + 1920, 1248 + 1920, 1184 + 1856, 1184 + 1792, 1184 + 98.8868, 488.515 + 89.5989, 481.217 + 108.175, 481.217 + 116.136, 469.939 + 117.463, 457.997 + 106.184, 449.373 + 98.2234, 458.661 + 88.272, 448.71 + 79.6476, 457.334 + 82.9647, 468.612 + 3357.42, 465.288 + 3421.42, 465.288 + 3485.42, 465.288 + 3485.42, 401.288 + 3421.42, 401.288 + 3357.42, 401.288 + 4172.75, 605.058 + 4236.75, 605.058 + 4300.75, 605.058 + 4300.75, 541.058 + 4236.75, 541.058 + 4172.75, 541.058 + + 236.879, 1051.15 + + 1451.86, 742.969 + 0, 140 + 5 + 624.824, 545.544 + 300, 0 + 10 + 3419.86, 739.662 + 450, 0 + + 2402.79, 849.52 + + False + 2 + + 834.664, 1309.6 + 707.665, 1225.05 + 1125.21, 1053.06 + 1292.11, 1059.24 + 1607.38, 923.239 + 2586.9, 939.059 + 1457.6, 688.741 + 1193.63, 460.381 + 3429.73, 540.865 + 3546.2, 1356.19 + 2406.63, 815.115 + + + "nodes" + -1, -1, 1, 0, -1, 1, 2, 0, 0, 0, 0, 4, 3, -1, 12, 5, 1, 6, 2, 7, 2, 8, 1, 9, 3, 10, 4, 11, 5, 12, 6, 13, 7, 14, 8, 15, 9, 2, 10, 0, 0, 0, 1, 16, -1, 1, 2, 11, 0, 2, 0, 18, 17, 12, 1, 9, 13, 0, 2, 0, 18, 19, 12, 1, 9, 14, 0, 2, 0, 18, 20, 12, 1, 9, 15, 0, 2, 0, 18, 21, 12, 1, 9, 16, 0, 2, 0, 18, 22, 12, 1, 9, 17, 0, 2, 0, 18, 23, 12, 1, 9, 18, 0, 2, 0, 18, 24, 12, 1, 9, 19, 0, 2, 0, 18, 25, 12, 1, 9, 20, 0, 2, 0, 18, 26, 12, 1, 9, 21, 0, 2, 0, 18, 27, 12, 1, 9, 22, 0, 2, 0, 18, 28, 12, 1, 9, 23, 0, 2, 0, 18, 29, 12, 1, 9, 24, 0, 2, 0, 18, 30, 12, 1, 9, 25, 0, 2, 0, 18, 31, 12, 1, 9, 26, 0, 2, 0, 18, 32, 12, 1, 9, 27, 0, 2, 0, 18, 33, 12, 1, 9, 28, 0, 2, 0, 18, 34, 12, 1, 9, 29, 0, 2, 0, 18, 35, 12, 1, 9, 30, 0, 2, 0, 18, 36, 12, 1, 9, 31, 0, 2, 0, 18, 37, 12, 1, 9, 32, 0, 2, 0, 18, 38, 12, 1, 9, 33, 0, 2, 0, 18, 39, 12, 1, 9, 34, 0, 2, 0, 18, 40, 12, 1, 9, 35, 0, 2, 0, 18, 41, 12, 1, 9, 36, 0, 2, 0, 18, 42, 12, 1, 9, 37, 0, 2, 0, 18, 43, 12, 1, 9, 38, 0, 2, 0, 18, 44, 12, 1, 9, 39, 0, 2, 0, 18, 45, 12, 1, 9, 40, 0, 2, 0, 18, 46, 12, 1, 9, 41, 0, 2, 0, 18, 47, 12, 1, 9, 42, 0, 2, 0, 18, 48, 12, 1, 9, 43, 0, 2, 0, 18, 49, 12, 1, 9, 44, 0, 2, 0, 18, 50, 12, 1, 9, 45, 0, 2, 0, 18, 51, 12, 1, 9, 46, 0, 2, 0, 18, 52, 12, 1, 9, 47, 0, 2, 0, 18, 53, 12, 1, 9, 48, 0, 2, 0, 18, 54, 12, 1, 9, 49, 0, 2, 0, 18, 55, 12, 1, 9, 50, 0, 2, 0, 18, 56, 12, 1, 9, 51, 0, 2, 0, 18, 57, 12, 1, 9, 52, 0, 2, 0, 18, 58, 12, 1, 9, 53, 0, 2, 0, 18, 59, 12, 1, 9, 54, 0, 0, 0, 61, 60, 55, 1, 9, 56, 0, 0, 0, 1, 62, -1, 0, 0, 46, 0, 64, 63, 57, 3, 9, 58, 65, 59, 66, 60, 0, 46, 0, 64, 67, 57, 3, 9, 61, 65, 62, 66, 63, 0, 46, 0, 64, 68, 57, 3, 9, 64, 65, 65, 66, 63, 0, 46, 0, 64, 69, 66, 1, 9, 67, 0, 0, 0, 71, 70, -1, 6, 72, 68, 73, 69, 74, 1, 75, 70, 76, 1, 77, 69, 0, 0, 0, 1, 78, -1, 0, 0, 52, 0, 61, 79, 71, 1, 9, 72, 0, 52, 0, 61, 80, 71, 1, 9, 73, 0, 52, 0, 61, 81, 71, 1, 9, 74, 0, 52, 0, 61, 82, 71, 1, 9, 75, 0, 52, 0, 61, 83, 71, 1, 9, 76, 0, 52, 0, 61, 84, 71, 1, 9, 77, 0, 52, 0, 61, 85, 71, 1, 9, 78, 0, 52, 0, 61, 86, 71, 1, 9, 79, 0, 52, 0, 61, 87, 71, 1, 9, 80, 0, 52, 0, 61, 88, 71, 1, 9, 81, 0, 52, 0, 61, 89, 71, 1, 9, 82, 0, 0, 0, 91, 90, 83, 0, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/tiles_demo.png b/demos/2d/platformer/tiles_demo.png new file mode 100644 index 0000000000..a7a5000906 Binary files /dev/null and b/demos/2d/platformer/tiles_demo.png differ diff --git a/demos/2d/platformer/tileset.xml b/demos/2d/platformer/tileset.xml new file mode 100644 index 0000000000..2e4ecc8c04 --- /dev/null +++ b/demos/2d/platformer/tileset.xml @@ -0,0 +1,134 @@ + + + + + "" + 0 + 0, 8, 64, 8, 64, 64, 0, 64 + + + + "" + 0 + 0, 64, 0, 8, 56, 8, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 64, 8, 64, 64 + + + + "" + 0 + 0, 64, 0, 8, 64, 8, 64, 64 + + + + "" + 0 + 0, 64, 0, 8, 64, 8, 64, 64 + + + + "" + 0 + 0, 0, 64, 0, 64, 64, 0, 64 + + + + "" + 0 + 0, 8, 64, 72, 64, 128, 0, 128 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + "floor" + + 0, 0 + 0, 0, 64, 64 + + "edge" + + 0, 0 + 64, 0, 64, 64 + + "wall" + + 0, 0 + 64, 64, 64, 64 + + "wall_deco" + + 0, 0 + 320, 128, 128, 64 + + "corner" + + 0, 0 + 64, 128, 64, 64 + + "flowers" + + 0, 0 + 192, 192, 64, 64 + + "tree_base" + + 0, 0 + 256, 192, 64, 64 + + "tree_mid" + + 0, 0 + 256, 128, 64, 64 + "tree_mid 2" + + 0, 0 + 256, 64, 64, 64 + "tree_top" + + 0, 0 + 256, 0, 64, 64 + "solid" + + 0, 0 + 0, 64, 64, 64 + "ceiling" + + 0, 0 + 384, 64, 64, 64 + + "ramp" + + 0, 0 + 128, 128, 64, 128 + + "ceiling2wall" + + 0, 0 + 448, 64, 64, 64 + + + + \ No newline at end of file diff --git a/demos/2d/platformer/tileset_edit.xml b/demos/2d/platformer/tileset_edit.xml new file mode 100644 index 0000000000..4778a8f1e2 --- /dev/null +++ b/demos/2d/platformer/tileset_edit.xml @@ -0,0 +1,285 @@ + + + + + "" + 0 + 0, 8, 64, 8, 64, 64, 0, 64 + + + + "" + 0 + 0, 64, 0, 8, 56, 8, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 64, 8, 64, 64 + + + + "" + 0 + 0, 8, 64, 72, 64, 128, 0, 128 + + + + "" + 0 + 0, 64, 0, 8, 64, 8, 64, 64 + + + + "" + 0 + 0, 64, 0, 8, 64, 8, 64, 64 + + + + "" + 0 + 0, 0, 64, 0, 64, 64, 0, 64 + + + + "" + 0 + 0, 64, 0, 0, 56, 0, 56, 64 + + + + "" + + "names" + + "Node" + "process/process" + "process/fixed_process" + "process/input" + "process/unhandled_input" + "process/mode" + "script/script" + "__meta__" + "floor" + "Sprite" + "visibility/visible" + "visibility/toplevel" + "visibility/opacity" + "visibility/self_opacity" + "visibility/on_top" + "visibility/blend_mode" + "transform/notify" + "transform/pos" + "transform/rot" + "transform/scale" + "texture" + "centered" + "offset" + "flip_h" + "flip_v" + "vframes" + "hframes" + "frame" + "modulate" + "region" + "region_rect" + "collision" + "StaticBody2D" + "shape_count" + "shapes/0/shape" + "shapes/0/transform" + "simulate_motion" + "constant_linear_velocity" + "constant_angular_velocity" + "CollisionPolygon2D" + "build_mode" + "polygon" + "edge" + "wall" + "wall_deco" + "corner" + "ramp" + "flowers" + "tree_base" + "tree_mid" + "tree_mid 2" + "tree_top" + "solid" + "ceiling" + "ceiling2wall" + "help" + "Label" + "anchor/left" + "anchor/top" + "anchor/right" + "anchor/bottom" + "margin/left" + "margin/top" + "margin/right" + "margin/bottom" + "hint/tooltip" + "focus_neighbour/left" + "focus_neighbour/top" + "focus_neighbour/right" + "focus_neighbour/bottom" + "focus/ignore_mouse" + "focus/stop_mouse" + "size_flags/horizontal" + "size_flags/vertical" + "size_flags/stretch_ratio" + "range/min" + "range/max" + "range/step" + "range/page" + "range/value" + "range/exp_edit" + "rounded_values" + "text" + "align" + "valign" + "autowrap" + + "version" + 1 + "conn_count" + 0 + "node_count" + 36 + "variants" + + False + 0 + + "__editor_plugin_states__" + + "2D" + + "zoom" + 3.09087 + "ofs" + -2.41578, -57.0874 + + "3D" + + "zfar" + 500 + "fov" + 45 + "window_mode" + 0 + "window_0" + + "distance" + 4 + "default_light" + True + "x_rot" + 0.337 + "y_rot" + -0.575 + "show_grid" + True + "show_origin" + True + "pos" + 0, 0, 0 + + "znear" + 0.1 + + + "__editor_run_settings__" + + "custom_args" + "-l $scene" + "run_mode" + 0 + + "__editor_plugin_screen__" + "2D" + + True + 1 + 0, 0 + 0 + 1, 1 + + 1 + 1, 1, 1, 1 + 0, 0, 64, 64 + + 1, -0, 0, 1, 0, 0 + 2 + 64, 8, 64, 64, 0, 64, 0, 8 + 64, 0 + 64, 0, 64, 64 + + 0, 8, 56, 8, 56, 64, 0, 64 + 64, 64 + 64, 64, 64, 64 + + 0, 0, 56, 0, 56, 64, 0, 64 + 64, 128 + 320, 128, 128, 64 + + 64, 192 + 64, 128, 64, 64 + + 0, 0, 56, 0, 64, 8, 64, 64, 0, 64 + 256, 192 + 128, 128, 64, 128 + + 0, 8, 64, 72, 64, 128, 0, 128 + 128, 192 + 192, 192, 64, 64 + + 0, 64, 64, 64, 64, 8, 0, 8 + 192, 192 + 256, 192, 64, 64 + + 192, 128 + 256, 128, 64, 64 + 192, 64 + 256, 64, 64, 64 + 192, 0 + 256, 0, 64, 64 + 0, 64 + 0, 64, 64, 64 + 0, 128 + 384, 64, 64, 64 + + 64, 0, 64, 64, 0, 64, 0, 0 + 0, 192 + 448, 64, 64, 64 + + 296 + 8 + 596 + 125 + "" + "" + 14 + "This scene serves as a tool for editing the tileset. Nodes (sprites) and their respective collisions are edited here. To create a tileset from this, a "TileSet" resoucre must be created. this resource adds a menu which allows generating of the tileset data from the scene. or optionally merge it if one already exists (by looking at identical tile names). Finally, the saved tileset resource (tileset.xml in this case), can be opened to be used into a TileMap node for editing a tile map. " + + "nodes" + -1, -1, 0, 0, -1, 7, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 0, 0, 0, 9, 8, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 6, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 12, 6, 2, 0, 1, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 13, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 2, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 16, 6, 2, 0, 0, 0, 9, 42, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 17, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 18, 6, 2, 0, 4, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 19, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 5, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 20, 6, 2, 0, 0, 0, 9, 43, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 21, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 22, 6, 2, 0, 7, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 23, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 8, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 24, 6, 2, 0, 0, 0, 9, 44, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 25, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 26, 6, 2, 0, 10, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 27, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 11, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 24, 6, 2, 0, 0, 0, 9, 45, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 28, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 29, 6, 2, 0, 13, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 30, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 14, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 31, 6, 2, 0, 0, 0, 9, 46, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 32, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 33, 6, 2, 0, 16, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 34, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 17, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 35, 6, 2, 0, 0, 0, 9, 47, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 36, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 37, 6, 2, 0, 19, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 38, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 20, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 39, 6, 2, 0, 0, 0, 9, 48, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 40, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 41, 6, 2, 0, 22, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 42, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 23, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 39, 6, 2, 0, 0, 0, 9, 49, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 43, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 44, 6, 2, 0, 0, 0, 9, 50, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 45, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 46, 6, 2, 0, 0, 0, 9, 51, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 47, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 48, 6, 2, 0, 0, 0, 9, 52, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 49, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 50, 6, 2, 0, 0, 0, 9, 53, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 51, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 52, 6, 2, 0, 29, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 53, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 30, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 54, 6, 2, 0, 0, 0, 9, 54, -1, 27, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 17, 55, 18, 7, 19, 8, 20, 9, 21, 0, 22, 6, 23, 0, 24, 0, 25, 10, 26, 10, 27, 1, 28, 11, 29, 4, 30, 56, 6, 2, 0, 32, 0, 32, 31, -1, 22, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 33, 10, 34, 57, 35, 14, 36, 0, 37, 6, 38, 7, 6, 2, 0, 33, 0, 39, 39, -1, 18, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 4, 17, 6, 18, 7, 19, 8, 40, 15, 41, 24, 6, 2, 0, 0, 0, 56, 55, -1, 42, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 10, 4, 11, 0, 12, 5, 13, 5, 14, 4, 15, 1, 16, 0, 57, 1, 58, 1, 59, 1, 60, 1, 61, 58, 62, 59, 63, 60, 64, 61, 65, 62, 66, 63, 67, 63, 68, 63, 69, 63, 70, 4, 71, 4, 72, 15, 73, 1, 74, 5, 75, 7, 76, 64, 77, 5, 78, 64, 79, 7, 80, 0, 81, 0, 82, 65, 83, 1, 84, 1, 85, 0, 6, 2, 0 + "conns" + + + + + \ No newline at end of file diff --git a/demos/2d/platformer/types.cache b/demos/2d/platformer/types.cache new file mode 100644 index 0000000000..a215e5f137 --- /dev/null +++ b/demos/2d/platformer/types.cache @@ -0,0 +1,64 @@ +res://tileset.xml +TileSet +res://sound_shoot.wav +Sample +res://sound_hit.wav +Sample +res://scroll_bg_cloud_2.png +Texture +res://enemy.png +Texture +res://bullet.gd +GDScript +res://scroll_bg_cloud_3.png +Texture +res://coin.gd +GDScript +res://stage.xml +PackedScene +res://moving_platform.xml +PackedScene +res://bullet.png +Texture +res://player.xml +PackedScene +res://parallax_bg.xml +PackedScene +res://music.ogg +AudioStreamOGGVorbis +res://coin.png +Texture +res://sound_explode.wav +Sample +res://sound_coin.wav +Sample +res://robot_demo.png +Texture +res://moving_platform.gd +GDScript +res://enemy.xml +PackedScene +res://tileset_edit.xml +PackedScene +res://scroll_bg_fg_1.png +Texture +res://player.gd +GDScript +res://scroll_bg_fg_2.png +Texture +res://moving_platform.png +Texture +res://enemy.gd +GDScript +res://bullet.xml +PackedScene +res://tiles_demo.png +Texture +res://sound_jump.wav +Sample +res://scroll_bg_sky.png +Texture +res://scroll_bg_cloud_1.png +Texture +res://coin.xml +PackedScene -- cgit v1.2.3