- Home /
making a 2d maze game
Hello i am trying to build a 2d maze game. It should be level-based so if you complete level 1 you must move to level 2. I made my own level in photoshop, its pixelated and dont have stright walls (pixel art). Now here the problem comes: its very hard to manually add box collider to every wall, plus i also have different structures like sun etc. Isnt there a method to do this? like selection etc.? here are my levels: https://ibb.co/G52Y32G , https://ibb.co/JsFTB0p , https://ibb.co/0ZmgmsJ ,
Answer by JonPQ · Jul 08, 2019 at 03:51 PM
Usually, you wouldn't draw a whole level in photoshop.... you would make small "Tiled" sections that are stitched together in the game using a tool of some sort. Then you only have to add the collisions once per tile. Go to the asset store and search on something like tile mapper, map tile tool, or something like that.
or look into Unity's Tilemap https://docs.unity3d.com/Manual/class-Tilemap.html
some games that need pixel collision ( worms, lemmings ) might sample the pixels in the texture and use those directly as colliders (for a 2D game)
Answer by promant12 · Jul 08, 2019 at 04:03 PM
You can use PolygonCollider2D and then slightly edit it. Not a big deal.
how am i going to edit level 3? polygon collider2d is covering the whole level and inside is a web
Your answer
Follow this Question
Related Questions
Boxcollider2d sinks into Ground when falling on a non straight surface 0 Answers
Is there a way for 2D Box Colliders to ignore another? 4 Answers
I drew a 2d Maze. How to collide with walls. 1 Answer
No Collision in 2d Scene 0 Answers
2D box colliders not touching but are colliding, how to fix? 0 Answers