Share your repls and programming experiences

← Back to all posts
A small console game in C#
JacobMcPherson1 (237)


I know its really bad but please don't judge me I just started learning C#
use wasd to move also you DIE if you go out of bounds totally wasn't just to dumb to make collision

IntellectualGuy (822)

Here I have an idea for another map

|Ø   |   |  ______ |
|  | | | | | ___ | |
|  | | | | | |o| | |
|  | | | | | |___| |
JacobMcPherson1 (237)

@IntellectualGuy If I had a more efficient way of making maps I would add that

darkdarcool (130)

Nice! You should make more levels(plus make the player blue and bold and the goal green so It is easier to see)

JacobMcPherson1 (237)

@darkdarcool I'll try to do that sometime! Thanks for the suggestion

CookieSnowOwl (41)

I think it would've been much easier to use functions... but very good :O

JacobMcPherson1 (237)

@CookieSnowOwl I made a new version that has 3 levels and uses modules (the C# equivalent of functions)

MatthewWesolows (10)

An idea to make the grid system more efficent is to store the layout in a 2-Dimentional array. Then create an array that had the players cordinates. Loop through the 2-Dimentional array and print the layout character by character, if the players position is on a space, then print the character, if it is on a wall, end the game. This makes it easy to make new maps and will really shorten your code. I can try to make an example, but I haven't coded C# in a while. Will post my example when I have time to make it ;).

JacobMcPherson1 (237)

@MatthewWesolows I would really appreciate it if you made a small example thanks! And once I repost this but with more levels I'll give you credit :)

MatthewWesolows (10)

@JacobMcPherson1 finished! I commented a bunch on it so hopefully it won't seem too confusing :)
(it should be shared with you)

MatthewWesolows (10)

@JacobMcPherson1 Sorry for bothering you again, but I made some changes to the code to make it more efficient. If you caught me in the middle of that I apologize. Ill leave you to the code now. Let me know any questions you have :D

JacobMcPherson1 (237)

@MatthewWesolows That's ok, also thanks for making that for me, it really means a lot. Thanks!

IntellectualGuy (822)

Also I might be able to help with this and make it more advanced, can you add me to the repl?