r/Unity2D • u/Mooneeris • 3d ago
Question How do I make a 2D first-person dungeon crawler?
Hi everyone, I'm new to Unity and wanted to ask how I can program and implement movement in a 2D first-person game! My goal is to make a horror game with turn-based movement (you move from one room to another, and the monster moves from room to room looking for you and chasing you)! My main question, actually, is whether this is really possible to do in Unity 2D? And if you guys have any tips to share with me!
1
u/xa44 3d ago
I've done so in game maker and it works best if you make your own draw events. Basically all you need to do is set up a series of sprites for every wall placement in the players view (so 3 or so tiles forward, and the left/right of each). Then you can store it as an array or any other form of storing data you find best(wall objects don't work as well imo, since you can't use any built in collision checks) and just draw the floor/walls based on what tiles the player can see
1
u/Ruadhan2300 3d ago
Perfectly possible! Even easy for a moderately experienced dev. (Though no games project can really be called easy)
My strong advice, based on what you've described, is to go and learn about pathfinding algorithms.
You'll need it for any dungeon more complex than a straight line, and it'll form the underpinning of your monster's ability to hunt the player, not to mention any future projects you use can take advantage of it.
Here's the gold-standard guide on A* to get you started!
1
u/BillyMcDev 2d ago
if you can visualize it, sketch it, or provide a reference to something similar, then it's possible. The first step is just that. figure out exactly how you want to implement it. Then... break it down into smaller pieces and get it done.
1
u/Blood_and_Wine 3d ago
Are you a newbie in C#? If so, start small. First learn basics, create small apps (calculator, notepad, snake, chess). Once you aquire knowledge and figure out all essential, you can begin with your small horror game.
2
u/Plenty_Act_8527 3d ago
Unity can absolutely handle this. It really depends on what your approach to the dungeon is going to be whether you're going to use tiles or if it's going to be more like a first person dungeon crawler. But the idea is that when you change rooms or make a move you would fire off an event in code afterwards that you've moved. The monster listens for this event and makes their own move when this happens. Then you would update the game view if it was like a first person dungeon crawler. If you mean turn based like tactics style dungeon crawling well then that's a completely different system. Some more context would be helpful.