Share your repls and programming experiences

← Back to all posts
Procedural dungeon exploration in the console using C++
h
SPQR (379)

A sneak peek at my current project.

Current features:
-non-blocking unbuffered console I/O
-Display class to handle treating console as a screen and characters as pixels
-Level class which handles the world space, supports negative coordinates, and can be expanded dynamically
-Room class
-Entity and Player classes

Planned features:
-Item and inventory system
-Enemies
-Combat
-HUD
-Objectives / quests
-Perhaps even multiplayer

Controls: W/A/S/D for movement, Shift+X to stop the game (mostly for debug reasons)

Commentshotnewtop
mkhoi (191)

Nice, i can't wait for more things to be added

CullenDAvello (18)

@SPQR this could be really useful for my “heed the dungeon” game

CullenDAvello (18)

@SPQR the procedural generation part

SPQR (379)

@CullenDAvello That makes sense. Pretty much all of the procedural generation stuff in my code is in level.hpp, and I'll link you to the Wikipedia article i looked at for the maze algorithm in a minute :)

CullenDAvello (18)

@SPQR thanks but I don’t know if I’m going to pick it up again, I’ve thought of a few game ideas, and there’s one i thought of called “The Destroyer” and literally all you do is fight epic bosses back to back. Unfortunately i have no idea where to start...

CullenDAvello (18)

@SPQR preferably the menu, but I don’t know how yet, and ill probably look it up later I’m too lazy right now

CullenDAvello (18)

@SPQR lol just gave you 5 upvotes

SPQR (379)

@CullenDAvello I would start with gameplay before you get into menus and everything, one of the common mistakes for solo game devs to make is to work on a wide range of features before making sure there's a playable demo to keep it interesting to work on.

SPQR (379)

@CullenDAvello I've been working on the Dungeon Crawler project for weeks and I'm just now starting to add GUIs

CullenDAvello (18)

@SPQR lol 3 more upvotes. I need help with sprites n’ such, like how to use them give them animations (breathing, slashing, dodging, etc.) i looked at one of your games and it pulled it off wonderfully but i have no clue how it works, or what format the files need to be in etc.

CullenDAvello (18)

@SPQR also images, i know how to make a png file in repl but how do i draw it on screen

SPQR (379)

@CullenDAvello In order to use animations, you essentially have to change the sprite once an interval of time (usually a tenth to a quarter of a second). I did it by having a spritesheet texture and changing the portion of the texture that was used for the player sprite about 5 times a second, give or take.

SPQR (379)

@CullenDAvello and in order to draw a png on screen you must load it as a texture, create a sprite using that texture, and draw the sprite to the screen.

CullenDAvello (18)

@SPQR yeah that’s the thing i know what to do but I don’t know how to do it

RobertFurr (20)

My friend is making an infinitely generated text adventure world using Python. It's top-secret, so I'm not telling you who he is.

CowNationz (40)

Nice, I really like the display class and the use of getch. One suggestion is you should look into deltatime because right now movement speed is based on the FPS.

SPQR (379)

@CowNationz That's a very good point, however I have implemented an input queue rather than movement based off passage of time for two reasons:
1. Due to the nature of the game, position is based on ints rather than floats and I feel like because of that that movement based on elapsed time would be inefficient in this case
2. The input runs in in a separate thread from the main processes and the display so i think that it would be a bit over complicated to implement time-based movement with that in mind.

Thanks for bringing it to my attention though :)

Highwayman (15)

Amazing! Love the map too, it’s really fun.

Highwayman (15)

quick question: why are you using both header guards and pragma once? How are they different?

SPQR (379)

@Highwayman As far as I know they're the same, I use them both just because there's really no reason not to.

Highwayman (15)

@SPQR oh. Alright, thanks! :)