Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprite Collision, platforms and walls help.

Author
Message
Netjack
15
Years of Service
User Offline
Joined: 18th May 2009
Location:
Posted: 4th Jun 2009 20:06 Edited at: 5th Jun 2009 06:16
I miss spelled collision, I feel smart.

So here is a long one.

I need help with a better way to have sprites in my program bumping into each other.

As of writing I have discovered the commands dbSpriteWidth and dbSpriteHeight so I do not know if those are of any use yet.

My two main goals is to have workable "walls" and "platforms" walls seem easier, but with platforms, I can not figure out how to make the sprite to return to its original location on the "ground level". Nor will the jump function I have want to recognize its new location.

The walls themselves I feel like I cheated because all I have it doing is when the player sprite comes into contact with a wall sprite, it will simply push him back one more then his movement speed, making it of course impossible to pass, but has this obvious look about it, as you hold down the button, they sprite will effectively "rock" back and forth against the "wall", which looks too fake. Strangly enough if I put it as the same value as speed, the player will still be able to pass through it.

The platforms right now simply move me up the Yaxis. I of course stay there since I haven’t made a type of gravity that is constantly going on. I do not know how I would do this.

When the sprites are created, they actual locations where they seem to “activate” is far away from the actual image of the sprite, its not even centered, the player sprite might move half way through the “wall” sprite for actually being pushed back.



Player.cpp


Input.cpp


Main.cpp


Player.h


Input.h


Colision

Login to post a reply

Server time is: 2024-11-25 10:45:09
Your offset time is: 2024-11-25 10:45:09