I'm trying to make my own dungeon crawler RPG console-based game.
Here is my code: -------------------------------------------------------------------- using System;
namespace mainProject { class mainClass { public static void Main(string[] args) { Random numGen = new Random(); int rand1 = numGen.Next(1, 5); int rand2 = numGen.Next(1, 5); int plyPOSX = 2; int plyPOSY = 2; string movement; int item = 8; int playerHealth = 5; int width = 5; int height = 5; int[,] grid = new int[width,height];
you literally have no reason to use goto in languages with procedures/functions (unless you need to jump between cases in switch statements)
Nathaniel Nguyen
>You may highlight syntax and preserve whitespace by using tags.
READ THE FAQ.
Xavier Bennett
>all this indentation level JUST to have a main
so.. THIS is the power.. of C++++
namespace mainProject { class mainClass { public static void Main(string[] args) { /* code here*/
Nicholas Jones
Oh fuck off. goto has legitimate uses but this is not one if them
Adam Richardson
The game is incomplete. This is just a test and I am a beginner to C#. Please deal with me fairly.
It's a 4x5 grid map, the player spawns right in the middle, an item spawns randomly everytime the code runs.
The movement keys wait for user input (WASD), then it adds and subtracts player coordinates and refreshes the grid to see that the player has moved.
The player poses as the digits 0-5 which represents both the player and his health. I'm planning on to create an enemy or a hurt zone to test it out.
The problem is, the grid stays invisible after user input.
William Cox
>goto in any high level language Shiggy
Justin Scott
>Please deal with me fairly. This is fucking Jow Forums. You didnt even read the FAQ. Why should we bother with this shit?
You're lucky we're even replying.
Lucas Brooks
>"you literally have no reason to" >proceeds to give at least one (1) valid reason
Angel Howard
I was expecting guidance, dickheads. Be a decent human being and help me out.
Colton Allen
>I was expecting..
We were expecting YOU to read the FAQ as a completely brand new user. You can barely fucking reply.
Be a decent human bean and read it you tard.
Alexander Jones
Alright, now I think you’re trolling
Elijah Bailey
The only thing you should expect is to be cursed at or ignored. Do ask yourself why people should help you at all though with this attitude "help me dickhead"
Jaxson Torres
Perhaps change WASD to lowercase characters
Nathaniel Thompson
just plugin the pocculant refurberations
Levi Nelson
don't listen to this guy, change to arrows keys. That should solve the problem :^)
Caleb Thompson
>Do ask yourself why people should help you at all though with this attitude "help me dickhead" --------------------------------------------------------------------- my attitude? look what this guy said first... --------------------------------------------------------------------- >Kill yourself
Jose Peterson
user I suggest you learn about while loops. You seem to understand for loops just fine, so I don't see any reason why you wouldn't pick them up quite quickly
Okay I will deal with you fairly. Please continue learning C# and learn to use code tags before you come back. People are being mean to you because you are using the language in a procedural way and will not work as your game grows. It shows that you are asking for help before taking the effort to learn the language. This would be acceptable if you were programming in 6502 assembly or BASIC, but not C#.
Once you have a better grasp on C#, rewrite all of your code. You have not written very much.
Sebastian Cook
dont you mean E?
Jaxon Taylor
it's you.
Charles Cruz
Did this work, user? I’m having the same problem
Colton Rivera
why don't you just use functions? What's the point of using an Object Oriented language when you are gonna code like you are in assembly?
Elijah Johnson
You're telling me, that you (not OP), are having exactly the same problem as OP, with his specific problem.
Show us your code using code tags O- I mean not-OP.
Wyatt Harris
You wouldn't have these problems if you just used functions.
Brody Roberts
I have switched "for" to "while". It does not work as I expected. For some reason, the grid won't show up anymore.
> Please continue learning C# and learn to use code tags before you come back I've just finished learning Arrays and this grid scroller idea came to me. I did what I could with what I've learned so far. If you know C# so much, why can't you just help me out instead of being so prideful of your intellect that even I can't talk to you cause I'm not on your level? Bitch.
Nathaniel Harris
>If you know C# so much, why can't you just help me out instead of being so prideful of your intellect that even I can't talk to you cause I'm not on your level? Because you refuse to read the FAQ and use Jow Forums etiquette. Stop wasting our time, delete the thread and post it again using code tags.
Connor Anderson
>Perhaps change WASD to lowercase characters I thought switching to lower case characters would've fixed it too. I did, and it resulted the same thing.
Charles Torres
>What's the point of using an Object Oriented language Actually whatsapp exactly ist Thema pointiert compared total Script language like js
Isaiah Green
Fuck off OP.
Jaxson Morgan
>Perhaps change WASD to lowercase characters It worked! I changed ReadKey(); to ReadLine(); and changed to lowercase characters!
Josiah Richardson
thank you for this wasted trips you fucking german autocorrect.
So again: >What's the point of using an Object Oriented language Actually what exactly is the point compared to script language like js, python or normal stuff like c?
Austin Green
>Bitch. take a bath OP, you stinky
Zachary Torres
using System;
namespace mainProject { class mainClass { public static void Main(string[] args) { Random numGen = new Random(); int rand1 = numGen.Next(1, 5); int rand2 = numGen.Next(1, 5); int plyPOSX = 2; int plyPOSY = 2; string movement; int item = 8; int playerHealth = 5; int width = 5; int height = 5; int[,] grid = new int[width,height];
>Here you go, fags. >can´t read the faq >tries to be superior Fuck off and learn how to use functions.
Camden Peterson
Post it on stack overflow if you don't know why you should be using functions as opposed to GOTO statements.
They'll school you.
Lincoln Brown
>This car is incomplete >Holds up rock
Charles Morales
I'll give you a honest tip. Read about classes and methods. You shouldn't have any function longer than 5-7 lines. Main function should probably have up to 2 lines. A class shouldn't do more than one thing. Rewrite it into proper program, and you will probably be able to easily debug it yourself. This, and any other future problems. If you don't know where to start, read "Clean Code" by Robert Martin. I'm not even doing this to spite you. You'll thank me later if you actually do this.
Asher James
What do you mean it doesn't loop? it doesn't start or something? or just iterates once?
Kayden Nelson
>Wants to learn C# >Insists on using gotos >Insists on using gotos to make a game This is a recipe for disaster, friend.
and , and everyone else telling you to use functions are giving you good advice. It will make things way easier for you going forward.
>I've just finished learning Arrays Learn more of the language, and more about programming for that matter, before attempting to make a game. Games are the shittiest, least fun things to make and it's apparent that you're a newbie programmer. Use Stack overflow, or codecademy, or wherever the hell you prefer to learn things online. It'll save you a lot of trouble later on.
Jose Walker
>You shouldn't have any function longer than 5-7 lines t. Pajeet whos never worked on anything but helloworld programs.
Do NOT listen to this guy, except for: >Read about classes and functins
Ryan Clark
> You shouldn't have any function longer than 5-7 lines wut
In all honesty the program should run but OP is useless and doesn't even give the output, he just wants us to figure out everything.
David Perry
It's so funny when nublets get butthurt when no one will just fix their horrendous code.
Protip: your approach is so out of line with how anyone would solve your problem that spoonfeeding you is the worst possible thing any of us could do
Zachary Parker
how about reading you code one step at a time regardless of what you "expect" to happen. also not you personal tech support or smthng idk just read the sticky
Joshua Morris
So... Is this your fist day here or what?
Aiden Perez
unironically, this
Caleb Gonzalez
robmiles.com/c-yellow-book/ Read this. I'm not going to get my hopes up seeing as you didn't read the FAQ though.