|
|
View previous topic - View next topic |
Author |
Message |
DreaZ Guest
|
Posted: Mon Feb 10, 2003 7:18 pm Post subject: programation |
[quote] |
|
hi,
im new at games programation, but i know about web programation ( experience in PHP and MySQL ).
now i want make a cool rpg, like the rpg that are made on rpg maker .. but i dont want use rpg maker.
i downloaded some nice games, but i dont know wich is the language used, how i can read the codes, and how i can test my scripts.
i downloaded some programs to use c++ but i cant test wut i do .. its really strange and complicated .. i need someone who tell me how i can start ..
someone can make it? can u, wich r experts, teach me how to make a simple thing, a little dude that i can ride. when i press right, he goes right, when i press left .......
nothing complicated... dont have to make a little dude, a black ball by example .. i just need basic codes, where i can see the code and try .. plz tell me wut r these crazy languages!
.bas , .1, .all .. lol .. can plz someone give a help?
thx, and sorry about the english, i dont speak english very well...
|
|
Back to top |
|
|
lazee barok Guest
|
Posted: Mon Feb 10, 2003 7:27 pm Post subject: |
[quote] |
|
well, you should choose something kinda advanced. maybe c++, c, vbasic, pascal, etc. or if you want something easier to learn, choose qbasic.
learn the basics first.
|
|
Back to top |
|
|
DreaZ Guest
|
Posted: Mon Feb 10, 2003 7:28 pm Post subject: |
[quote] |
|
did u read my post?
i know i can use c or c++, but how i can test my codes? like, i make a little thing and how i transform it to exe to see it? i dont know how to do these most basic things
|
|
Back to top |
|
|
Georg Monkey-Butler
Joined: 02 Jun 2002 Posts: 56 Location: The Netherlands
|
Posted: Mon Feb 10, 2003 7:38 pm Post subject: |
[quote] |
|
If you're new to programming then you should start with something simple. An RPG is a really difficult game to make. You should start with the basics. Like programming four-on-a-row, or some kind of puzzle. When you think you understand the basic basics you can take a look at www.allegro.cc to use the library Allegro which will help you with some graphical stuff. Then you can make a graphical game or something. Maybe try to make a mario clone. After that you can examine RPG's of other people and think really hard before you start making an RPG. _________________ Hi, I'm a signature virus. Copy me to your sig-file to help me spread.
|
|
Back to top |
|
|
Guest
|
Posted: Mon Feb 10, 2003 7:43 pm Post subject: |
[quote] |
|
did u read my post too?
ok the basicals, can someone tell me wut the hell r them .. i dont know how to test a code, can someone teach me the basic od the basic .. teach, not post a link
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Mon Feb 10, 2003 8:38 pm Post subject: |
[quote] |
|
Heh, these guys ARE trying to help. The problem is that your question knows many answers, and it's hard to say which is the best because in the end, that will be your own opinion. Two critical choices before you can start programming a game are:
- Which programming language will I use?
- Which library am I going to use?
You'll need the programming language for the arithmetic/algorithems and the library to actually get something on the screen, get input or play sound in a convenient way.
Now, because you are just starting and might want something easy, but also because I'm not very positive about QBasic (anymore), here is a quick example in C using the Allegro game programming library.
Code: | /* sample.c
*
* A small example proggie to show DreaZ how to
* put a movable ball on the screen. Using double
* buffering to prevent flicker.
*
* It's a minimal program, lacking much of the error
* checking that normally should be done.
*
* Bjørn Lindeijer
*/
#include <allegro.h>
typedef struct {
int x;
int y;
int color;
int radius;
} BALL;
int main()
{
BALL ball;
BITMAP* buffer;
allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
buffer = create_bitmap(SCREEN_W, SCREEN_H);
ball.x = SCREEN_W / 2;
ball.y = SCREEN_H / 2;
ball.radius = 10;
ball.color = makecol(255,0,0);
while (!key[KEY_ESC]) {
// Clear buffer, draw circle and update screen
clear_bitmap(buffer);
circlefill(buffer, ball.x, ball.y, ball.radius, ball.color);
blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);
// Update the balls position according to input
if (key[KEY_UP]) {ball.y--;}
if (key[KEY_DOWN]) {ball.y++;}
if (key[KEY_LEFT]) {ball.x--;}
if (key[KEY_RIGHT]) {ball.x++;}
}
destroy_bitmap(buffer);
return 0;
}
END_OF_MAIN();
|
Now, to compile this you'll need:
- C compiler, MinGW is a good one for Windows. It is also a C++ compiler, for if you want to try that out. Download MinGW-2.0.0-3.exe from http://www.mingw.org/.
- Allegro Game Programming Library. Download all403b2.zip (latest stable) from http://alleg.sf.net/.
- To compile Allegro, MinGW's DirectX headers will need to be updated after you've installed it, so extract dx70_mgw.zip over the installation dir. dx70_mgw.zip should be downloaded from http://alleg.sf.net/ too.
Installing goes like:
- Install MinGW
- Extract dx70_mgw.zip over it's install dir.
- Set the path to the \bin directory of MinGW
- Set the environment var MINGDIR to the installation dir (for exampe: SET MINGDIR=C:\MINGW). Don't use spaces in the path, use the DOS dirname in that case (with the ~1).
- Extract Allegro to a convenient directory.
- Open a command prompt and go to the \allegro directory
- Issue a "fix mingw32" command.
- Issue a "make" command.
- Issue a "make install" command.
If you didn't get any errors, now you've got your programming environment set up. Open a text editor, paste in the above code and save it as sample.c. To compile this:
- Go to the directory where you saved the file.
- Issue a "gcc sample.c -o sample.exe -lalleg -mwindows" command.
This last line tells the compiler to compile the one .c file into an executable while also linking it with the Allegro library. The -mwindows is used to link your program into a GUI application instead of a command-line application. The EXE will need the alleg40.dll file to run, which the Allegro installation should have added to your \System directory, so that'll be fine. Remember this when distributing your game(s) though.
Start the EXE and notice you can move the ball with the arrow keys. Go back into the text editor and see how it's done. By this time, it should be good to take a look into the other Allegro examples in the Allegro install directory and at the Allegro Documentation which is available in HTML format.
Finally, here's a link to the code+exe (alleg40.dll not included): sample.zip
Moreover, here's a link if you want to get into C++ programming (can be much like C): Teach yourself C++ in 21 days.
And, if you are going to use Allegro you might as well join the Allegro community here (Georg mentioned this already): http://allegro.cc/
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Mon Feb 10, 2003 11:18 pm Post subject: |
[quote] |
|
- RARRRRRRRRRRRRRR !!!!!!!!!!!!!!!!!
- PROGRAMMATION is NOT a word!!!!!!!!!!!!!
- GD!!
----------------------------------
- On a softer note...
Bjorn, do you know where to find a free C++ compiler that has a bunch of goodies in it? I want more the Borland type. I downloaded the DirectX 9.0 SDK (though I haven't bothered to open it yet, heh heh....... ) so I don't know if it has a Windows compiler in it. _________________ - Jaeda
|
|
Back to top |
|
|
mandrake@myhip Guest
|
Posted: Mon Feb 10, 2003 11:53 pm Post subject: |
[quote] |
|
tenshi- click on the link he posted called "mingw", it's an excellent compiler, and the one I'm using in my book. It's free, it's kick ass, and it's 10x more ANSI/ISO complient than the evil windows.
Bjorn- excellent post. I was going to respond with something similiar, but you said it perfectly.
|
|
Back to top |
|
|
|
Page 1 of 1 |
All times are GMT
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|