• Advertisement
Sign in to follow this  
  • entries
    686
  • comments
    1952
  • views
    386917


6 Comments


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