PDA

View Full Version : New to this



captain jaster
14-07-2010, 07:16 PM
Hi
I want to make my own game in pascal(....)
But i dont know were to start :(
So i had an idea for it


Type
TDuck = Object
Procedure MakeSound;
Procedure MoveLeft;
...

But i dont know if that would work....
Im also using the Lazarus compiler...
THNX

chronozphere
14-07-2010, 08:01 PM
Hmm... first of all. Do you know how to program in an object oriented way?

It would become something like this:

Type
TDuck = class
public
Procedure MakeSound;
Procedure MoveLeft;
end;

...

implementation

....

Procedure TDuck.MakeSound();
begin
//play the sound here
end;

Procedure TDuck.MoveLeft();
begin
//Make the duck move left
end;



But most important of all, you need to:

> Know how a game works. I'm talking about the essentials: Making a game loop, reading input etc..
> You have to get some libraries to do stuff for you: Play sound, draw graphics etc
> You need to make all the art

So tell us. What is your level of programming skill? Have you looked into some libraries?

Hope it helps. :)

P.S: Lazarus is not a compiler. ;) It's an IDE that uses the FreePascal compiler.

captain jaster
14-07-2010, 10:18 PM
Well i know that theres more then one way of doing OOP


Type
TDuck = Object

end;



TDuck = Class

end;

And ive worked with OOP many times before.. I know how to implement it
I guess im pretty good at it.
I've made small CLI and GUI programs
I can work with text files
Has far as reading input i know


Readln(MyStr);

And things like TEdit Etc Etc
So...

captain jaster
15-07-2010, 01:15 AM
Any one?
I just want to know how to get started...
What Units am i gonna use?
DO I need a certain compiler?
Etc Etc

Traveler
15-07-2010, 08:18 AM
Hey captain jaster.

Welcome to the forums. :)

A compiler: Delphi is of course a popular choice. There's the commercial product, but Turbo Delphi (http://www.turboexplorer.com/) works equally well. Chronozphere also mentioned FreePascal as a possible option.

Next, choose a directx/opengl wrapper. There are many available, DelphiX used to be quite popular, but nowadays Asphyre (http://www.afterwarp.net/) or Hadron Game Engine (http://hadrongames.com/) (aka PyroGine) are two of the better options to choose from. Note that it is not required to use these packages, but they tend to make life a lot easier as much of the hard work is already done for you. i.e You don't have to think anymore setting up the graphical interface, capturing input, setting up sound, working out collision detection systems etc etc. Mind you, these are 2d engines, there are other libraries for 3d. Also, both come with demos. Have a look at them, learn from them.

Ok, with that out of the way, next thing you should be thinking about is what kind of game you want to make. A puzzle game, platform game, shooter etc. Also consider for a moment if you're able to get the assets for it, especially the graphical content.
Judging from your post I'd say you are quite new to all of this so I would recommend choosing something simple like a Space Invaders or an Asteroids clone.

Anyway, I hope this help a bit

User137
15-07-2010, 09:21 AM
I would recommend learning to use Lazarus. It looks like Delphi, uses Free pascal compiler, works on Windows and Linux and doesn't cost a thing.

You can download it (Use latest snapshot always. The recent "stable" version is very very outdated and in fact less usable.) here: http://www.hu.freepascal.org/lazarus/
"Lazarus + fpc 2.4.0 - win32" is propably the most common pick, but choose the fitting for your system.

First question you may have concerns executable size being over 11mb on empty form. This is solved removing debug symbols from .exe, this is done in compiler-linking options.
- Strip Symbols From Executable (-Xs) -> Checked
- User external gdb debug symbols file (-Xg) -> Checked
(edit: fixed)

Also, if you are using other libraries you will be forced to type their directory path in the project paths aswell, for each project.

captain jaster
15-07-2010, 01:12 PM
I would recommend learning to use Lazarus. It looks like Delphi, uses Free pascal compiler, works on Windows and Linux and doesn't cost a thing.

You can download it (Use latest snapshot always. The recent "stable" version is very very outdated and in fact less usable.) here: http://www.hu.freepascal.org/lazarus/
"Lazarus + fpc 2.4.0 - win32" is propably the most common pick, but choose the fitting for your system.

First question you may have concerns executable size being over 11mb on empty form. This is solved removing debug symbols from .exe, this is done in compiler options.
- Strip Symbols From Executable (-Xs) -> Checked
- Link Smart (-XX) -> Checked

Also, if you are using other libraries you will be forced to type their directory path in the project paths aswell, for each project.

I am using lazarus


Hey captain jaster.

Welcome to the forums. :)

A compiler: Delphi is of course a popular choice. There's the commercial product, but Turbo Delphi (http://www.turboexplorer.com/) works equally well. Chronozphere also mentioned FreePascal as a possible option.

Next, choose a directx/opengl wrapper. There are many available, DelphiX used to be quite popular, but nowadays Asphyre (http://www.afterwarp.net/) or Hadron Game Engine (http://hadrongames.com/) (aka PyroGine) are two of the better options to choose from. Note that it is not required to use these packages, but they tend to make life a lot easier as much of the hard work is already done for you. i.e You don't have to think anymore setting up the graphical interface, capturing input, setting up sound, working out collision detection systems etc etc. Mind you, these are 2d engines, there are other libraries for 3d. Also, both come with demos. Have a look at them, learn from them.

Ok, with that out of the way, next thing you should be thinking about is what kind of game you want to make. A puzzle game, platform game, shooter etc. Also consider for a moment if you're able to get the assets for it, especially the graphical content.
Judging from your post I'd say you are quite new to all of this so I would recommend choosing something simple like a Space Invaders or an Asteroids clone.

Anyway, I hope this help a bit






Thnx Im Hoping to make a small 2D platformer
But do you know how i can get started with Asphyre.
Theres alot of Files In the Src :S

noeska
15-07-2010, 04:31 PM
Welcome to the world of pascal.

Follow these tutorials to get started. You are told what you need and how you use it.
http://www.schoolfreeware.com/Free_Pascal_Tutorials.html
This course includes 32 tutorials building things up at the end you are ready to start programming your game :-)

WILL
15-07-2010, 06:08 PM
I've thought about writing a book for those that want to learn how to program in [Object] Pascal with a skew towards making games. I remember when I was taking Computer Science classes in highschool that was how they presented new game concepts to us past the basics and on to functions and procedures and so on.

Problem these days is that you can't really pull up modern day graphics modes with your usual Pascal compiler because it's all APIs now. If you want to work with graphics you have to learn SDL, DirectX or OpenGL. However to still can make a game using console ASCII text, but I don't know if young people these days would be interested in starting with that.

Game programming isn't for the instant gratification crowd these days, of that I'm sure. :)

paul_nicholls
15-07-2010, 11:19 PM
Welcome to the world of pascal.

Follow these tutorials to get started. You are told what you need and how you use it.
http://www.schoolfreeware.com/Free_Pascal_Tutorials.html
This course includes 32 tutorials building things up at the end you are ready to start programming your game :-)


Hey, those are quite good Pascal tutorials :)

cheers,
Paul

captain jaster
16-07-2010, 07:38 PM
THank you guys :D
Im gonna start with a CLI game ::)