hi guys^^ i always wanted to program and since so many of you talented bros here make games could anyone of you teach me programin ya know like c++ or c# or anything to make games? :pinch:
can anyone teach me how to program?
The forums have been archived. Please read this thread for more information.
-
-
I suggest you search for a coding forum or follow a beginners tutorial on some sort of website , you can easily google it.
-
Kneesocks wrote:
I suggest you search for a coding forum or follow a beginners tutorial on some sort of website , you can easily google it.
Before I Google it, do you have any suggestions? -
Programming is actually one of the harder aspects to learn at first, but once you get passed the basics it's rather easy from there. You're going to have to be able to understand functions. Depending on what game engine you're using, there may be a different language used. For example, here's a little snip of coding from an amnesia custom story:
Display Spoiler void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("HallucinationBro", true);
ShowEnemyPlayerPosition("HallucinationBro");
SetPropHealth("BroDoor", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
What that code does is upon picking up a key, it activates a Grunt, which I've named "HallucinationBro". It then sets the grunt's AI to automatically lock on to the players position, allowing the grunt to run after the player. I set the door's health that the grunt is behind to 0 upon pickup that way as soon as the key is picked up, the door will explode, giving the impression the grunt broke it. As that happens, the proper sounds will play to scare the player, and sanity damage will be given.
Now here is an example of coding for a C# version of Space Invaders, in which I made a Halo version of the game:
pastebin.com/uihBTQNW
It was posted as a link because the site doesn't like to work well with code input. But what this code does is makes the enemy's projectile, in this case the Grunt's, start of as invisible until the enemy fires. (represented by myAlive = false; ) Then once the enemy fires, the projectile becomes visible (represented by myAlive = true; ). If the projectile misses and goes off screen (represented by if (myPosition.Y > myGame.Width) ), then the projectile becomes invisible again and returns back to the original entity position (represented by myAlive = false; and return; ). If the projectile hits (represented by if (this.CollisionBox.Intersects(myGame.player.CollisionBox)) ), then it becomes invisible and the player dies (represented by myAlive = false; and myGame.player.Death(); ).
Coding can be very complicated and frustrating at times. Basically it's an if, and, and but type of thing. If this happens I want it to do this and this, but if this happens I want it to do this. It is very time consuming. I have around half a year's worth of knowledge from my college classes so I'm still learning myself. Your best bet is either look into college for game development once you're old enough to, or search around online for tutorials and such. Good luck, and I hope this gave a bit more insight on what coding will be like! -
Personally, I'd suggest starting with C#, as its syntax is very similar to Java and very easy to work with. Also, with C#, you have garbage collection to clean up things for you, and you can't make mistakes that can seriously harm your computer while learning (really, you'd be surprised how much damage you can do with C/C++!)
Maybe I'll write some C# tutorials for getting used to it.. but there's certainly quite a few already out there. It'd be nice if you kept us updated on your progress in off topic or something, though. -
I have to agree that C/C++ can be harmful for your pc if done wrong , so I suggest to run it on a sandbox enviroment to see what it executes etc.
-
The EASIEST way to begin game making would be learning GML. Game Maker Language.
It's THE easiest possible way to start your journey on games. Once you master this, you can easily switch over to another language.
Click here to download
If you need any help with it, just ask. :3
*brofist* -
Having used GameMaker since the very early years when it was still completely maintained and owned by Mark Overmars, I know the old GML fairly well. While it's true that, in a way, it is a very good primer to the ideals and syntax, etc of programming, it does leave out some very important things. I'd have to ask that, before ANYONE learns to program, they understand the computer first. Understanding the framework between a program and the CPU, Memory, Storage, etc is very important for anyone in programming, but very much so for those in game programming. Ask any programmer and he'll tell you, game programming is one of the hardest, if not THE hardest forms of programming that you can run into. You're not going to have to master the computer and how it works like people did back when they used languages like Assembly, but having a solid foundation of the CPU and Memory would be a great start. Simple thing like, for example, how much memory certain types take: (using C# types as an example)
[Remember that one byte = eight bits]
byte = 1 byte (8 bits)
short = 2 bytes (16 bits)
int = 4 bytes (32 bits), sometimes 8 bytes (64 bits)
long = 8 bytes (64 bits)
And so forth. This isn't as much of a worry as it used to be, since, instead of a few MB of memory, the normal PC these days has a few GB to spare. But we do have to remember that most all games depend on loops, and almost every game contains a "main loop". If we're doing something that say, allocates an extra 100KB of memory each iteration, every 10 or so iterations would store 1 MB more into the memory. And while GC (Garbage Collection) will usually handle this, there are occasions where it will not. Not even taking into account languages like C which do not have a GC procedure, so you can easily fill your PC's entire memory in a few seconds at most.
Leaving behind these common mistakes, there's actually a lot to worry about in game development. It's fine and all to start with GameMaker, I messed with it way back, but don't go thinking it's an actual primer on real-life programming! -
thx for replaying everyone im 8th grade and just do stuff in quick basic.my teacher said that it's good for getting into proggraming
-
QBasic is a wonderful way to start, actually. I remember playing with it when I was younger and it proved quite helpful in introducing my to the concepts of programming. Good luck
-
thx
-
Might I suggest Code Hero? primerlabs.com/codehero It teaches you how to code while playing a game. It's very interesting. I believe it teaches you how to use Unity which is what the game Slender was made with.
-
thx i have unity so this will be usefull
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0