Where do I start?

Ok, a little background. I am a 13 year old guy who's been using Windows computers for 4 years for general stuff and hardcore gaming. My natural interest in computers attracted me to the idea of coding. It's a very overwhelming idea to me, I first became motivated after seeing the Code.org commercial on youtube, and then I started learning HTML, wasn't my thing, then took up C++ knowing it is a fundamental.

I just finished learning what cout and cin does and I am flipping out on the mechanics of it, projecting cin to x, to assign a variable, then say x which will then transfer to what you just said. IT'S GENIUS! I understand, after some studying, the lines of code in the Hello World program, and I'm taking a tutorial class thing online. But when I see lines of code in, for example, Runescape botting scripts or Minecraft plugin scripts it's very confusing for me. How do you link something up with an image? How do you even create a game? I guess it's just all very new for me, but how do you guys deal with it? How should I do this and that is my question, it feels I've just learned a very small piece of a very giant puzzle.
Last edited on
My advice: get a game lib and start cracking. The best way to learn is to do.

Graphics are easily accomplished with a game lib. I personally recommend SFML. It might be a little difficult to set up, but it's a very good library that is powerful and easy to use. Get the latest 2.0 release (don't get 1.6)

http://www.sfml-dev.org/

EDIT: I'm bored so I'm whipping up a little demo of a simple SFML program. Stay tuned....
Last edited on
Uuhhhh, what's a game lib?
Basic SFML program:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <SFML/Graphics.hpp>

int main()
{
    // Create a 640x480 window, titled "My First Game"
    sf::RenderWindow        mainWindow( sf::VideoMode(640,480), "My First Game" );

    // limit display output to 60 fps
    mainWindow.setFramerateLimit( 60 );

    // Load a texture (an image file)
    sf::Texture     texture;
    texture.loadFromFile("yourfile.png");

    // put that texture in a "Sprite" - ie something that actually gets drawn to the screen
    //   (these are separated because multiple sprites can use the same texture -- you do
    //    not want to have multiple copies of the same texture loaded in memory)
    sf::Sprite      sprite(texture);


    // start the game loop!  Game to keep running as long as this boolean is true
    bool rungame = true;
    while( rungame )
    {

        ///////////////////////////////////
        //  Process any user/os messages/events
        sf::Event evt;
        while( mainWindow.pollEvent( evt ) )        // as long as there are events to process... keep processing them
        {
            switch( evt.type )      // what type of event is it?
            {
            case sf::Event::Closed:     // it's a "close" event - the user wants to exit the program
                rungame = false;        // so mark our boolean to shut down the program
                break;

                // other events we don't care about
            }
        }

        ///////////////////////////////////
        //  Now that we're done with events, let's check the keyboard state and see if the
        //   player wants to move around
        if(sf::Keyboard::isKeyPressed(  sf::Keyboard::Up  ))  // is the "up" key pressed?
            sprite.move( 0, -1 );  // if yes, move our sprite up 1 pixel

        if(sf::Keyboard::isKeyPressed(  sf::Keyboard::Down  ))// is the "down" key pressed?
            sprite.move( 0,  1 );  // then move our sprite down 1 pixel


        ///////////////////////////////////
        //  Now that user input has been processed... render a scene
        mainWindow.clear();         // wipe the screen clear
        mainWindow.draw(sprite);    // draw our sprite
        mainWindow.display();       // display our generated image (makes it actually visible to the user)

        // Since we also set a framerate limit above... display() will also wait 1/60th of a second, ensuring
        //  that the above logic runs at a fixed rate.  (you don't have to worry about faster computers running
        //  faster -- all machines will run at an even 60 fps.

        // the while loop ends here... so the program will just keep looping until the user decides to quit
    }


    // That's it!
}
Last edited on
Uuhhhh, what's a game lib?


SFML is a game lib. It's a series of functions and classes that you can use to do something. In this case, it can be used to draw graphics, get realtime keyboard and gamepad input, play audio, etc, etc.
It would help me to give advise if I knew what program your using to make your programs. I'm old, so i learned command line, I like command line and I use it very well. Someday I may learn visual C++, and hope to, but today I use mostly command line stuff.

I'm not sure if it's easier to go from command line into visual C++ programming or not but I do think it's easier to understand starting out programming.

A lot of the post people make here are high school and college students taking classes, look at all their post and learn what they are learning.

Look at http://www.cplusplus.com/doc/tutorial/ to study each concept, such as opening a file, reading a file, writing a file, closing a file and so on.

Ask a lot of questions, read and write code (best way to learn).


I'm using Dev C++ which uses numbered lines and such. All I got when I ran Visual 2010 was a command prompt, and that's really all I got. I am going to try out Code::Blocks or something.

@Disch

So does it just give you a random amount of random pictures for you to use?
So does it just give you a random amount of random pictures for you to use?


No you would have to supply your own pictures.

It gives you the code base and the functions you need to draw those pictures in a program.
When I started out, my motive was to see my creation come to life on the screen. I had ambition to do something that I found interesting, and hopefully those around me would notice. It seems everyone wants to learn programming as a method to create games. I'm one of those people, as games are a great test of skill. Great goal, however, a full on game is much harder than it seems. I find myself starting up with many ideas and learning as I go. Looking up concepts and how-tos, making test programs to practice in isolation from my main game. I still find GUI's extremely hard to get into, but it might just be because I don't like using pre-made code. (but I mean that's the point of libraries right). While I'm learning I like to get in touch with basics and build upon them.
Topic archived. No new replies allowed.