Have you seen this "Worm"..?

Posted by Mordi on Aug. 10, 2006, 7:07 p.m.

Hey again -

As you read yesterday, i have started learning C++, wich is the most common language used for commercial games. I made my first 'game' or 'program' today;

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <iostream.h>

int main()
{
    srand((unsigned)time(NULL));
    int i;
    for (i=0; i<5; i++) {
    cout <<rand() <<endl;
    }
    cout <<"Press a key to exit..." <<endl;
    system("pause");
    return 0;
}

What i learned today:

- The code for displaying text, or variables.

- Random function. Returning a random integer.

- how to make the player able to press a key to exit.

- The code is only executed once, unless you loop it. (i found that surprising, really.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I decided to post a couple of screenshots of "Worms!", but only the menus!

I use a slightly modern, but still very military-ish font. I decided to use two colors; Yellow and black. The match set-up menu will change drastically over the next few months. Enjoy them!

Main Menu

Setup Menu

Comments will either be harshly beat, or mildly greeted. That should make things clear.

Have a nice night!

or…

cout <<"Have a nice night!" <<endl;

Comments

Firebird 17 years, 9 months ago

cout <<"Have a nice night!";

I believe that's the correct way.

Kaz 17 years, 9 months ago

Wtf is with the 5 #includes?

Firebird got it right.

Polystyrene Man 17 years, 9 months ago

So you're the person who started the "Pimp my worm topic".

Mordi 17 years, 9 months ago

Oops! Typo… I knew that… :(

The 5 includes are from the previous version, wich was different. (Long story, kinda)

Polystyrene Man;

Yeah. That was a bad idea… The graphics forum flooded with "pimp-my" topics after that! :(

Polystyrene Man 17 years, 9 months ago

You can say that again.