Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Beginners - Moving 2D Sprites Left/Right/Up/Down - Azeem

Author
Message
Azeem
16
Years of Service
User Offline
Joined: 6th Jan 2008
Location: Metropolis
Posted: 19th Jul 2008 15:19
Hi here is a simple code (i have super noted this code to tell you everything you need to know on simple programming in gdk). Its very easy to understand.

Here are the sprites you will need, These are all made by me and are free to use even though their lame . Also i uploaded them on my private server, is there any other place i can host them (kinda permanently, becaus image hosts delete your uploaded imgs after a while):

Backdrop2.bmp
sleft.bmp
soldier.bmp


1) Open up VC++ 08 and go to file->new project->wizards-> 2D Game
2) Delete Main.Cpp on the project you just created.
3) Download the attachment on this thread and place Main.cpp from there to your project folder.

3) Download the code from the attachment below.

Please feel free to meddle with the code and stuff. Im a n00b so please dont ask me anything too advanced xD
Luckily, i figured out how to move left/right on my own, i had to use the coordinates. At first though i actually tried to mirror the original sprite but everytime you would press the button or hold it down the sprite would keep mirroring so dont worry about that for now.

Thanks and if you found this sample kinda useful please tell me.
Azeem

Azeem - Game Programmer In Training... knows php,html,mysql,js,ajax a little Action script and a little C++

Attachments

Login to view attachments
Dragon Tiger Wolf Bald Eagle
16
Years of Service
User Offline
Joined: 5th Feb 2008
Location:
Posted: 20th Jul 2008 07:55
A little To easy. Now can you make it so that in my 3D program that when I move the cursor over one of the three spheres that I have as buttons that no matter what angle I come to the buttons when I have the cursor over the button and only when its over it that when I click it changes?

The quality of what a man gives without seeking anything in return shows his integrity.

Login to post a reply

Server time is: 2024-11-20 17:32:57
Your offset time is: 2024-11-20 17:32:57