Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunsided/zenva-puzzle-platformer
A puzzle platformer experiment in Unity2D
https://github.com/sunsided/zenva-puzzle-platformer
mini-degree platform-game unity unity2d zenva
Last synced: about 2 months ago
JSON representation
A puzzle platformer experiment in Unity2D
- Host: GitHub
- URL: https://github.com/sunsided/zenva-puzzle-platformer
- Owner: sunsided
- Created: 2019-09-09T20:35:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T20:38:09.000Z (over 5 years ago)
- Last Synced: 2024-11-09T08:13:35.227Z (3 months ago)
- Topics: mini-degree, platform-game, unity, unity2d, zenva
- Language: C#
- Size: 190 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Industrial Jones
![](.readme/editor-1.png)
Note that this is not a complete game (although it does come with a
complete set of levels). Some final tweaking and bug fixing is required
to actually make this work.## Lessons Learned
- When working with sprites, have a `Sprites` asset folder with a
`Tiles` subdirectory. The sprite images (PNG, etc.) are going to be placed
in the `Sprites` directory, while the tilemaps and tiles generated from it
are going to be placed withing `Sprites/Tiles`.
- The Sprite Editor allows the placement of a custom "Physics Shape" that defines
the shape of the collision polygon. To update the collision shape on tiles that
are already placed, the collider needs to be disabled and re-enabled.
- Instead of changing the physics shape to a rectangle in the sprite editor,
it might make sense to set the sprite's collider type to `Grid` instead (from the
default of `Sprite`).
- The ladder sprite had its shape auto-generated and contained holes,
which was fixed manually by removing some vertices from the shape polygon
in the Sprite Editor.
- In the Editor, an Icon gizmo can be assigned to any game object
In 2019.3.0b2 this is done by clicking on the icon next to the active/enable
checkbox in the Inspector. In the screenshot above, the waypoints for the
sawblades are using label icons as gizmos.
- Using different tilemaps for different purposes works pretty well:
Background tilemaps don't use a collider, while "Ground" tilemaps can;
tilemaps can be assigned to different _layers_ for collision checks.
- The "Hazard" tilemap used in this game is used for hazard objects such
as acid/poison and spikes; it is on the "Hazard" layer and uses (composite) colliders.
- The "Climbable" tilemap (on the "Climbable" layer) is used for ladders;
tiles here have (non-composite) tilemap colliders that are configured
to be triggers.
- Collisions with the hazard layer are checked by comparing to
`other.gameObject.layer` in the `OnCollisionEnter2D()` method.
- Using a Rigidbody 2D with a body type of `Static` results in discrete
collisions that can result in objects moving "into" the collider when
they are too fast. Due to this, the player character can get stuck in
the ground when falling. Switching the body type to `Kinematic` and
setting the collision detection to `Continuous` (from the default of
`Discrete`) fixes this issue.
- Portals are being used to teleport the player from one scene to another.
In this case, `PlayerPrefs` are used to store the ID of the portal to
move to, and the player is being spawned at the stored position upon
loading of a scene.## Things to learn
- Right now, the invisible ladder top platform needs to be placed manually.
This is an issue, because the tile is placed on the grid, while the platform
is added manually afterwards. Apparently custom brushes can be used to automate
this behavior, such that the platform would be added, whenever a ladder top
is being painted.
- Right now, each scene duplicates the game manager, HUD, etc.
Instead, investigating into additive scene loading may be worthwile.