diff --git a/misc/2.5d/README.md b/misc/2.5d/README.md new file mode 100644 index 00000000..0b762b9d --- /dev/null +++ b/misc/2.5d/README.md @@ -0,0 +1,19 @@ +# 2.5D Demo Project (GDScript) + +This demo project is an example of how a 2.5D game could be created in Godot. + +Controls: WASD to move, Space to jump, R to reset, and UIOPKL to change view modes. + +Note: There is a Mono C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/2.5d). + +## How does it work? + +Custom node types are added in a Godot plugin to allow 2.5D objects. Node25D serves as the base for all 2.5D objects; its first child must be a Spatial, which is used to calculate its position. It also adds YSort25D to sort Node25D nodes, and ShadowMath25D for calculating a shadow (a simple KinematicBody that tries to cast downward). + +It uses math inside of Node25D to calculate 2D positions from 3D ones. For getting a 3D position, this project uses KinematicBody and StaticBody (3D), but these only exist for math - the camera is 2D and all sprites are 2D. You are able to use any Spatial node for math. + +To display the objects, add a Sprite or any other Node2D-derived children to your Node25D objects. Some nodes are unsuitable, such as 2D physics nodes. Keep in mind that the first child must be Spatial-derived for math purposes. + +Several view modes are implemented, including top down, front side, 45 degree, isometric, and two oblique modes. To implement a different view angle, all you need to do is create a new set of basis vectors in Node25D, use it on all instances, and of course create textures to display that object in 2D. + +## Screenshots diff --git a/misc/2.5d/addons/node25d/.broken-gdscripts/Basis25D.gd b/misc/2.5d/addons/node25d/.broken-gdscripts/Basis25D.gd new file mode 100644 index 00000000..6b7817fd --- /dev/null +++ b/misc/2.5d/addons/node25d/.broken-gdscripts/Basis25D.gd @@ -0,0 +1,52 @@ +# Currently broken unless Godot makes this kind of thing possible: +# https://github.com/godotengine/godot/issues/21461 +# https://github.com/godotengine/godot-proposals/issues/279 + +# Basis25D structure for performing 2.5D transform math. +# Note: All code assumes that Y is UP in 3D, and DOWN in 2D. +# Meaning, a top-down view has a Y axis component of (0, 0), with a Z axis component of (0, 1). +# For a front side view, Y is (0, -1) and Z is (0, 0). +# Remember that Godot's 2D mode has the Y axis pointing DOWN on the screen. + +class_name Basis25D + +var x: Vector2 = Vector2() +var y: Vector2 = Vector2() +var z: Vector2 = Vector2() + +static func top_down(): + return init(1, 0, 0, 0, 0, 1) + +static func front_side(): + return init(1, 0, 0, -1, 0, 0) + +static func forty_five(): + return init(1, 0, 0, -0.70710678118, 0, 0.70710678118) + +static func isometric(): + return init(0.86602540378, 0.5, 0, -1, -0.86602540378, 0.5) + +static func oblique_y(): + return init(1, 0, -1, -1, 0, 1) + +static func oblique_z(): + return init(1, 0, 0, -1, -1, 1) + +# Creates a Dimetric Basis25D from the angle between the Y axis and the others. +# Dimetric(2.09439510239) is the same as Isometric. +# Try to keep this number away from a multiple of Tau/4 (or Pi/2) radians. +static func dimetric(angle): + var sine = sin(angle) + var cosine = cos(angle) + return init(sine, -cosine, 0, -1, -sine, -cosine) + +static func init(xx, xy, yx, yy, zx, zy): + var xv = Vector2(xx, xy) + var yv = Vector2(yx, yy) + var zv = Vector2(zx, zy) + return Basis25D.new(xv, yv, zv) + +func _init(xAxis: Vector2, yAxis: Vector2, zAxis: Vector2): + x = xAxis + y = yAxis + z = zAxis diff --git a/misc/2.5d/addons/node25d/.broken-gdscripts/Transform25D.gd b/misc/2.5d/addons/node25d/.broken-gdscripts/Transform25D.gd new file mode 100644 index 00000000..d4ed8810 --- /dev/null +++ b/misc/2.5d/addons/node25d/.broken-gdscripts/Transform25D.gd @@ -0,0 +1,22 @@ +# Currently broken unless Godot makes this kind of thing possible: +# https://github.com/godotengine/godot/issues/21461 +# https://github.com/godotengine/godot-proposals/issues/279 + +# Calculates the 2D transformation from a 3D position and a Basis25D. + +class_name Transform25D + +var spatial_position: Vector3 = Vector3() +var basis #: Basis25D + +func flat_transform(): + return Transform2D(0, flat_position()) + +func flat_position(): + var pos = spatial_position.x * basis.x + pos += spatial_position.y * basis.y + pos += spatial_position.z * basis.z + return pos + +func _init(basis25d): + basis = basis25d diff --git a/misc/2.5d/addons/node25d/Node25D.gd b/misc/2.5d/addons/node25d/Node25D.gd new file mode 100644 index 00000000..100acc0e --- /dev/null +++ b/misc/2.5d/addons/node25d/Node25D.gd @@ -0,0 +1,131 @@ +# This node converts a 3D position to 2D using a 2.5D transformation matrix. +# The transformation of its 2D form is controlled by its 3D child. +tool +extends Node2D +class_name Node25D, "res://addons/node25d/icons/node25d_icon.png" + +# SCALE is the number of 2D units in one 3D unit. Ideally, but not necessarily, an integer. +const SCALE = 32 + +# Exported spatial position for editor usage. +export(Vector3) var spatial_position setget set_spatial_position, get_spatial_position + +# GDScript throws errors when Basis25D is its own structure. +# There is a broken implementation in a hidden folder. +# https://github.com/godotengine/godot/issues/21461 +# https://github.com/godotengine/godot-proposals/issues/279 +var _basisX: Vector2 +var _basisY: Vector2 +var _basisZ: Vector2 + +# Cache the spatial stuff for internal use. +var _spatial_position: Vector3 +var _spatial_node: Spatial + + +# These are separated in case anyone wishes to easily extend Node25D. +func _ready(): + Node25D_ready() + + +func _process(_delta): + Node25D_process() + + +# Call this method in _ready, or before Node25D_process is first ran. +func Node25D_ready(): + _spatial_node = get_child(0) + # Changing the values here will change the default for all Node25D instances. + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(0, -0.70710678118) + _basisZ = SCALE * Vector2(0, 0.70710678118) + + +# Call this method in _process, or whenever the position of this object changes. +func Node25D_process(): + _check_view_mode() + if _spatial_node == null: + return + _spatial_position = _spatial_node.translation + + var flat_pos = _spatial_position.x * _basisX + flat_pos += _spatial_position.y * _basisY + flat_pos += _spatial_position.z * _basisZ + + global_position = flat_pos + + +func get_basis(): + return [_basisX, _basisY, _basisZ] + + +func get_spatial_position(): + if !_spatial_node: + _spatial_node = get_child(0) + return _spatial_node.translation + + +func set_spatial_position(value): + _spatial_position = value + if _spatial_node: + _spatial_node.translation = value + elif get_child_count() > 0: + _spatial_node = get_child(0) + + +# Change the basis based on the view_mode_index argument. +# This can be changed or removed in actual games where you only need one view mode. +func set_view_mode(view_mode_index): + match view_mode_index: + 0: # 45 Degrees + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(0, -0.70710678118) + _basisZ = SCALE * Vector2(0, 0.70710678118) + 1: # Isometric + _basisX = SCALE * Vector2(0.86602540378, 0.5) + _basisY = SCALE * Vector2(0, -1) + _basisZ = SCALE * Vector2(-0.86602540378, 0.5) + 2: # Top Down + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(0, 0) + _basisZ = SCALE * Vector2(0, 1) + 3: # Front Side + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(0, -1) + _basisZ = SCALE * Vector2(0, 0) + 4: # Oblique Y + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(-0.70710678118, -0.70710678118) + _basisZ = SCALE * Vector2(0, 1) + 5: # Oblique Z + _basisX = SCALE * Vector2(1, 0) + _basisY = SCALE * Vector2(0, -1) + _basisZ = SCALE * Vector2(-0.70710678118, 0.70710678118) + + +# Check if anyone presses the view mode buttons and change the basis accordingly. +# This can be changed or removed in actual games where you only need one view mode. +func _check_view_mode(): + if Input.is_action_just_pressed("forty_five_mode"): + set_view_mode(0) + elif Input.is_action_just_pressed("isometric_mode"): + set_view_mode(1) + elif Input.is_action_just_pressed("top_down_mode"): + set_view_mode(2) + elif Input.is_action_just_pressed("front_side_mode"): + set_view_mode(3) + elif Input.is_action_just_pressed("oblique_y_mode"): + set_view_mode(4) + elif Input.is_action_just_pressed("oblique_z_mode"): + set_view_mode(5) + + +# Used by YSort25D +static func y_sort(a: Node25D, b: Node25D): + return a._spatial_position.y < b._spatial_position.y + + +static func y_sort_slight_xz(a: Node25D, b: Node25D): + var a_index = a._spatial_position.y + 0.001 * (a._spatial_position.x + a._spatial_position.z) + var b_index = b._spatial_position.y + 0.001 * (b._spatial_position.x + b._spatial_position.z) + return a_index < b_index diff --git a/misc/2.5d/addons/node25d/ShadowMath25D.gd b/misc/2.5d/addons/node25d/ShadowMath25D.gd new file mode 100644 index 00000000..77e20cef --- /dev/null +++ b/misc/2.5d/addons/node25d/ShadowMath25D.gd @@ -0,0 +1,33 @@ +# Adds a simple shadow below an object. +# Place this ShadowMath25D node as a child of a Shadow25D, which +# is below the target object in the scene tree (not as a child). +tool +extends KinematicBody +class_name ShadowMath25D, "res://addons/node25d/icons/shadowmath25d_icon.png" + +# The maximum distance below objects that shadows will appear (in 3D units). +var shadow_length = 1000.0 +var _shadow_root: Node25D +var _target_math: Spatial + + +func _ready(): + _shadow_root = get_parent() + var index = _shadow_root.get_position_in_parent() + if (index > 0): # Else, Shadow is not in a valid place. + _target_math = _shadow_root.get_parent().get_child(index - 1).get_child(0) + + +func _process(_delta): + if _target_math == null: + if _shadow_root != null: + _shadow_root.visible = false + return # Shadow is not in a valid place or you're viewing the Shadow25D scene. + + translation = _target_math.translation + var k = move_and_collide(Vector3.DOWN * shadow_length) + if k == null: + _shadow_root.visible = false + else: + _shadow_root.visible = true + global_transform = transform diff --git a/misc/2.5d/addons/node25d/YSort25D.gd b/misc/2.5d/addons/node25d/YSort25D.gd new file mode 100644 index 00000000..071fa206 --- /dev/null +++ b/misc/2.5d/addons/node25d/YSort25D.gd @@ -0,0 +1,46 @@ +# Sorts all Node25D children of its parent. +# This is different from the C# version of this project +# because the execution order is different and otherwise +# sorting is delayed by one frame. +tool +extends Node # Note: NOT Node2D, Node25D, or YSort +class_name YSort25D, "res://addons/node25d/icons/ysort25d_icon.png" + +# Whether or not to automatically call sort() in _process(). +export(bool) var sort_enabled := true +var _parent_node: Node2D # NOT Node25D + + +func _ready(): + _parent_node = get_parent() + + +func _process(_delta): + if sort_enabled: + sort() + + +# Call this method in _process, or whenever you want to sort children. +func sort(): + if _parent_node == null: + return # _ready() hasn't been run yet + var parent_children = _parent_node.get_children() + if parent_children.size() > 4000: + # The Z index only goes from -4096 to 4096, and we want room for objects having multiple layers. + printerr("Sorting failed: Max number of YSort25D nodes is 4000.") + return + + # We only want to get Node25D children. + # Currently, it also grabs Node2D children. + var node25d_nodes = [] + for n in parent_children: + if n.get_class() == "Node2D": + node25d_nodes.append(n) + node25d_nodes.sort_custom(Node25D, "y_sort_slight_xz") + + var z_index = -4000 + for i in range(0, node25d_nodes.size()): + node25d_nodes[i].z_index = z_index + # Increment by 2 each time, to allow for shadows in-between. + # This does mean that we have a limit of 4000 total sorted Node25Ds. + z_index += 2 diff --git a/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png b/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png new file mode 100644 index 00000000..2780a094 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png differ diff --git a/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png.import b/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png.import new file mode 100644 index 00000000..cfa964d5 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/kinematic_body_25d.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/kinematic_body_25d.png-c455d5ccb8ec7543b62fff6e803eee7c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/kinematic_body_25d.png" +dest_files=[ "res://.import/kinematic_body_25d.png-c455d5ccb8ec7543b62fff6e803eee7c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/node25d.png b/misc/2.5d/addons/node25d/icons/node25d.png new file mode 100644 index 00000000..ede1d823 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/node25d.png differ diff --git a/misc/2.5d/addons/node25d/icons/node25d.png.import b/misc/2.5d/addons/node25d/icons/node25d.png.import new file mode 100644 index 00000000..c5811b6a --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/node25d.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/node25d.png-deca325dc1330ad07256305d79ddc3ba.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/node25d.png" +dest_files=[ "res://.import/node25d.png-deca325dc1330ad07256305d79ddc3ba.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/node25d_icon.png b/misc/2.5d/addons/node25d/icons/node25d_icon.png new file mode 100644 index 00000000..12b13bb5 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/node25d_icon.png differ diff --git a/misc/2.5d/addons/node25d/icons/node25d_icon.png.import b/misc/2.5d/addons/node25d/icons/node25d_icon.png.import new file mode 100644 index 00000000..bac3b673 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/node25d_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/node25d_icon.png-075c4b266c832f0f269670bad017ac93.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/node25d_icon.png" +dest_files=[ "res://.import/node25d_icon.png-075c4b266c832f0f269670bad017ac93.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/shadowmath25d.png b/misc/2.5d/addons/node25d/icons/shadowmath25d.png new file mode 100644 index 00000000..0dbc8c4b Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/shadowmath25d.png differ diff --git a/misc/2.5d/addons/node25d/icons/shadowmath25d.png.import b/misc/2.5d/addons/node25d/icons/shadowmath25d.png.import new file mode 100644 index 00000000..42ef89f7 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/shadowmath25d.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/shadowmath25d.png-829bb9aabf7e847ec9c9f29f41353471.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/shadowmath25d.png" +dest_files=[ "res://.import/shadowmath25d.png-829bb9aabf7e847ec9c9f29f41353471.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png b/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png new file mode 100644 index 00000000..ae13ea38 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png differ diff --git a/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png.import b/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png.import new file mode 100644 index 00000000..107f5cf7 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/shadowmath25d_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/shadowmath25d_icon.png-2b9af3adf31a4021b98dae0a81fb9294.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/shadowmath25d_icon.png" +dest_files=[ "res://.import/shadowmath25d_icon.png-2b9af3adf31a4021b98dae0a81fb9294.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/ysort25d.png b/misc/2.5d/addons/node25d/icons/ysort25d.png new file mode 100644 index 00000000..e37e5750 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/ysort25d.png differ diff --git a/misc/2.5d/addons/node25d/icons/ysort25d.png.import b/misc/2.5d/addons/node25d/icons/ysort25d.png.import new file mode 100644 index 00000000..b187da88 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/ysort25d.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/ysort25d.png-d31f6d31844267009448064818383c0d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/ysort25d.png" +dest_files=[ "res://.import/ysort25d.png-d31f6d31844267009448064818383c0d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/icons/ysort25d_icon.png b/misc/2.5d/addons/node25d/icons/ysort25d_icon.png new file mode 100644 index 00000000..1e362220 Binary files /dev/null and b/misc/2.5d/addons/node25d/icons/ysort25d_icon.png differ diff --git a/misc/2.5d/addons/node25d/icons/ysort25d_icon.png.import b/misc/2.5d/addons/node25d/icons/ysort25d_icon.png.import new file mode 100644 index 00000000..a781fa62 --- /dev/null +++ b/misc/2.5d/addons/node25d/icons/ysort25d_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/ysort25d_icon.png-7203736c3c997b4f31f7b878b0530dfd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/node25d/icons/ysort25d_icon.png" +dest_files=[ "res://.import/ysort25d_icon.png-7203736c3c997b4f31f7b878b0530dfd.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/addons/node25d/node25d_plugin.gd b/misc/2.5d/addons/node25d/node25d_plugin.gd new file mode 100644 index 00000000..ad179025 --- /dev/null +++ b/misc/2.5d/addons/node25d/node25d_plugin.gd @@ -0,0 +1,16 @@ +tool +extends EditorPlugin + + +func _enter_tree(): + # When this plugin node enters tree, add the custom types + add_custom_type("Node25D", "Node2D", preload("Node25D.gd"), preload("icons/node25d_icon.png")) + add_custom_type("YSort25D", "Node", preload("YSort25D.gd"), preload("icons/ysort25d_icon.png")) + add_custom_type("ShadowMath25D", "KinematicBody", preload("ShadowMath25D.gd"), preload("icons/shadowmath25d_icon.png")) + + +func _exit_tree(): + # When the plugin node exits the tree, remove the custom types + remove_custom_type("ShadowMath25D") + remove_custom_type("YSort25D") + remove_custom_type("Node25D") diff --git a/misc/2.5d/addons/node25d/plugin.cfg b/misc/2.5d/addons/node25d/plugin.cfg new file mode 100644 index 00000000..3336dfa8 --- /dev/null +++ b/misc/2.5d/addons/node25d/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Node25D" +description="Adds Node25D" +author="Aaron Franke" +version="1.0" +script="node25d_plugin.gd" diff --git a/misc/2.5d/assets/DemoScene.tscn b/misc/2.5d/assets/DemoScene.tscn new file mode 100644 index 00000000..d635671c --- /dev/null +++ b/misc/2.5d/assets/DemoScene.tscn @@ -0,0 +1,592 @@ +[gd_scene load_steps=13 format=2] + +[ext_resource path="res://assets/ui/Overlay.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/player/Player25D.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/shadow/Shadow25D.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/node25d/Node25D.gd" type="Script" id=4] +[ext_resource path="res://addons/node25d/icons/node25d_icon.png" type="Texture" id=5] +[ext_resource path="res://assets/platform/textures/fortyfive.png" type="Texture" id=6] +[ext_resource path="res://assets/platform/PlatformSprite.gd" type="Script" id=7] +[ext_resource path="res://addons/node25d/YSort25D.gd" type="Script" id=8] +[ext_resource path="res://addons/node25d/icons/ysort25d_icon.png" type="Texture" id=9] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 5, 0.5, 5 ) + +[sub_resource type="BoxShape" id=2] +extents = Vector3( 5, 0.5, 5 ) + +[sub_resource type="BoxShape" id=3] +extents = Vector3( 5, 0.5, 5 ) + +[node name="DemoScene" type="Node2D"] + +[node name="Overlay" parent="." instance=ExtResource( 1 )] + +[node name="Player25D" parent="." instance=ExtResource( 2 )] +position = Vector2( 0, 0 ) +z_index = -3952 + +[node name="Shadow25D" parent="." instance=ExtResource( 3 )] +visible = true +position = Vector2( 0, 0 ) +z_index = -3958 +spatial_position = Vector3( 3.13315e-08, -0.498, 3.13315e-08 ) + +[node name="Platform0" type="Node2D" parent="."] +z_index = -3954 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -8, 5, 0 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 5, 0 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform0/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform0"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform1" type="Node2D" parent="."] +z_index = -3956 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -8, 5, -10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 5, -10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform1/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform1"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform2" type="Node2D" parent="."] +z_index = -3962 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 0, -1, 0 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform2/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform2"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform3" type="Node2D" parent="."] +z_index = -3960 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -1, 0 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform3"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -1, 0 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform3/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform3"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform4" type="Node2D" parent="."] +z_index = -3966 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 0, -1, -10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform4"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, -10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform4/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform4"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform5" type="Node2D" parent="."] +z_index = -3984 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, -10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform5"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, -10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform5/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform5"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform6" type="Node2D" parent="."] +z_index = -3982 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, 0 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform6"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, 0 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform6/PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform6"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform7" type="Node2D" parent="."] +z_index = -3978 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, 10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform7"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, 10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform7/PlatformMath"] +shape = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform7"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform20" type="Node2D" parent="."] +z_index = -3976 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, 20 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform20"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, 20 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform20/PlatformMath"] +shape = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform20"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform21" type="Node2D" parent="."] +z_index = -3972 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, 30 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform21"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, 30 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform21/PlatformMath"] +shape = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform21"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform22" type="Node2D" parent="."] +z_index = -3970 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 10, -5, 40 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform22"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, -5, 40 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform22/PlatformMath"] +shape = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform22"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform9" type="Node2D" parent="."] +z_index = -3974 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 20, -5, 10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform9"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 20, -5, 10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform9/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform9"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform10" type="Node2D" parent="."] +z_index = -3994 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 28, -10, 3 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform10"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, -10, 3 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform10/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform10"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform11" type="Node2D" parent="."] +z_index = -3992 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 28, -10, 13 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform11"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, -10, 13 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform11/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform11"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform12" type="Node2D" parent="."] +z_index = -3988 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 28, -10, 23 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform12"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, -10, 23 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform12/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform12"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform13" type="Node2D" parent="."] +z_index = -3990 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 18, -10, 23 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform13"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 18, -10, 23 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform13/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform13"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform14" type="Node2D" parent="."] +z_index = -3996 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( 8, -10, 23 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform14"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 8, -10, 23 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform14/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform14"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform15" type="Node2D" parent="."] +z_index = -3998 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -2, -10, 23 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform15"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, -10, 23 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform15/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform15"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform23" type="Node2D" parent="."] +z_index = -4000 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -12, -10, 23 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform23"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -12, -10, 23 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform23/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform23"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform16" type="Node2D" parent="."] +z_index = -3980 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -10, -5, 20 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform16"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10, -5, 20 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform16/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform16"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform19" type="Node2D" parent="."] +z_index = -3986 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -10, -5, 10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform19"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10, -5, 10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform19/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform19"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform17" type="Node2D" parent="."] +z_index = -3964 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -15, -1, 10 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform17"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -15, -1, 10 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform17/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform17"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="Platform18" type="Node2D" parent="."] +z_index = -3968 +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 5 ) +} +spatial_position = Vector3( -15, -1, 0 ) + +[node name="PlatformMath" type="StaticBody" parent="Platform18"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -15, -1, 0 ) +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="Platform18/PlatformMath"] +shape = SubResource( 3 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="Platform18"] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 6 ) +script = ExtResource( 7 ) + +[node name="YSort25D" type="Node" parent="."] +script = ExtResource( 8 ) +__meta__ = { +"_editor_icon": ExtResource( 9 ) +} diff --git a/misc/2.5d/assets/cube/Cube.tscn b/misc/2.5d/assets/cube/Cube.tscn new file mode 100644 index 00000000..a11e6e23 --- /dev/null +++ b/misc/2.5d/assets/cube/Cube.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://addons/node25d/icons/ysort25d_icon.png" type="Texture" id=1] +[ext_resource path="res://assets/ui/OverlayCube.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/cube/CubeMath.gd" type="Script" id=3] +[ext_resource path="res://addons/node25d/YSort25D.gd" type="Script" id=4] + +[node name="Cube" type="Node2D"] + +[node name="Overlay" parent="." instance=ExtResource( 2 )] + +[node name="Camera2D" type="Camera2D" parent="."] +current = true + +[node name="CubeMath" type="Spatial" parent="."] +script = ExtResource( 3 ) + +[node name="YSort25D" type="Node" parent="."] +script = ExtResource( 4 ) +__meta__ = { +"_editor_icon": ExtResource( 1 ) +} diff --git a/misc/2.5d/assets/cube/CubeMath.gd b/misc/2.5d/assets/cube/CubeMath.gd new file mode 100644 index 00000000..b191d115 --- /dev/null +++ b/misc/2.5d/assets/cube/CubeMath.gd @@ -0,0 +1,52 @@ +extends Spatial + +onready var _cube_point_scene: PackedScene = preload("res://assets/cube/CubePoint.tscn") + +onready var _parent = get_parent() +var _is_parent_ready := false +var _cube_points_math = [] +var _cube_math_spatials = [] + +func _ready(): + _parent = get_parent() + + for i in range(27): + # warning-ignore:integer_division + var a: int = (i / 9) - 1 + # warning-ignore:integer_division + var b: int = (i / 3) % 3 - 1 + var c: int = (i % 3) - 1 + var spatial_position: Vector3 = 5 * (a * Vector3.RIGHT + b * Vector3.UP + c * Vector3.BACK) + _cube_math_spatials.append(Spatial.new()) + _cube_math_spatials[i].translation = spatial_position + _cube_math_spatials[i].name = "CubeMath #" + str(i) + ", " + str(a) + " " + str(b) + " " + str(c) + add_child(_cube_math_spatials[i]) + + +func _process(delta): + if Input.is_action_pressed("exit"): + get_tree().quit() + + if Input.is_action_just_pressed("view_cube_demo"): + # warning-ignore:return_value_discarded + get_tree().change_scene("res://assets/DemoScene.tscn") + return + + if _is_parent_ready: + if Input.is_action_just_pressed("reset_position"): + transform = Transform.IDENTITY + else: + rotate_x(delta * (Input.get_action_strength("move_back") - Input.get_action_strength("move_forward"))) + rotate_y(delta * (Input.get_action_strength("move_right") - Input.get_action_strength("move_left"))) + rotate_z(delta * (Input.get_action_strength("move_counterclockwise") - Input.get_action_strength("move_clockwise"))) + for i in range(27): + _cube_points_math[i].global_transform = _cube_math_spatials[i].global_transform + else: + # This code block will be run only once. It's not in _ready() because the parent isn't set up there. + for i in range(27): + var my_cube_point_scene = _cube_point_scene.duplicate(true) + var cube_point = my_cube_point_scene.instance() + cube_point.name = "CubePoint #" + str(i) + _cube_points_math.append(cube_point.get_child(0)) + _parent.add_child(cube_point) + _is_parent_ready = true diff --git a/misc/2.5d/assets/cube/CubePoint.tscn b/misc/2.5d/assets/cube/CubePoint.tscn new file mode 100644 index 00000000..921818f6 --- /dev/null +++ b/misc/2.5d/assets/cube/CubePoint.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/node25d/Node25D.gd" type="Script" id=1] +[ext_resource path="res://addons/node25d/icons/node25d_icon.png" type="Texture" id=2] +[ext_resource path="res://assets/cube/godot.png" type="Texture" id=3] + +[node name="CubePoint" type="Node2D"] +script = ExtResource( 1 ) +__meta__ = { +"_editor_icon": ExtResource( 2 ) +} + +[node name="CubePointMath" type="Spatial" parent="."] + +[node name="CubePointSprite" type="Sprite" parent="."] +texture = ExtResource( 3 ) diff --git a/misc/2.5d/assets/cube/godot.png b/misc/2.5d/assets/cube/godot.png new file mode 100644 index 00000000..b6644648 Binary files /dev/null and b/misc/2.5d/assets/cube/godot.png differ diff --git a/misc/2.5d/assets/cube/godot.png.import b/misc/2.5d/assets/cube/godot.png.import new file mode 100644 index 00000000..0cc11e6b --- /dev/null +++ b/misc/2.5d/assets/cube/godot.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/godot.png-a942b208c71d1b44958f34d302d011ec.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/cube/godot.png" +dest_files=[ "res://.import/godot.png-a942b208c71d1b44958f34d302d011ec.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/Platform.tscn b/misc/2.5d/assets/platform/Platform.tscn new file mode 100644 index 00000000..153bdca2 --- /dev/null +++ b/misc/2.5d/assets/platform/Platform.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://addons/node25d/Node25D.gd" type="Script" id=1] +[ext_resource path="res://addons/node25d/icons/node25d_icon.png" type="Texture" id=2] +[ext_resource path="res://assets/platform/textures/fortyfive.png" type="Texture" id=3] +[ext_resource path="res://assets/platform/PlatformSprite.gd" type="Script" id=4] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 5, 0.5, 5 ) + +[node name="Platform" type="Node2D"] +z_index = -3996 +script = ExtResource( 1 ) +__meta__ = { +"_editor_icon": ExtResource( 2 ) +} + +[node name="PlatformMath" type="StaticBody" parent="."] +collision_layer = 1048575 +collision_mask = 1048575 + +[node name="CollisionShape" type="CollisionShape" parent="PlatformMath"] +shape = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="PlatformSprite" type="Sprite" parent="."] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 3 ) +script = ExtResource( 4 ) diff --git a/misc/2.5d/assets/platform/PlatformSprite.gd b/misc/2.5d/assets/platform/PlatformSprite.gd new file mode 100644 index 00000000..e817ef5e --- /dev/null +++ b/misc/2.5d/assets/platform/PlatformSprite.gd @@ -0,0 +1,39 @@ +tool +extends Sprite + +onready var _fortyFive = preload("res://assets/platform/textures/fortyfive.png") +onready var _isometric = preload("res://assets/platform/textures/isometric.png") +onready var _topDown = preload("res://assets/platform/textures/topdown.png") +onready var _frontSide = preload("res://assets/platform/textures/frontside.png") +onready var _obliqueY = preload("res://assets/platform/textures/obliqueY.png") +onready var _obliqueZ = preload("res://assets/platform/textures/obliqueZ.png") + +func _process(_delta): + if Input.is_action_pressed("forty_five_mode"): + set_view_mode(0) + elif Input.is_action_pressed("isometric_mode"): + set_view_mode(1) + elif Input.is_action_pressed("top_down_mode"): + set_view_mode(2) + elif Input.is_action_pressed("front_side_mode"): + set_view_mode(3) + elif Input.is_action_pressed("oblique_y_mode"): + set_view_mode(4) + elif Input.is_action_pressed("oblique_z_mode"): + set_view_mode(5) + + +func set_view_mode(view_mode_index): + match view_mode_index: + 0: # 45 Degrees + texture = _fortyFive; + 1: # Isometric + texture = _isometric + 2: # Top Down + texture = _topDown + 3: # Front Side + texture = _frontSide + 4: # Oblique Y + texture = _obliqueY + 5: # Oblique Z + texture = _obliqueZ diff --git a/misc/2.5d/assets/platform/textures/41226408-platform-texture.jpg.import b/misc/2.5d/assets/platform/textures/41226408-platform-texture.jpg.import new file mode 100644 index 00000000..0349bce7 --- /dev/null +++ b/misc/2.5d/assets/platform/textures/41226408-platform-texture.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/41226408-platform-texture.jpg-baf3b2df9182218f8ceff003f894b1db.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/41226408-platform-texture.jpg" +dest_files=[ "res://.import/41226408-platform-texture.jpg-baf3b2df9182218f8ceff003f894b1db.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/fortyfive.png b/misc/2.5d/assets/platform/textures/fortyfive.png new file mode 100644 index 00000000..e4422bb3 Binary files /dev/null and b/misc/2.5d/assets/platform/textures/fortyfive.png differ diff --git a/misc/2.5d/assets/platform/textures/fortyfive.png.import b/misc/2.5d/assets/platform/textures/fortyfive.png.import new file mode 100644 index 00000000..f2b0448b --- /dev/null +++ b/misc/2.5d/assets/platform/textures/fortyfive.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/fortyfive.png-ed5c66b01afe0b53153c3d09ee5b6584.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/fortyfive.png" +dest_files=[ "res://.import/fortyfive.png-ed5c66b01afe0b53153c3d09ee5b6584.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/frontside.png b/misc/2.5d/assets/platform/textures/frontside.png new file mode 100644 index 00000000..aa3bdd78 Binary files /dev/null and b/misc/2.5d/assets/platform/textures/frontside.png differ diff --git a/misc/2.5d/assets/platform/textures/frontside.png.import b/misc/2.5d/assets/platform/textures/frontside.png.import new file mode 100644 index 00000000..00089eca --- /dev/null +++ b/misc/2.5d/assets/platform/textures/frontside.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/frontside.png-59d804a7bfdefb2229c160b22085f140.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/frontside.png" +dest_files=[ "res://.import/frontside.png-59d804a7bfdefb2229c160b22085f140.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/isometric.png b/misc/2.5d/assets/platform/textures/isometric.png new file mode 100644 index 00000000..7045d86b Binary files /dev/null and b/misc/2.5d/assets/platform/textures/isometric.png differ diff --git a/misc/2.5d/assets/platform/textures/isometric.png.import b/misc/2.5d/assets/platform/textures/isometric.png.import new file mode 100644 index 00000000..e722a8d6 --- /dev/null +++ b/misc/2.5d/assets/platform/textures/isometric.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/isometric.png-364f65b60f600b10cfb048c20ea82124.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/isometric.png" +dest_files=[ "res://.import/isometric.png-364f65b60f600b10cfb048c20ea82124.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/obliqueY.png b/misc/2.5d/assets/platform/textures/obliqueY.png new file mode 100644 index 00000000..1b0b0d24 Binary files /dev/null and b/misc/2.5d/assets/platform/textures/obliqueY.png differ diff --git a/misc/2.5d/assets/platform/textures/obliqueY.png.import b/misc/2.5d/assets/platform/textures/obliqueY.png.import new file mode 100644 index 00000000..9ef35997 --- /dev/null +++ b/misc/2.5d/assets/platform/textures/obliqueY.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/obliqueY.png-835238e1a682fa9039cff7ef5cfcacd4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/obliqueY.png" +dest_files=[ "res://.import/obliqueY.png-835238e1a682fa9039cff7ef5cfcacd4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/obliqueZ.png b/misc/2.5d/assets/platform/textures/obliqueZ.png new file mode 100644 index 00000000..a859ccb6 Binary files /dev/null and b/misc/2.5d/assets/platform/textures/obliqueZ.png differ diff --git a/misc/2.5d/assets/platform/textures/obliqueZ.png.import b/misc/2.5d/assets/platform/textures/obliqueZ.png.import new file mode 100644 index 00000000..ac8ea965 --- /dev/null +++ b/misc/2.5d/assets/platform/textures/obliqueZ.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/obliqueZ.png-ccf2b8e0c4fa1369940c3976d1e9a334.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/obliqueZ.png" +dest_files=[ "res://.import/obliqueZ.png-ccf2b8e0c4fa1369940c3976d1e9a334.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/platform/textures/topdown.png b/misc/2.5d/assets/platform/textures/topdown.png new file mode 100644 index 00000000..53f9b83e Binary files /dev/null and b/misc/2.5d/assets/platform/textures/topdown.png differ diff --git a/misc/2.5d/assets/platform/textures/topdown.png.import b/misc/2.5d/assets/platform/textures/topdown.png.import new file mode 100644 index 00000000..65f68479 --- /dev/null +++ b/misc/2.5d/assets/platform/textures/topdown.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/topdown.png-66f9d3553daec51a7ec6739d98ef44ef.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/platform/textures/topdown.png" +dest_files=[ "res://.import/topdown.png-66f9d3553daec51a7ec6739d98ef44ef.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/player/Player25D.tscn b/misc/2.5d/assets/player/Player25D.tscn new file mode 100644 index 00000000..eb30e455 --- /dev/null +++ b/misc/2.5d/assets/player/Player25D.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://addons/node25d/Node25D.gd" type="Script" id=1] +[ext_resource path="res://addons/node25d/icons/node25d_icon.png" type="Texture" id=2] +[ext_resource path="res://assets/player/PlayerMath25D.gd" type="Script" id=3] +[ext_resource path="res://assets/player/textures/jump.png" type="Texture" id=4] +[ext_resource path="res://assets/player/PlayerSprite.gd" type="Script" id=5] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 0.5, 1, 0.5 ) + +[node name="Player25D" type="Node2D"] +position = Vector2( 0, -226.274 ) +z_index = 100 +script = ExtResource( 1 ) +__meta__ = { +"_editor_icon": ExtResource( 2 ) +} +spatial_position = Vector3( 0, 10, 0 ) + +[node name="PlayerMath25D" type="KinematicBody" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0 ) +script = ExtResource( 3 ) + +[node name="CollisionShape" type="CollisionShape" parent="PlayerMath25D"] +shape = SubResource( 1 ) + +[node name="PlayerSprite" type="Sprite" parent="."] +scale = Vector2( 1, 0.75 ) +z_index = 1 +texture = ExtResource( 4 ) +offset = Vector2( 0, 4 ) +vframes = 5 +hframes = 2 +script = ExtResource( 5 ) + +[node name="PlayerCamera" type="Camera2D" parent="PlayerSprite"] +current = true diff --git a/misc/2.5d/assets/player/PlayerMath25D.gd b/misc/2.5d/assets/player/PlayerMath25D.gd new file mode 100644 index 00000000..e49ae855 --- /dev/null +++ b/misc/2.5d/assets/player/PlayerMath25D.gd @@ -0,0 +1,58 @@ +# Handles Player-specific behavior like moving. We calculate such things with KinematicBody. +extends KinematicBody +class_name PlayerMath25D # No icon necessary + +var vertical_speed := 0.0 +var isometric_controls := true +onready var _parent_node25d: Node25D = get_parent() + +func _process(delta): + if Input.is_action_pressed("exit"): + get_tree().quit() + + if Input.is_action_just_pressed("view_cube_demo"): + #warning-ignore:return_value_discarded + get_tree().change_scene("res://assets/cube/Cube.tscn") + return + + if Input.is_action_just_pressed("toggle_isometric_controls"): + isometric_controls = !isometric_controls + if Input.is_action_just_pressed("reset_position"): + transform = Transform(Basis(), Vector3.UP * 10) + vertical_speed = 0 + else: + _horizontal_movement(delta) + _vertical_movement(delta) + + +# Checks WASD and Shift for horizontal movement via move_and_slide. +func _horizontal_movement(delta): + var localX = Vector3.RIGHT + var localZ = Vector3.BACK + + if isometric_controls && is_equal_approx(Node25D.SCALE * 0.86602540378, _parent_node25d.get_basis()[0].x): + localX = Vector3(0.70710678118, 0, -0.70710678118) + localZ = Vector3(0.70710678118, 0, 0.70710678118) + + # Gather player input and add directional movement to a Vector3 variable. + var move_dir = Vector3() + move_dir += localX * (Input.get_action_strength("move_right") - Input.get_action_strength("move_left")) + move_dir += localZ * (Input.get_action_strength("move_back") - Input.get_action_strength("move_forward")) + + move_dir = move_dir.normalized() * delta * 600; + if Input.is_action_pressed("movement_modifier"): + move_dir /= 2; + + #warning-ignore:return_value_discarded + move_and_slide(move_dir) + + +# Checks Jump and applies gravity and vertical speed via move_and_collide. +func _vertical_movement(delta): + var localY = Vector3.UP + if Input.is_action_just_pressed("jump"): + vertical_speed = 1.25 + vertical_speed -= delta * 5 # Gravity + var k = move_and_collide(localY * vertical_speed); + if k != null: + vertical_speed = 0 diff --git a/misc/2.5d/assets/player/PlayerSprite.gd b/misc/2.5d/assets/player/PlayerSprite.gd new file mode 100644 index 00000000..aef9362e --- /dev/null +++ b/misc/2.5d/assets/player/PlayerSprite.gd @@ -0,0 +1,143 @@ +tool +extends Sprite + +onready var _stand = preload("res://assets/player/textures/stand.png") +onready var _jump = preload("res://assets/player/textures/jump.png") +onready var _run = preload("res://assets/player/textures/run.png") + +const FRAMERATE = 15 + +var _direction := 0 +var _progress := 0.0 +var _parent_node25d: Node25D +var _parent_math: PlayerMath25D + +func _ready(): + _parent_node25d = get_parent() + _parent_math = _parent_node25d.get_child(0) + + +func _process(delta): + if Engine.is_editor_hint(): + return # Don't run this in the editor. + + _sprite_basis() + var movement = _check_movement() # Always run to get direction, but don't always use return bool. + + # Test-only move and collide, check if the player is on the ground. + var k = _parent_math.move_and_collide(Vector3.DOWN * 10 * delta, true, true, true) + if k != null: + if movement: + hframes = 6 + texture = _run + if (Input.is_action_pressed("movement_modifier")): + delta /= 2 + _progress = fmod((_progress + FRAMERATE * delta), 6) + frame = _direction * 6 + int(_progress) + else: + hframes = 1 + texture = _stand + _progress = 0 + frame = _direction + else: + hframes = 2 + texture = _jump + _progress = 0 + var jumping = 1 if _parent_math.vertical_speed < 0 else 0 + frame = _direction * 2 + jumping + + +func set_view_mode(view_mode_index): + match view_mode_index: + 0: # 45 Degrees + transform.x = Vector2(1, 0) + transform.y = Vector2(0, 0.75) + 1: # Isometric + transform.x = Vector2(1, 0) + transform.y = Vector2(0, 1) + 2: # Top Down + transform.x = Vector2(1, 0) + transform.y = Vector2(0, 0.5) + 3: # Front Side + transform.x = Vector2(1, 0) + transform.y = Vector2(0, 1) + 4: # Oblique Y + transform.x = Vector2(1, 0) + transform.y = Vector2(0.75, 0.75) + 5: # Oblique Z + transform.x = Vector2(1, 0.25) + transform.y = Vector2(0, 1) + + +# Change the 2D basis of the sprite to try and make it "fit" multiple view modes. +func _sprite_basis(): + if Input.is_action_pressed("forty_five_mode"): + set_view_mode(0) + elif Input.is_action_pressed("isometric_mode"): + set_view_mode(1) + elif Input.is_action_pressed("top_down_mode"): + set_view_mode(2) + elif Input.is_action_pressed("front_side_mode"): + set_view_mode(3) + elif Input.is_action_pressed("oblique_y_mode"): + set_view_mode(4) + elif Input.is_action_pressed("oblique_z_mode"): + set_view_mode(5) + + +# This method returns a bool but if true it also outputs to the direction variable. +func _check_movement() -> bool: + # Gather player input and store movement to these int variables. Note: These indeed have to be integers. + var x := 0 + var z := 0 + + if Input.is_action_pressed("move_right"): + x += 1 + if Input.is_action_pressed("move_left"): + x -= 1 + if Input.is_action_pressed("move_forward"): + z -= 1 + if Input.is_action_pressed("move_back"): + z += 1 + + # Check for isometric controls and add more to movement accordingly. + # For efficiency, only check the X axis since this X axis value isn't used anywhere else. + if !_parent_math.isometric_controls && is_equal_approx(Node25D.SCALE * 0.86602540378, _parent_node25d.get_basis()[0].x): + if Input.is_action_pressed("move_right"): + z += 1 + if Input.is_action_pressed("move_left"): + z -= 1 + if Input.is_action_pressed("move_forward"): + x += 1 + if Input.is_action_pressed("move_back"): + x -= 1 + + # Set the direction based on which inputs were pressed. + if x == 0: + if z == 0: + return false # No movement. + elif z > 0: + _direction = 0 + else: + _direction = 4 + elif x > 0: + if z == 0: + _direction = 2 + flip_h = true + elif z > 0: + _direction = 1 + flip_h = true + else: + _direction = 3 + flip_h = true + else: + if z == 0: + _direction = 2 + flip_h = false + elif z > 0: + _direction = 1 + flip_h = false + else: + _direction = 3 + flip_h = false + return true # There is movement. diff --git a/misc/2.5d/assets/player/textures/jump.png b/misc/2.5d/assets/player/textures/jump.png new file mode 100755 index 00000000..809467da Binary files /dev/null and b/misc/2.5d/assets/player/textures/jump.png differ diff --git a/misc/2.5d/assets/player/textures/jump.png.import b/misc/2.5d/assets/player/textures/jump.png.import new file mode 100644 index 00000000..bdbb55e4 --- /dev/null +++ b/misc/2.5d/assets/player/textures/jump.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/jump.png-ee91d86ec39d8c1dde239a382e843e86.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/textures/jump.png" +dest_files=[ "res://.import/jump.png-ee91d86ec39d8c1dde239a382e843e86.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/player/textures/run.png b/misc/2.5d/assets/player/textures/run.png new file mode 100644 index 00000000..900742ae Binary files /dev/null and b/misc/2.5d/assets/player/textures/run.png differ diff --git a/misc/2.5d/assets/player/textures/run.png.import b/misc/2.5d/assets/player/textures/run.png.import new file mode 100644 index 00000000..90a63b51 --- /dev/null +++ b/misc/2.5d/assets/player/textures/run.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/run.png-6110949046e0632be1a9b1c8ac504217.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/textures/run.png" +dest_files=[ "res://.import/run.png-6110949046e0632be1a9b1c8ac504217.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/player/textures/stand.png b/misc/2.5d/assets/player/textures/stand.png new file mode 100644 index 00000000..1fbc364f Binary files /dev/null and b/misc/2.5d/assets/player/textures/stand.png differ diff --git a/misc/2.5d/assets/player/textures/stand.png.import b/misc/2.5d/assets/player/textures/stand.png.import new file mode 100644 index 00000000..85253437 --- /dev/null +++ b/misc/2.5d/assets/player/textures/stand.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/stand.png-4d65e60dbd5f40d1f70da6aa2507ebe3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/textures/stand.png" +dest_files=[ "res://.import/stand.png-4d65e60dbd5f40d1f70da6aa2507ebe3.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/Shadow25D.tscn b/misc/2.5d/assets/shadow/Shadow25D.tscn new file mode 100644 index 00000000..cb7e9e81 --- /dev/null +++ b/misc/2.5d/assets/shadow/Shadow25D.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://addons/node25d/Node25D.gd" type="Script" id=1] +[ext_resource path="res://addons/node25d/icons/node25d_icon.png" type="Texture" id=2] +[ext_resource path="res://addons/node25d/ShadowMath25D.gd" type="Script" id=3] +[ext_resource path="res://addons/node25d/icons/shadowmath25d_icon.png" type="Texture" id=4] +[ext_resource path="res://assets/shadow/textures/fortyfive.png" type="Texture" id=5] +[ext_resource path="res://assets/shadow/ShadowSprite.gd" type="Script" id=6] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 0.5, 0.001, 0.5 ) + +[node name="Shadow25D" type="Node2D"] +visible = false +position = Vector2( 0, 22401.1 ) +script = ExtResource( 1 ) +__meta__ = { +"_editor_icon": ExtResource( 2 ) +} +spatial_position = Vector3( 0, -990, 0 ) + +[node name="ShadowMath25D" type="KinematicBody" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -990, 0 ) +collision_layer = 16 +collision_mask = 16 +script = ExtResource( 3 ) +__meta__ = { +"_editor_icon": ExtResource( 4 ) +} + +[node name="CollisionShape" type="CollisionShape" parent="ShadowMath25D"] +shape = SubResource( 1 ) + +[node name="ShadowSprite" type="Sprite" parent="."] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 5 ) +script = ExtResource( 6 ) diff --git a/misc/2.5d/assets/shadow/ShadowSprite.gd b/misc/2.5d/assets/shadow/ShadowSprite.gd new file mode 100644 index 00000000..6cced5ac --- /dev/null +++ b/misc/2.5d/assets/shadow/ShadowSprite.gd @@ -0,0 +1,39 @@ +tool +extends Sprite + +onready var _fortyFive = preload("res://assets/shadow/textures/fortyfive.png") +onready var _isometric = preload("res://assets/shadow/textures/isometric.png") +onready var _topDown = preload("res://assets/shadow/textures/topdown.png") +onready var _frontSide = preload("res://assets/shadow/textures/frontside.png") +onready var _obliqueY = preload("res://assets/shadow/textures/obliqueY.png") +onready var _obliqueZ = preload("res://assets/shadow/textures/obliqueZ.png") + +func _process(_delta): + if Input.is_action_pressed("forty_five_mode"): + set_view_mode(0) + elif Input.is_action_pressed("isometric_mode"): + set_view_mode(1) + elif Input.is_action_pressed("top_down_mode"): + set_view_mode(2) + elif Input.is_action_pressed("front_side_mode"): + set_view_mode(3) + elif Input.is_action_pressed("oblique_y_mode"): + set_view_mode(4) + elif Input.is_action_pressed("oblique_z_mode"): + set_view_mode(5) + + +func set_view_mode(view_mode_index): + match view_mode_index: + 0: # 45 Degrees + texture = _fortyFive; + 1: # Isometric + texture = _isometric + 2: # Top Down + texture = _topDown + 3: # Front Side + texture = _frontSide + 4: # Oblique Y + texture = _obliqueY + 5: # Oblique Z + texture = _obliqueZ diff --git a/misc/2.5d/assets/shadow/textures/fortyfive.png b/misc/2.5d/assets/shadow/textures/fortyfive.png new file mode 100644 index 00000000..ab28eea2 Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/fortyfive.png differ diff --git a/misc/2.5d/assets/shadow/textures/fortyfive.png.import b/misc/2.5d/assets/shadow/textures/fortyfive.png.import new file mode 100644 index 00000000..0a1e44de --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/fortyfive.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/fortyfive.png-efb54d3840c2ab97f9652a523a4e1e58.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/fortyfive.png" +dest_files=[ "res://.import/fortyfive.png-efb54d3840c2ab97f9652a523a4e1e58.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/textures/frontside.png b/misc/2.5d/assets/shadow/textures/frontside.png new file mode 100644 index 00000000..8af59aa7 Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/frontside.png differ diff --git a/misc/2.5d/assets/shadow/textures/frontside.png.import b/misc/2.5d/assets/shadow/textures/frontside.png.import new file mode 100644 index 00000000..f692468b --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/frontside.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/frontside.png-aab37f0cda9f5e8056a5178bf22351fb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/frontside.png" +dest_files=[ "res://.import/frontside.png-aab37f0cda9f5e8056a5178bf22351fb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/textures/isometric.png b/misc/2.5d/assets/shadow/textures/isometric.png new file mode 100644 index 00000000..3b50ae08 Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/isometric.png differ diff --git a/misc/2.5d/assets/shadow/textures/isometric.png.import b/misc/2.5d/assets/shadow/textures/isometric.png.import new file mode 100644 index 00000000..9c56cf1f --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/isometric.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/isometric.png-1a91c869806816b66a8fb886d4801f31.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/isometric.png" +dest_files=[ "res://.import/isometric.png-1a91c869806816b66a8fb886d4801f31.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/textures/obliqueY.png b/misc/2.5d/assets/shadow/textures/obliqueY.png new file mode 100644 index 00000000..f48cf507 Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/obliqueY.png differ diff --git a/misc/2.5d/assets/shadow/textures/obliqueY.png.import b/misc/2.5d/assets/shadow/textures/obliqueY.png.import new file mode 100644 index 00000000..fba37a48 --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/obliqueY.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/obliqueY.png-676e0b47cedb4b1159610d662414d70c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/obliqueY.png" +dest_files=[ "res://.import/obliqueY.png-676e0b47cedb4b1159610d662414d70c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/textures/obliqueZ.png b/misc/2.5d/assets/shadow/textures/obliqueZ.png new file mode 100644 index 00000000..446e9e02 Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/obliqueZ.png differ diff --git a/misc/2.5d/assets/shadow/textures/obliqueZ.png.import b/misc/2.5d/assets/shadow/textures/obliqueZ.png.import new file mode 100644 index 00000000..5daf1a29 --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/obliqueZ.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/obliqueZ.png-95b7e7a176541fda8f2db67045ba0ad7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/obliqueZ.png" +dest_files=[ "res://.import/obliqueZ.png-95b7e7a176541fda8f2db67045ba0ad7.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/shadow/textures/topdown.png b/misc/2.5d/assets/shadow/textures/topdown.png new file mode 100644 index 00000000..5cf9a46f Binary files /dev/null and b/misc/2.5d/assets/shadow/textures/topdown.png differ diff --git a/misc/2.5d/assets/shadow/textures/topdown.png.import b/misc/2.5d/assets/shadow/textures/topdown.png.import new file mode 100644 index 00000000..c618104e --- /dev/null +++ b/misc/2.5d/assets/shadow/textures/topdown.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/topdown.png-967f612d383afa56cee62320ceaf8a99.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/shadow/textures/topdown.png" +dest_files=[ "res://.import/topdown.png-967f612d383afa56cee62320ceaf8a99.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/assets/ui/ControlHints.gd b/misc/2.5d/assets/ui/ControlHints.gd new file mode 100644 index 00000000..5f8d21f7 --- /dev/null +++ b/misc/2.5d/assets/ui/ControlHints.gd @@ -0,0 +1,5 @@ +extends Control + +func _process(_delta): + if Input.is_action_just_pressed("toggle_control_hints"): + visible = !visible diff --git a/misc/2.5d/assets/ui/Overlay.tscn b/misc/2.5d/assets/ui/Overlay.tscn new file mode 100644 index 00000000..311514b8 --- /dev/null +++ b/misc/2.5d/assets/ui/Overlay.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/ui/ControlHints.gd" type="Script" id=1] + +[node name="Overlay" type="CanvasLayer"] + +[node name="ControlHints" type="CenterContainer" parent="."] +anchor_right = 1.0 +margin_bottom = 200.0 +script = ExtResource( 1 ) + +[node name="Label" type="Label" parent="ControlHints"] +margin_left = 348.0 +margin_top = 25.0 +margin_right = 1251.0 +margin_bottom = 175.0 +rect_min_size = Vector2( 500, 50 ) +text = " +Controls: WASD to move, Space to jump, R to reset, Shift to walk, T to toggle isometric controls, C to view cube demo, Tab to toggle hints. + +UIOPKL to change view mode. U = Forty Five deg, I = Isometric, +O = Top Down, J = Front Side, K = Oblique Y, L = Oblique Z + +Not every view mode is meant to be good, it's just to showcase what the system can do. +In actual games, shadows, resizing, parallax, and other hints of depth could be added to make the world seem more 3D. +" +align = 1 +valign = 1 diff --git a/misc/2.5d/assets/ui/OverlayCube.tscn b/misc/2.5d/assets/ui/OverlayCube.tscn new file mode 100644 index 00000000..f64075d9 --- /dev/null +++ b/misc/2.5d/assets/ui/OverlayCube.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/ui/ControlHints.gd" type="Script" id=1] + +[node name="Overlay" type="CanvasLayer"] + +[node name="ControlHints" type="CenterContainer" parent="."] +anchor_right = 1.0 +margin_bottom = 200.0 +script = ExtResource( 1 ) + +[node name="Label" type="Label" parent="ControlHints"] +margin_left = 416.0 +margin_top = 25.0 +margin_right = 1183.0 +margin_bottom = 175.0 +rect_min_size = Vector2( 500, 50 ) +text = " +Controls: WASDQE to rotate, R to reset, C to return to the world, Tab to toggle hints. + +UIOPKL to change view mode. U = Forty Five deg, I = Isometric, +O = Top Down, K = Oblique Y, L = Oblique Z + +Not every view mode is meant to be good, it's just to showcase what the system can do. +In actual games, shadows, resizing, parallax, and other hints of depth could be added to make the world seem more 3D. +" +align = 1 +valign = 1 diff --git a/misc/2.5d/default_env.tres b/misc/2.5d/default_env.tres new file mode 100644 index 00000000..20207a4a --- /dev/null +++ b/misc/2.5d/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/misc/2.5d/icon.png b/misc/2.5d/icon.png new file mode 100644 index 00000000..d8efa1a0 Binary files /dev/null and b/misc/2.5d/icon.png differ diff --git a/misc/2.5d/icon.png.import b/misc/2.5d/icon.png.import new file mode 100644 index 00000000..96cbf462 --- /dev/null +++ b/misc/2.5d/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/misc/2.5d/project.godot b/misc/2.5d/project.godot new file mode 100644 index 00000000..aaa80e97 --- /dev/null +++ b/misc/2.5d/project.godot @@ -0,0 +1,192 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ { +"base": "Node2D", +"class": "Node25D", +"language": "GDScript", +"path": "res://addons/node25d/Node25D.gd" +}, { +"base": "KinematicBody", +"class": "PlayerMath25D", +"language": "GDScript", +"path": "res://assets/player/PlayerMath25D.gd" +}, { +"base": "KinematicBody", +"class": "ShadowMath25D", +"language": "GDScript", +"path": "res://addons/node25d/ShadowMath25D.gd" +}, { +"base": "Node", +"class": "YSort25D", +"language": "GDScript", +"path": "res://addons/node25d/YSort25D.gd" +} ] +_global_script_class_icons={ +"Node25D": "res://addons/node25d/icons/node25d_icon.png", +"PlayerMath25D": "", +"ShadowMath25D": "res://addons/node25d/icons/shadowmath25d_icon.png", +"YSort25D": "res://addons/node25d/icons/ysort25d_icon.png" +} + +[application] + +config/name="2.5D Demo (GDScript)" +run/main_scene="res://assets/DemoScene.tscn" +config/icon="res://icon.png" + +[display] + +window/size/width=1600 +window/size/height=900 + +[editor_plugins] + +enabled=PoolStringArray( "node25d" ) + +[input] + +move_right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null) + ] +} +move_left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null) + ] +} +move_forward={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) + ] +} +move_back={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) + ] +} +movement_modifier={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777348,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) + ] +} +jump={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777350,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) + ] +} +reset_position={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) + ] +} +forty_five_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":85,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777354,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) + ] +} +isometric_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777355,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) + ] +} +top_down_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":79,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777356,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) + ] +} +front_side_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":74,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) + ] +} +oblique_y_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":75,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":4,"pressure":0.0,"pressed":false,"script":null) + ] +} +oblique_z_mode={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":5,"pressure":0.0,"pressed":false,"script":null) + ] +} +toggle_isometric_controls={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":84,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":8,"pressure":0.0,"pressed":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777349,"unicode":0,"echo":false,"script":null) + ] +} +toggle_control_hints={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777347,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":10,"pressure":0.0,"pressed":false,"script":null) + ] +} +move_clockwise={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777359,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":7,"pressure":0.0,"pressed":false,"script":null) + ] +} +move_counterclockwise={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777357,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null) + ] +} +view_cube_demo={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":67,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777358,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null) + ] +} +exit={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) + ] +} + +[rendering] + +quality/driver/driver_name="GLES2" +environment/default_environment="res://default_env.tres"