Sign in to follow this  
KaiserJohan

Some SDL questions

Recommended Posts

KaiserJohan    2317
Hello,

I've got some questions if you don't mind :)
I am using SDL 1.2 in C++ doing 2D strategy game.


1. I want to do some graphics like Age of Empires 1 ([url="http://www.microsoft.com/games/aoeexpansion/img/screenshot_2.jpg"]http://www.microsoft...creenshot_2.jpg[/url]).

Another example is Pharaoh: [url="http://withfriendship.com/images/c/10131/Pharaoh-wallpaper.png"]http://withfriendshi...h-wallpaper.png[/url]

Here's what I have right now;
[url="http://img121.imageshack.us/i/testod.png/"][img]http://img121.imageshack.us/img121/9571/testod.png[/img][/url]

Uploaded with [url="http://imageshack.us"]ImageShack.us[/url]

Is it just me or is the camera more 'tilted' in AoE 1? How do I achieve this effect?


2. What is the best way to paint a HUD / minimap?


3. I want to enter/exit fullscreen mode on Esc. Here's what I have right now:

[code]void cApp::onKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode) {
switch(sym) {
case SDLK_UP:
cCamera::cameraControl.onMove( 0, 5);
break;
case SDLK_DOWN:
cCamera::cameraControl.onMove( 0, -5);
break;
case SDLK_LEFT:
cCamera::cameraControl.onMove( 5, 0);
break;
case SDLK_RIGHT:
cCamera::cameraControl.onMove(-5, 0);
break;
case SDLK_ESCAPE:
surf_Display = SDL_SetVideoMode(W_WIDTH,W_HEIGHT,32, SDL_HWSURFACE | SDL_DOUBLEBUF);
break;

default: {
}
}

}[/code]

.... is this safe though? I mean I am reassigning the surface which is currently displayed, surely I must do something else, like FreeSurface it first?


4) What is the best place to find seamless, 2D tilesets and graphics?


5) How do you create a 'zoom' effect, something like Supreme commander?


Thanks!

Share this post


Link to post
Share on other sites
Monkan    1087
Hi,

I think what you want when you refer to Pharaoh and Age of Empires is an Isometric view.
I've never done it myself but there is a forum on this site so they might help if you have specific questions.

The HUD/ MiniMap is normally over-layed on top of the other draw items. I have done it in openGL by switching to 2D orthographic projection and drawing my HUD images and text.
Basically I think you just want to draw images and text on top of your other graphics.

For 2D tilesets and graphics I would suggest google for non-specific (such as 'grass tileset' google images) or make it yourself / be-friend an artist for specific graphics.

Not too sure if any of that is any help but there you go. :-)

Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this