Edit of asset "2.5D Game Demo" Accepted
Old/Current | New/Edit | |
---|---|---|
Title | 2.5D Game Demo | 2.5D Game Demo |
Description |
This demo project shows a way to create a 2.5D game in Godot by mixing 2D and 3D nodes. It also adds a 2.5D editor viewport for easily editing 2.5D levels. How it works: 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 3D Spatial, which is used to calculate its position. Then, add a 2D Sprite (or similar) to display the object. Inside of Node25D, a 2.5D transformation matrix made of three `Vector2`s is used to calculate the 2D position from the 3D position. For getting a 3D position, this project uses CharacterBody3D and StaticBody3D, 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. 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 sprites to display that object in 2D. The plugin also adds YSort25D to sort Node25D nodes, and ShadowMath25D for calculating a shadow (a simple CharacterBody3D that tries to cast downward). Language: GDScript Renderer: Compatibility |
This demo project shows a way to create a 2.5D game in Godot by mixing 2D and 3D nodes. It also adds a 2.5D editor viewport for easily editing 2.5D levels. How it works: 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 3D Spatial, which is used to calculate its position. Then, add a 2D Sprite (or similar) to display the object. Inside of Node25D, a 2.5D transformation matrix made of three `Vector2`s is used to calculate the 2D position from the 3D position. For getting a 3D position, this project uses CharacterBody3D and StaticBody3D, 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. 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 sprites to display that object in 2D. The plugin also adds YSort25D to sort Node25D nodes, and ShadowMath25D for calculating a shadow (a simple CharacterBody3D that tries to cast downward). Language: GDScript Renderer: Compatibility |
Category | Demos | Demos |
License | MIT | MIT |
Repository Provider | Custom | Custom |
Repository Url | https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/misc/2.5d | https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/misc/2.5d |
Issues Url | https://github.com/godotengine/godot-demo-projects/issues | https://github.com/godotengine/godot-demo-projects/issues |
Godot version | Godot 4.2 | Godot 4.2 |
Version String | 4.2-31d1c0c | 4.2-31d1c0c |
Download Commit | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/misc_2.5d.zip | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/misc_2.5d.zip |
Download Url (Computed) | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/misc_2.5d.zip | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/misc_2.5d.zip |
Icon Url |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/misc/2.5d/icon.webp
|
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/misc/2.5d/icon.webp
|
Preview Insert | ||
---|---|---|
Type | image | |
Image/Video URL |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/misc/2.5d/screenshots/forty_five.png
|
|
Thumbnail |
|
Preview Insert | ||
---|---|---|
Type | image | |
Image/Video URL |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/misc/2.5d/screenshots/cube.png
|
|
Thumbnail |
|
Preview Insert | ||
---|---|---|
Type | image | |
Image/Video URL |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/misc/2.5d/screenshots/editor.png
|
|
Thumbnail |
|