Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

If anyone wants to take a look-see...

Sign in to follow this  


I uploaded the source code for Blocky Man.

For the most part it is my usual, uncommented, messy, code. However, the player class and the tile map code are pretty nice. This game was created using Code::Blocks, probably my last game created with a free IDE.

Anyways, download it if you're interested. It's only 9kb ;)
Sign in to follow this  


Recommended Comments

I love the way blocky man continously hops if you hold down the up key. You should make a level where he can't stop jumping.

Share this comment

Link to comment
Thats cool that you released the code, I always love seeing how someone else writes their stuff.

Share this comment

Link to comment
Damnit... every time I think I'm getting close to finishing my plans for Castle Blockenstein, you go and add more work for me. Now I'm just going to have to do a source mod to make it totally complete.

I'd hate you, but I'm too busy having fun with your code [wink]

Share this comment

Link to comment
I was going to add in parallax scrolling of the background for you, but I'm getting a linker error. It seems Enemy::moveLeft (and moveRight) are missing. Was there an Enemy.cpp file that didn't get included, perhaps?

For now I'll stub them out, and have some code for you in a little while. :)

Share this comment

Link to comment
Well, that was even easier than I thought. :)

Use this instead of what you've currently got to draw that background. If the background is only 640x480, you'll see no change. If it's bigger (try a 1280x480 image) the background will scroll at a different rate than the rest of the level.

rect_bg.x = (bg->w - 640) * map.getScroll() / map.getWidth();
if(rect_bg.x + 640 >= bg->w)
rect_bg.x = bg->w - 640;
rect_bg.y = 0;
rect_bg.w = 640;
rect_bg.h = 480;

SDL_BlitSurface(bg, &rect_bg, screen, NULL);

For some reason my enemies aren't being drawn. I had to disable collisions so I could test this. I think it's probably tied to the missing code I mentioned in the last post, though, so I didn't try to debug it.

Share this comment

Link to comment
Try just putting the moveRight and moveLeft in enemy.h. That was where they origionally were, but for some stupid reason I moved them. Anyways, putting them in the header file should fix it.

Share this comment

Link to comment

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!