Share your repls and programming experiences

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

THIS IS REALLY BAD LOL

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

Comments
hotnewtop
IntellectualGuy (691)

Here I have an idea for another map

____________________
|Ø   |   |  ______ |
|  | | | | | ___ | |
|  | | | | | |o| | |
|  | | | | | |___| |
|__|___|___|_______|
JacobMcPherson1 (194)

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

darkdarcool (100)

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

JacobMcPherson1 (194)

@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 (194)

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

MatthewWesolows (9)

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 (194)

@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 (9)

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

MatthewWesolows (9)

@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 (194)

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

IntellectualGuy (691)

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