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 / 2D collision detection problem

Author
Message
fergc
16
Years of Service
User Offline
Joined: 10th Jun 2008
Location: Here
Posted: 11th Jun 2008 01:32
I am completely new to the game development (... and to C++ U^^)
I am trying to make a 2D platform game, but Im stucked in the floor/wall detection. Can someone please explain me how to make the walls and floors solid?

Please, I would really apreciatte it T^T.
sorry if my english is bad U^^
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 11th Jun 2008 19:07
dbSpriteHit ( int sprite, int target ) is one way. It returns 1 if sprite is edge-to-edge with target. If you make target 0, it returns the number of the sprite that it is hitting.

dbSpriteCollision ( int sprite, int target ) is another. It does the same, except when the sprites overlap, not when they are edge-to-edge.

For a better explanation of C++ in general, try this site:

http://www.cplusplus.com/doc/tutorial/
fergc
16
Years of Service
User Offline
Joined: 10th Jun 2008
Location: Here
Posted: 12th Jun 2008 10:13
Thanks ^^. I just tried that and really helped a lot.
There are so many DarkGDK codes that I still dont know U^^. Im starting to read and try but Im still a noob .

But now i am having a problem with the speed of my game...
How can I make a scrolling background without affecting my game speed? o.o?

Right now I am doing it with sprites (I just change the values of the coordinates depending on wich key I am pressing and then redraw the sprite on every loop) but its making it too slow ..

Login to post a reply

Server time is: 2024-11-20 13:38:58
Your offset time is: 2024-11-20 13:38:58