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 Game Questions

Author
Message
TheRensRens
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 12th Jan 2010 13:52
I have a few Questions about 2D game Making

- I have a map with a TileSet, but now I want to know how to make a collision for some tiles
- I tried to make a Jump code but it doesn't work, The sprite is flying when I press the Up key,
How to make a good jumping Sprite
- does Anybody has an tutorial for making a title screen ect.?

Already Thanks
TheRensRens
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 12th Jan 2010 21:52
1. well, you can constantly check a sprites position to see if it would overlap with that tiles position and range
2. make sure the sprite comes down, either with a max jump height, a jump halfway marker, or use a parabolic function to measure height, with the format "-(speed of falling)*(time)*(time)+(speed of jump)*(time)+starting height" when the jump key is hit, and check for collision with the ground in #1
3. well, just make it so that it looks like its jumping
4. for now, you should try to use the dbText function for menu buttons, while loading and then placing a background image. you can then check if the mouse is in the button when a click with dbMouseX() and dbMouseY(), and when the click occurs, run a for loop for all your buttons and check if the mouse is inbetween their inner and outer coordinates.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
Dragon_Soldier
14
Years of Service
User Offline
Joined: 2nd Dec 2009
Location:
Posted: 16th Jan 2010 00:17
OOOOOOOO,
I KNOW HOW TO MAKE IT JUMP,
sorry for the caps, but I just went throught the whole making a sprite jump dillemma,
This is for a jump with gravity (goes up, then slows down, goes down, and speeds up) and it lands where it started.



HERE IS THE CODE...


as for checking if the sprite has hit the ground...I beleive that is not a good way if you hae platforms or more than one thing you can land on therfore I made my jump end where it started...At the moment I am trying to see if I can stop my sprite from going through platforms....

ok well that should work and stop gravity from affecting the sprite
while its jumping

good luck with your game

Login to post a reply

Server time is: 2024-11-19 11:05:34
Your offset time is: 2024-11-19 11:05:34