• entries
686
1952
• views
387836

At least it works...

108 views

Alot of you pointed out how I shouldn't be using a giant bitmap for scrolling. As such, I already fixed it. This took all but 10 minutes to complete, and makes the game look smoother during play.

The code for Blocky Man so far is so much cleaner than any game code I have ever written. It didn't take long for me to get the Tilemap drawing routine in there:
// Draw Tile mapvoid DrawMap(){     SDL_Rect rect_bg;          rect_bg.x = 0;     rect_bg.y = 0;          SDL_BlitSurface(bg, NULL, screen, &rect_bg);          int map_x = map.getScroll() / 32;          for(int i = 0; i < 15; i++)     {         for(int c = map_x; c < map_x + 21; c++)         {             SDL_Rect rect;             rect.x = c * 32 - map.getScroll();             rect.y = i * 32;                          switch(map.getTile(c, i))             {                 case 0:                      break;                 case 1:                      SDL_BlitSurface(grass, NULL, screen, &rect);                      break;                 case 2:                      SDL_BlitSurface(brick, NULL, screen, &rect);                      break;             }         }     }     }

Believe it or not, for me, that it incredibly clean.

I completed an early player class, which has no animation:

At first, it was incredibly buggy, but I've ironed out most of the bugs now. I'm still testing it though, so I can't be certain if it is completely bug free.

The method I'm using for jumping is rather simple. It is something I mentioned awhile ago in these forums. That is, taking into account some of the other posts in that topic. I think it is a good read if you're interested in how to do jumping.

So yeah, I still need to test out this class, but I plan to start working on enemies soon.

Might I suggest that you use define some constants (or what ever you do in C++...) so that eventually when you have a bigger map, or want to change the tile size that it isn't that difficult?

Looks pretty good. Good work on fixing the scrolling.

Setting some constants for tile sizes wouldn't be a bad idea, but instead I'd recommend putting them in your map structure. (That way different games/levels could use the same code and have different tile sizes.) Also, I would make your DrawMap function take the map as a parameter, rather than looking for it as a global variable.

Good job! I love the programmer art!

Quote:
 Rob Loach Good job! I love the programmer art!
Thats always the best part of his games [grin]

Quote:
 That's always the best part of his games![grin]

I don't know whether to be offended or flattered.[smile]

You should be flattered.

Create an account

Register a new account