My Game Dev Story

Updated on December 28, 2016 in [D] Stories
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
11 on December 27, 2016

So… It’s started about a month ago, more as a try-out. Now, I kinda wanna take it seriously. I watched like 3 of the C# tutorials from brackeys, here’s something I could come up with 😀

I’m not even sure if everything is done the ‘right way’, or the easiest way, but it all works! 😀

What this does, is first ask you your username. (And it pretty much does nothing with that information, it’s just there to be there :D)
Then, it asks you for a password. (Again, does nothing with that information)
And then, it asks you for your age. If you are 12 and under, it wouldn’t allow you to open that game,
if you’re 13 and over, it would.

Again, this is inspired by an idea I have, which i posted some time ago 😛

Here’s the code (Console Project)

 using System;
 namespace CSharp
 {
 class Program
 {
 static void Main(string[] args)
 {
 string _user;
 string _pass;
 int _age;
 Console.WriteLine("Are you the... Yeah, you're the new one. Come here, soldier. \nI'm gonna need you to choose a username! It cannot be changed later on, you're gonna be busy with your missions. \nType your new username in here: ");
 _user = Convert.ToString(Console.ReadLine());
 Console.WriteLine("Good. Good... Now, pick a password, you're gonna need one soldier. \nAnd... don't make it too obvious, and dumb. You don't want anyone pretending to be you. \nWhy would they anyway? Uh, anyway! Type your new password here: ");
 _pass = Convert.ToString(Console.ReadLine());
 Console.WriteLine("Ok, now... How old are you? Be honest, soldier. You wouldn't want your childhood ruined. \nType your age here: ");
 _age = Convert.ToInt16(Console.ReadLine());
 {
 if (_age <= 12)
 {
 Console.WriteLine("Oh... Uh. Well, that's... I guess you gotta wait some time to become a real man... \nI look forward to teach you soldiering, and stuff. I think. \n(I need to get paid more...)");
 }
 else
 {
 Console.WriteLine("Great! Welcome on board, soldier! I look forward teching you how to be a real man!");
 }
 }
 Console.ReadKey();
 }
 }
 }
 

I know this is no magic, some of you may be cringing. Tht’s fine I guess 🙂
Everyone has to start somewhere, even such a legend like me.

  • Liked by
Reply
0 on December 27, 2016

There is no ‘right way’ to do anything. Some ways are better and easier than others, but there is no right way you have to follow.

Although there is a rule you always have to keep in mind, which I see you didn’t follow: If you don’t need something, don’t do it. It’s a waste of time and lines of code. You even get warnings when there are unused and unassigned variables, because it’s bad practice.
If you didn’t do anything with the username and the password, why have them there?

  • Liked by
Reply
Cancel
4 on December 27, 2016

As Aviram said, you’re not using the strings you’ve created. So create an actual login/signup application that compares the username and password that has been established during signup, if it checks out the game launches.

Your code is never finished if it can be a little more 🙂

Devoted
on December 27, 2016

FFS, my first name is Or, not Aviram. >_

Wise
on December 28, 2016

I couldnt read your comment, what was that you said, Aviram?

Devoted
on December 28, 2016

I said that my name is VramVram. Please call me VramVram, not Aviram, and not Or.

EDIT:
Or Supergod, this is another good name.

Wise
on December 28, 2016

Sure thing, VramVram

Show more replies
  • Liked by
Reply
Cancel
4 on December 27, 2016

I don’t know if I mentioned, that this is my first kinda “serious” console application. And when I say serious I don’t mean ‘good’. It’s something that I did right without any major errors 😛
The ‘username’ and ‘password’ are there more for effect, I will be sure to work on it 😛

I basically made that just because I wanted to even though I know it’s totally useless. And I know it could be better and actually more useful. I hope I’m gonna get there. 🙂

Helpful
on December 27, 2016

If it’s totally useless then you make it useful!
You have the power to do that.

on December 27, 2016

That’s what I plan on doing 😛

Devoted
on December 27, 2016

The rule is just that if something is useless (and I mean complete useless, like an unused variable, and not “useless” like a program none will use), it’s best not to do it, or it will make confusion. I thought about something like deleting the username and password part, but if you have something to do with them, then go ahead, but if you don’t deleting them would be the best.

on December 27, 2016

I mean I do have some few ideas so I will keep them.

And yeah I already knew that if I don’t use a variable completely I should just remove it, kinda obvious. Thanks for the advice though 😛

Show more replies
  • Liked by
Reply
Cancel