How to code a basic game ..

Started by
19 comments, last by kimi 17 years, 4 months ago
Quote:Original post by NIAB
well, isnt C++ used in major games coded today?
Yeah, but that's not the point. The point is that graphics programming in C++ can be quite difficult if you're new to the language or (more particularly) programming in general.

Anyway, as I mentioned before, you just need to pick a platform and API and get started. Factors in this decision would be what type of games you're interested in (2D? 3D?), and whether you're interested in cross-platform development.

For your original example of an asteroids game, OpenGL might be a good bet (perhaps along with GLUT or SDL).
Advertisement
I still think you would be better off downloading something like the free visual studio and playing around with a Windows Forms Application. You don't need to know much a lot about functions and classes to use it and most of it is visual other then the events. Jumping into something like Directx is very difficult as I'm trying to learn how to use it right now. I'm certain you could make a simple game just using the basics that come with visual studio. You just need to know some basic coding to mapulate your objects with events. For example you could do something like this

this->picturebox1 = this->picturebox1->location(this->picturebox1->location.X +3, this->picturebox1-location.Y) This would move the picturebox1 +3 on the form if you put it under a click event.
Since you seem to not understand how complicated programming is and how it is connected to the word of game development I suggest you try out the FAQ of the site.

You first need to decide on which language you will learn (have to do that first) how to program.A nice language for a beginner is Java.You can find many nice books on it or even ebooks or tutorials.

AFTER you do that you could go check this space invaders tutorials which pretty much explains everything you have to do step by step to program a space invaders-like game in Java.

As someone in the forum already said you gotta learn to walk first before you learn how to run , and that is what we are here to help you with :)

P.S.:Anyone seeing this know of a similar tutorial for C++ space invaders-like game coding? Would like to have at least one in my bookmarks.
&#106avascript huh? oh, and i do understand how hard coding is,<br>im not saying its easy, basic dose not mean like, simple 4<br>lines, just as simple as C++ can get.<br><br>as of java, ill look into that, thanks :D
And one more thing , java and &#106avascript are two total different things :)
my friend, I think you need to do a little more research before tackling this objective of yours. First, you need to know how to program. you can't get anywhere without it, you have to start at the pure basics and understand it otherwise you'll get 90 errors and have no clue how to resolve and worse, why and where it's occuring. I personally learned how to code in VB. I like the language I suggest you start there, it can do Direct X so you have room for improvement but for soemthing like astroids, you can just use the windows picture classes and such. Easy language to learn. it'll protect you a lot. My suggestion for a first program to code is a calculator, it's pretty easy but it seems to be a handful for beginners.
Hello, the only advice I can personally give you is don't start with C++ you will end up going in circles trying to understand it then end up quitting. The only reason I say this is because you don't fully understand how hard programming in general is. C++ is a hard programming language to learn if you have no programming experience, for how hard C++ is in general using Direct X or openGL deals with C++ code and Direct X or openGL code to deal with drawing, setting up graphics and input, ect... which would be impossible to jump into without basic experience in C++

I would suggest you try BASIC, either Visual Basic.NET or DarkBASIC/PRO and maybe BlizBASIC.

http://darkbasicpro.thegamecreators.com/
http://www.blizbasic.com/ (site might be offline for now)

You can try their demos to get a feel if this is right for you. Don't take this as something to discourage you in programming especially game programming. If you lack Math skills you will have a very hard time programming games in general. However that’s not a problem if you really want to learn to program you can always go that extra mile to learn what you need to achieve your dream.

I also suggest C# as my personal favorite language which contains the best of C and C++ making it easier to learn programming. I second Visual Basic (Classic is what I used aka 6.0) since I used this language for 4 years which was a great learning experince.

Best wishes.
____________________VB/C++/C# Programmer
Very intresting. Ok I am also beginner and I program simple codes in c/c++. I also wanted to display some object and if possible move it.

I will see SDL tutorial after my exams. Can some one guide me how do graphics appear and their movements. I mean,like pac-man. Can I make game like that.

I am thinking of, to have a maze and some object that needs to find a way out of it. Like those games.

I don't think you (well...now...y'all as the other guy posting) know how hard game development is. By judging from the way you have posted, it dosen't seem like you know the language very well. Please tell us what you know in C++ right now, and we will tell you if you are most likely yet to enter the world of graphics programming.


I will also suggest taking a look at C#. It's a pretty easy language to learn and it will hide some low level stuff from you.

We will just need more information on what you know...so yeah. Do you know how to do Hello World in C++, variables, input, if-else statements, loops, pointers, and a lot more?


Chad.
Like everyone else has mentioned, you sound a bit lost. Before you do ANYTHING you should read some of the articles in the FAQ, like this one. Second, you should consider an alternative language, C++/C or even Java for that matter are, in my opinion, languages you learn when you already understand a lot of programming concepts, which you can only understand by learning an actual language.

By choosing C++ as your first language, you are only making it harder on yourself. If you don't believe me, there are many more talented individuals on these forums that can explain to you why C++ is complicated for beginners better than I could.

Assuming you believe me, a great language to check out, and one that seems to be gaining popularity as a first language, is Python. Read the "Getting Started" section on their website if you are interested. If not, refer to the FAQ link I gave you to help you choose a language. Finally, lose the whole, "C++ is what the experts use!" mentality, it may be true, but those experts didn't all start out with C++.

This topic is closed to new replies.

Advertisement