2d fun

sage

Newbie
Joined
Sep 6, 2003
Messages
97
Reaction score
0
I figured some of you would get a kick out of my project :E
[EDIT: forgot to mention this was done in c++]
This is my first 2d platformer. My previous work includes the infamous GDI - pong, a console based ascii rpg and a few other things not worth mentioning.

NOTE: I dont plan on releasing this to the public due to my introductory version of msvc++.

Pic 1 - Map Editor
Pic 2 - Game

The Map editor still needs work ei. fix the scrollbars/add child window for tile selection. It's all done in MSVC++ 6 using DirectX7 Ddraw. Left clicking loops through the tiles and right clicking toggles the tile solid. The small red squares you see are solid tiles...

The Game itself uses ddraw7 in window and is double buffered. (had trouble doing this in a window...) im currently working on collision detection. So far i have the y axis working for map collisions. I plan on adding animations/NPCs(non-playable characters) and i plan to add an entitys to my map file format for stuff like the players starting point/items ect..

This project so far has been a blast. If oyu have any tips or suggestions please feel free to post them :E wish me luck!
 
My suggestion: a background.

This could be done using simple sprites (masked pictures) and moving them along the screen as your charactor moves. Don't forget to render them first so they are at the back.
 
heh, sweet :)
i recommend clanlib for your 2d adventures, its great! also, as for the background, if you do one, do multi layered ones like in sonic the hedgehog, it adds a touch of class :D
 
Adding back ground inmages/sprites is really trivial... as a matter of fact ill add it in for SnG. give me 10min. :stare:
 
Pic 3 - Sky

I used the same method I used for colorkeying the "megaman" sprite and changed the tiles to the colorkey tile... which brings me to my next item of business. I NEED to add in the child window for tile selection.. also i need to add this feature.

When holding mouse(left mouse button) on map screen
map[mousex/32][mousey/32] = current selection

^ That should really speed things up :stare:

[EDIT: lost by 1 min.. damn.]
 
Onions said:
heh, sweet :)
i recommend clanlib for your 2d adventures, its great! also, as for the background, if you do one, do multi layered ones like in sonic the hedgehog, it adds a touch of class :D

To create parallax? That would definately be worth it.

Another sugestion would be to add particles with simple collision detection and physics. They can do alot for a game... any game.
 
Not any game, it would take to much time, right Valve.
 
Maby I should add sparks?? j/k :naughty:

Im gonna re-do my tiles/player graphics
Add the features to the map editor
Blah blah blah..

I really havent coded a line since the sky bit. I know i should really get back to it...
But first I need to put "The masters fo Doom" down!
 
The game looks really very nice! :)
How many lines of code does the game have? And how many the editor?

Why did you use DirectX 7? How have you learnt that all (DirectX and C++)?
I'm always interested in book tips! ;)
 
Microsoft visual c++ 6.0

1071 lines for the Game (with whitespace & comments)
890 lines of code for the Map Editor (with whitespace & comments)

Im all self-taught. My current book collection includes..
Sams Teach Yourself c++ in 24/hours (right... /sacasm)
Tricks of the windows game programming gurus by lamothe vol 1(directx 6)

I used the dxsdk docs to convert his book to ddraw version 7. (wasnt hard at all)

I was toying with my map editor last night and I hope to post an update soon. Im planning on adding a spawn point fo the player and some animations.
 
couple questions.

1. how long have you been coding (i mean, in general)?

2. how long did it take you to get to this stage in this particular project??

just curious. i'm just starting programmming, haven't attempted a game yet. was considering a top down/iso style, but haven't figured out how yet.

oh, another... how is working with directdraw? not too hard to get into?

Edit: oops, one more. have you found any web tutes that were particularily good?

thx.
 
wow Phisionary I thought you were some cpp expert lol

I'm starting ddraw, and in concept, ddraw is too easy. basically only things it does is load images into vram and allows you to copy them to the primary display. ofcourse it does other things but that's what it's all about.

edit:
it doesnt' actually load images, it allows you to create surfaces (fancy name for images?) in vram.

loading images is another thing.
 
hasan said:
wow Phisionary I thought you were some cpp expert lol
HAH! :LOL:
no... no... not an expert. the stuff on on that other thread was just me messin around for, like five hours. Partly luck. The other guys were getting along much better at actually figuring out how it worked.

otherwise, just a few console programs and one for windows. just to test.
but hopefully i'll get there. :E
 
once you get the basic syntax down for c++, ddraw becomes extremely easy. The only beef i had with this project was learning win32.
 
sage said:
once you get the basic syntax down for c++, ddraw becomes extremely easy. The only beef i had with this project was learning win32.
You mean the Win32 API? Why did you had to learn it, isn't it possible with the MFC, too?
 
one said:
You mean the Win32 API? Why did you had to learn it, isn't it possible with the MFC, too?
Generally MFC is too slow for games.
 
SLH said:
Generally MFC is too slow for games.
Yes, but for the game DirectX would be enough, right?
He only needed the WinAPI for the Editor, I thought ... but I don't know. ;)
 
I used the same basic layout for the editor and the game. The only difference is the user input and the scroll bars. Both apps have ddraw and are buffered using a second surface. I did consider using mfc for the editor but since i dont know alot about it ill just use child windows etc..
 
Phisionary:

1. how long have you been coding (i mean, in general)?
Off and of for about ~three years. If i condensed it down it would be around a year.

2. how long did it take you to get to this stage in this particular project??
This project was my first attempt at a game. I spent around a week toying with basic ddraw. I started with the map editor and worked my way up.(3-4 days) Right now im still toying with collision detection. I havent touched in couple of weeks.

3. how is working with directdraw? not too hard to get into?
Not to hard, as long as you know the basics of c++.

4. have you found any web tutes that were particularily good?
I really recommend Gamedev.net

EDIT: Good luck, btw! :p
 
Back
Top