Jump to content

  • Log In with Google      Sign In   
  • Create Account


game programming??


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 DarkenMerlin   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 February 2002 - 02:28 PM

Im just now learning to program C++, but i dont see how these if statements, loops, arrays, etc. can form a working game. i have no clue how these things come together to make things do things

Sponsor:

#2 kordova   Members   -  Reputation: 138

Like
Likes
Like

Posted 11 February 2002 - 02:39 PM

It seems like the craziest thing at first but play around with it. Do whatever seemingly pointless lessons the book (I hope you own) puts you through and in a little while you''ll start to "get it." There is really little else that can be said for now except do a little crunching and lurk these very helpful boards.

Good luck and cheers!

-------------------------
Every servant has his place, no matter lowly or modest. To know it is his greatest comfort, to excel within his greatest solace, and his master''s contentment is his greatest reward.
-
Serve Microsoft today, tomorrow you may be dead.

#3 Hikeeba   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 February 2002 - 02:58 PM

True. When you first start it''s really hard to see how all that stuff will lead to making games. It does though. Keep at it for a while and it''ll fall into place.

Now if you want proof, look at the code for any open source game.

I wanna'' ride on the pope mobile.

#4 Lohrno   Members   -  Reputation: 222

Like
Likes
Like

Posted 11 February 2002 - 02:59 PM

You have to know functions, how to create them, structures, classes, pointers, data structures, etc. When you know all that
then you need to learn an API or two, and THEN you can create something cool. Its the functions that actually do the work, and the classes, variables, if statements, for loops, etc that organize everything. Like they say in SSX tricky, "From tiny acorns do mighty oaks grow. Welcome to practice mode."

-Lohrno


#5 Lazarus404   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 February 2002 - 03:30 AM

Whenever you think that way, just remember.... How the hell did the first programmer ever expect to make a useful program using just 1's and 0's?

The answer is planning, time and patience.

Something a bit more useful, however, why not download someone elses work and see how that works?

Check out these sites

www.darkbasic.com
www.genesis3d.com
www.destiny3d.com
www.revolution3d.de

There, that should cover everything from basic 3D games programming to commercial games programming. If you don't find what you're looking for, check the links on these sites.

Lazarus404

Edited by - lazarus404 on February 13, 2002 10:31:49 AM

#6 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 February 2002 - 03:37 AM

for a less abstract answer, imagine you have 3 floats, x, y, z. these can represent the position of your character. there are functions that you will learn once you look into direct input that will allow you to see what keys the user has pressed. once you find that out, you'll be able to change x, y, and z to make it seem like your character is moving. like if(up arrow pressed) y += 4; or something like that. unfortunately, there's lots more to learn before you get to see how all the basic syntaxes apply, such as setting up the graphics display in order to display the character. in order to quickly see how this would be done, i would highly recommend Nehe's site to start.

allan

Edited by - a2k on February 13, 2002 10:38:31 AM

#7 Cyberdrek   Members   -  Reputation: 100

Like
Likes
Like

Posted 13 February 2002 - 03:40 AM

quote:
Original post by DarkenMerlin
Im just now learning to program C++, but i dont see how these if statements, loops, arrays, etc. can form a working game. i have no clue how these things come together to make things do things


Learn the basics, then learn how to code a game, we must all start at the bottom of the ladder...



"And that''s the bottom line cause I said so!"

Cyberdrek

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer
/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash

#8 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 13 February 2002 - 03:57 AM

I figure I''ll throw my 2 cents in. When I started game programming - the thing that was most confusing to me was how the code eventually draws graphics on the screen.

That is mostly done through the magic of video cards. This may over-simplify the matter but in ram (usually video ram a.k.a. vram) the screen is laid out as an array. Lets call that array Screen[640][480]. This is a screen that is 640 units wide and 480 units tall. You will tell the video card that I want to put a dot at Screen[15][15]. The video card will take this input and draw a dot at row. By being very careful where you draw your dots it will eventually draw a picture.

This is where the game loop comes in. First you will start your game by drawing an initial picture. Then you will get the user''s input, decide how to change the picture (i.e. move the player) and then redraw the picture. In a game this is called the game loop and happens over and over again until the player decides to quit.

Yes - this is all done through very typical if...else statements and loops. I hope this helps a little, but the bottom line is to understand how a computer works, keep reading, work hard, and most of all have fun doing it (I hope that doesn''t sound too sick). But it appears your headed in the right direction.

As far as using methods to do the work for you, yes it help incredibly, but I would also encourage you never to use a method unless you know exactly what it is doing. It will make you a better programmer.

#9 Dharma   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 February 2002 - 04:02 AM

Start very simple.

Start 2D.

Get a good book on programming. Many suggested here (Books & Software)

Think of your code as a continous loop. Inside it you put all the if etc statements.

Pseudo example of a moving object:

speed = 1; // Movement variable
x = 50; // Variable that holds the X position of the object
ScreenWidth = 640; // Assuming you have a 640 * 480 resolution

Start loop
{
// Give x a new value to create movement for the next frame.

x = x + speed;

// Check if reached the right end of the screen

if (x > ScreenWidth)
{
x = ScreenWidth;
speed = -1;
}

// Check if reached the left end of the screen

if (x < 0)
{
x = 0;
speed = 1;
}
// Assuming you have a function with this name taking care of the details in drawing the object.
DrawObject(x, y);
}
End of loop

The pseudo code inside the loop forever. increasing X or decreasing X depending on if it hit the left or right side of the screen. Meaning your object will be moving each frame one pixel to the left or right. I hope this makes some sense.

Anyway you need to start very simple. Learn to draw something on the screen, manipulate some strings, print them etc. Then maybe move on to interact with your program controlling movements on the screen.

Good luck!

Warm regards
Mario..




Edited by - dharma on February 13, 2002 5:19:10 PM




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS