Page 1 of 1

first grass tile

Posted: Tue May 04, 2010 10:30 pm
by pythip
This is my first attempt at a tile, I used gimp to create this, what are your thoughts about this tile? alright for a first try, or should I quit while I'm ahead, and how do I make it so that it doesn't look like there are diagonal lines down the screen when I render it?

code I used to display image

Code: Select all

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
int main (int argc, char *argv[])
{
	const int SCREEN_WIDTH = 640;
	const int SCREEN_HEIGHT = 480;
	SDL_Surface *buffer = NULL;//creates the buffer
	SDL_Surface *grass = NULL;//creates the buffer
	SDL_Init(SDL_INIT_VIDEO);
	buffer = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_SWSURFACE);
	bool done = false;
	SDL_Event event;
	SDL_WM_SetCaption("Window", NULL);
	grass =  IMG_Load("grass1.png");
	while(!done)
	{
SDL_FillRect(buffer,NULL,0x000000);
	for (int y = 0; y < SCREEN_HEIGHT; y+=32)
	{	
		for (int x = 0; x<SCREEN_WIDTH; x+=32)
		{
		SDL_Rect area = { x, y,32,32};	
		SDL_BlitSurface( grass, NULL,buffer , &area );
		}
	}
	SDL_Flip(buffer);
		while(SDL_PollEvent(&event))
		{
			if (event.type == SDL_QUIT)
			{
				done = true;
			}
		}	
	}
SDL_FreeSurface(grass);
	SDL_Quit();
	return 0;
}

Re: first grass tile

Posted: Tue May 04, 2010 11:21 pm
by Live-Dimension
It looks pretty dammed good, though I wonder how you made it. It doesn't exactly look like pixel art. If not, will the rest of your games graphics suit the style of the grass?

I went and tiled it in photoshop, hope you don't mind. With the vertical lines, are you talking about the ones showing up on here? If so, then the tile needs more work, get arid of that black stripe.
tile.png
tile.png (4.93 KiB) Viewed 1986 times
I had a VERY quick look at your code and the mathematics seems to check out, but there could still be an error in it. Someone with better SDL experience will need to help you there.

Re: first grass tile

Posted: Wed May 05, 2010 9:57 am
by pritam
I think it looks good, a little bit repetitive but that's alright after some touching up.

Re: first grass tile

Posted: Wed May 05, 2010 12:15 pm
by pythip
@Live-Dimension, I basically just used different filters to get different effects.

This is my second attempt, which is just the first one, but I did some more work on it. I think one of my problems with the first one was there was too many shades of colours in it, made it too hard for me to make it the way I like it. This new one still has some of the diagonal thing, but since there are a lot brighter colours, I don't think it stands out as much, I think this one works better, any thoughts?
grass2.png
grass2.png (1.41 KiB) Viewed 1915 times

Re: first grass tile

Posted: Wed May 05, 2010 12:45 pm
by pritam
It lacks some contrast, but definetly works.