Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Nice little game you have made. I like your use of the command window, I would really like to know how you implemented it, because I made a similar one in my game, "Digital Haunting" but it was getting very bloated and hard to maintain and I had far less commands.

Also, this is probably not too much of a bug and more of a conflict with WebGL and browser behaviour but I noticed that when playing on your web build, that when I went to crouch and move forward into the vent, the shortcut for closing tabs would activate (CRTL + W). The only quick fix I can think of is making the crouch button toggle-able. That way, player's aren't holding two buttons down at once.

(+1)

Oh I'll keep that in mind next time, didn't know that shortcut haha.

Just played your game and yea it's pretty cool how we had a similar game mechanic idea. As for how I implemented it, it's not my best code haha. Behind the ui is a single input line and a textbox is displayed on top which the user sees, the label text is just appended to the textbox. When the user submits the text the string is split by whitespaces into an array, it then goes to a long if elif chain checking the arrays first value for a valid command and then the second value for a valid filename if that function accepts a second value. For the folder directory structure that enables you to use cd to move around, its pretty basic. It's just a dictonary of strings that contain dictonaries of strings, whenever you move directory path its actually modifying an array storing or discarding the strings to your path. Using that array and a for loop it's able to see whats inside your current directory.

I hope I've explained it well cause I'm not the best communicator lol, the code itself is very messy and would be a pain to add more commands so next time I gotta work on doing more sustainable code haha.

(+1)

Thanks for the explanation Caduckic, I think you explained it quite well. My UI was very similar to yours but rather than a text box I kept adding Label elements in a vertical container (VBoxContainer in Godot I think). The text was just an array where each element was a new line of text. In code it looked like this:


'NEW_LINE' = "" (an empty string). Comments also show the chars for each line as I didn't want to hit the edge of the screen.
This was just for the 'help' command without any variables. Now imagine the match statement within a match statement when there is a variable for the 'help' command. That's why I just returned a 'not implemented' string  instead haha.

It's funny but I think the only thing we did differently was how we handled displaying the text haha. It's reassuring to know that someone else has the same ideas and not everything feels like a hack.