Advertisement

Isometric SDL

Started by February 24, 2005 04:42 AM
5 comments, last by Rob Loach 20 years ago
Hello! I've been looking for a tutorial to get me started programming an isometric engine in C++/SDL, but without any luck. I've been trying to use the articles here on GameDev.net, which are for other APIs, but it didn't turn out good at all. So, if anyone could help me get started, or knows a nice tutorial somewhere on the internet, feel free to help me out! :) Thanks in advance. [Edited by - storage on February 24, 2005 11:02:22 AM]
So where exactly is your problem? In case it's the 'How to do xy using SDL', you should look at the manuals or general SDL tutorials first. Provided you have a problem specifically related to isometric games, the information is definately in the articles and not tied to any API (the API is replaceable in all cases, some subleties in implementation details aside, which you can figure out any time by asking someone, e.g. here[smile]).

In short: I don't know of any SDL-specific tutorial on the issue, but I think there are some and even if not, just specifically ask about things you need to know/ don't understand.

Regards,
Pat
Advertisement
Quote:
Original post by darookie
So where exactly is your problem? In case it's the 'How to do xy using SDL', you should look at the manuals or general SDL tutorials first. Provided you have a problem specifically related to isometric games, the information is definately in the articles and not tied to any API (the API is replaceable in all cases, some subleties in implementation details aside, which you can figure out any time by asking someone, e.g. here[smile]).

In short: I don't know of any SDL-specific tutorial on the issue, but I think there are some and even if not, just specifically ask about things you need to know/ don't understand.

Regards,
Pat


Yeah, you're right, I'm sorry :)

The only thing I need to know right now is how to draw the tiles so they end up like this:



I know how to draw tiles to the screen and everything, I just need help with where/how I should call the sprite drawing to make it look like they are glued together, the biggest problem I have with it is their positions.

Thanks in advance :)
The book Isometric Game Programming with DirectX 7.0 by TANSTAAFL covers pretty much all you need, it is somewhat old, and it uses DirectDraw, which is what's behind SDL in Windows, so you should be able to use the algorithms with only few changes, seems to be out of print, but you may be able to get a used one.
Quote:
Original post by Kwizatz
The book Isometric Game Programming with DirectX 7.0 by TANSTAAFL covers pretty much all you need, it is somewhat old, and it uses DirectDraw, which is what's behind SDL in Windows, so you should be able to use the algorithms with only few changes, seems to be out of print, but you may be able to get a used one.


Thanks alot :)
Well, I've made it render it quite nice now.

This is what it looks like at the moment:


But, I want it to render the "map" 10-12 pixels or so from the top and left. The sprites are 32x25 pixels big.

This is the code I use to render(I know it could be better, if you know how to improve it, feel free to comment):
		int lasty; // new row?		bool evenrow = false; // is the row even or odd?		// Draw tiles		for (int y = 0; y < CLIENT_SPRITES_Y; y++)		{			if (y != lasty)			{				if (evenrow)				{					evenrow = false;				} else {					evenrow = true;				}			}			for (int x = 0; x < CLIENT_SPRITES_X; x++)			{				sprOnscreen[x][y].img = sprCache[1].img;				if (evenrow)				{					sprOnscreen[x][y].DrawSprite(sdlScreen, x * 32, y * 8);				} else {					sprOnscreen[x][y].DrawSprite(sdlScreen, 16 + x * 32, y * 8);				}			}			lasty = y;		}


Thanks in advance! :)
Advertisement
H_o_p_s has been working on an isometric tactics rpg, you might want to get in contact with him.
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement