PDA

View Full Version : basic 2D



Demonkid43
04-08-2007, 07:00 PM
hey peeps im new to the scene so i would like to first say hi
however my question
i am fairly new to pascal and i know only a little but one of the things i want to make is just a simple guy that you can move with the arrow keys...

however i have no clue as to what to do for for graphics i want something with decent quality as i have read a few tutorials and it seems quality has been an issue in pascal, i don't know how to combined the programing itself and the images so if i push a button a person will move so i was wondering if there were any more tutorials or a script that could help me out
and get me on the right track

arthurprs
04-08-2007, 08:53 PM
Sorry if i don't understand but u said that graphic quality in pascal is poor :?: :?:

Soldat, Monsters Math, Wicked Defest... have vry good quality

Robert Kosek
04-08-2007, 09:30 PM
Quite. Graphics in Pascal has the same quality as other languages. You just read old tutorials. Just search for Project "W", or Genesis Device here.

Goodness, Genesis Device (http://www.genesisdevice.net/media.html) even looks a lot like Oblivion and Crysis!!


Firstly, Pascal/Object Pascal is not a scripting language. You can't just "find a script" that does these things. It is a programming language that is a high level programming language with full assembler support. Secondly, these things are really elementary ... why do you even care what it looks like? You are just moving the location of a sprite.

Regardless I'd suggest looking into the Phoenix library (http://www.pascalgamedevelopment.com/viewtopic.php?t=3345&start=255).

Demonkid43
05-08-2007, 12:47 AM
ok so graphics are all good eh...

whats a sprite i assume you don't mean the drink obviously and ok so let me rephrase my question...were can i go or what can i do to learn how to implement graphics into my game i would have to start from the very beginning to learn that and it mite also help if i could find a good tutorial on Delphi as i'm pretty sure its needed to incorporate graphics

o and i didnt mean a script to do that i ment a source code sorry :P

arthurprs
05-08-2007, 02:29 AM
Quite. Graphics in Pascal has the same quality as other languages. You just read old tutorials. Just search for Project "W", or Genesis Device here.

Goodness, Genesis Device (http://www.genesisdevice.net/media.html) even looks a lot like Oblivion and Crysis!!


Firstly, Pascal/Object Pascal is not a scripting language. You can't just "find a script" that does these things. It is a programming language that is a high level programming language with full assembler support. Secondly, these things are really elementary ... why do you even care what it looks like? You are just moving the location of a sprite.

Regardless I'd suggest looking into the Phoenix library (http://www.pascalgamedevelopment.com/viewtopic.php?t=3345&start=255).

this engine looks awesome, when i move to 3d i will take a deep look

wodzu
05-08-2007, 09:01 AM
this engine looks awesome, when i move to 3d i will take a deep look

Same here ;-)

to Demonkid43:

I'll try to show you the easiest way to achive this, without any additional graphics library. So here it goes:

1.Create new vcl application.
2.Put image component on the form.
3.Load to the image your desired image (by double clicking on its picture property)
4.On your main form (the one on which is the image lying) go to the events tab and double click on the OnKeyDown event.
5.Describe event like this:


procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key=VK_RIGHT then
Image1.Left:=Image1.Left+5;
if Key=VK_LEFT then
Image1.Left:=Image1.Left-5;
if Key=VK_UP then
Image1.Top:=Image1.Top-5;
if Key=VK_DOWN then
Image1.Top:=Image1.Top+5;
end;

Compile and move your image through the arrow keys.

Good luck!:)

pstudio
05-08-2007, 06:32 PM
I believe DelphiGameDev (http://delphigamedev.com/tutorials/) would be a good source for beginner tutorials. Reading the tutorials should give you a good starting point into making games.

ps. Don't wait for the tutorials that says 'Almost there'. It's been like that for years ;)

DarknessX
05-08-2007, 09:23 PM
Hey, I just wanted to let you guys know... Demonkid is my friend Daniel, and he's fairly new (very very new...) to pascal, and doesn't exactly know the specifics... He's not using delphi, even though he might think he is. He's using Free Pascal, just the IDE, without Lazarus or anything similar.

He can understand coding you give him, and learns best from things like wodzu posted...

I'm teaching him what I know personally (not much but enough to get him started)... He is not so technical, and when he said 'script' he really just meant a chunk of coding...

What he's attempting to accomplish, is to display a little animated graphic, and move it across the screen.

pstudio
05-08-2007, 10:12 PM
If he's completely new I would suggest him to start out with Turbo Delphi or Lazarus. I believe it would be easier to get some quick results with a solid IDE.
Of course if he have never done ay coding he should perhaps look at a place like delphi.about.com and read their beginner tutorials to introduce the basics of the language. (Then again I never really bother that and went strait on to coding games ;) of course the games sucked and I eventually started learning some basics and I'm still learning)
If he uses Delphi or Lazarus he could use the tutorials I linked to before. They start out making the same basics thing like the code example wodzy wrote, but they also explains how it works. Something that is valuable to a beginner.

WILL
06-08-2007, 01:00 AM
Hi Demonkid43, welcome to PGD! :)

I would strongly recommend that you start out with the minimal amount of setup required (to me that means either Turbo Delphi or Lazarus and a beginners level graphics library) just to get your feet wet learning the basics.

Once you have gotten into it and understand how to make a simple game like Pong/Arkanoid, Tron or even a Scorched Earth clone, you can move on to more complex stuff like a platformer, shooter or even tactical or strategy if you feel bold enough.

BUT, and I would ward you away from getting into the BIG projects while you are still learning. Huge epic games are very attractive and exciting to be involved in, but you learn slower as there is a LOT more to do to complete them. Stick to the smaller projects, you'll learn a lot more a lot faster. And they can be just as fun. Plus you won't always feel as if you 'dropped' or 'gave up' on most of your early projects. :) (<-- Years of Experience, free of charge ;))

Demonkid43
06-08-2007, 02:56 AM
first of all thank you wodzu for the as dx said chunk of coading i am wondering though can you use instead of left+5 right+5 or up+5

what is the phoenix library and for that matter whats a library

thank you pstudio for the link to delphigamedev, delphi.about.com
i plan on getting Lazarus

were can i find a library ...whatever it is and WILL i plan on making a little character to run around as my first real project and then i want to recreate an old game from a site called chaotic gaming were this little dude is tryin to catch your mouse and he can throw thins and swing a pole at it ...its a really fun game

with this information you all have gaven me i should be able to start learning a little bit better
thank you

WILL
06-08-2007, 03:23 AM
A library is kind of like an add-on to your existing project's code. It contains; functions, variables, constants, etc that you can use yourself in your main program.

I'd first look in the Library section (from the site header menu) under General Programming for material on the basics of the Pascal language first before you get too far into trying to do other things. Once you have the basics of programming down, things will seem a little clearer to you.

You can work with Lazarus to make some basic programs to learn the language and get a idea of how it all works.

pstudio
06-08-2007, 03:28 AM
what is the phoenix library and for that matter whats a library
A library is basically a collection of procedures, functions, objects etc. that brings some functionality to your project. A library will usally focus on one thing like fo instance graphics, math, or whatever.
The Phoenix library is a library that will make it easy for you to make 2D-games. It uses OpenGL as a rendering platform and is capable of doing many things you'll need in a 2D-game. The advantage is, that while it is possible for you to set up OpenGL on your own and do all the tedious rendering, it takes time and is wasted energy. Phoenix will do this for you in a snap and much more. It renders text for you, which is not as easy as it may sound, it has a spriteengine which does collisionchecking for you, it has a particle system and lot more. Basically Phoenix remove the "boring" work and let you focus on writing the game.
That's what an library is all about. Make the boring work fast and let you focus on the interesting stuff.

Diaboli
06-08-2007, 10:29 AM
Alex Rosendal has some great tutorials out on his site:
http://www.gameprogrammer.net/index.php?fuseaction=tutorials.list

these, along with those at delphigamedev, will give a good start.

and delphi.about.com is absolutely great!

good luck!:D

Demonkid43
07-08-2007, 02:02 AM
sorry if it aint related to the post but how do i change the name of components of tbutton and how do i make timage display an image in lazarus

WILL
07-08-2007, 02:04 AM
You're right it isn't. If you want to change topics please start a new thread. It doesn't cost anything.

Honest! Totally free of charge! ;)

Demonkid43
10-08-2007, 09:03 PM
ite lol i figured it out anyway so sombody close this thread :P