Computer Science Canada game that wont jump?? |
Author: | pokerface [ Fri Jun 03, 2005 6:58 pm ] | ||
Post subject: | game that wont jump?? | ||
i have no idea what so ever on how to make my red dot jump this is the code:
im new to part of turing (part= to gui movement) |
Author: | Cervantes [ Fri Jun 03, 2005 7:16 pm ] |
Post subject: | |
Here's links to two threads that you should read, regarding jumping. I think they will answer your questions. http://www.compsci.ca/v2/viewtopic.php?t=7019 http://www.compsci.ca/v2/viewtopic.php?t=6431 There's a rather long post be me in this first link (several posts down, you can't miss it ) that should be all you need. But there's more material if you wish. |
Author: | pokerface [ Fri Jun 03, 2005 9:19 pm ] | ||
Post subject: | |||
this may sound funny but how do i make a different platform for my character to jump on!!! i made the line
and now i want my character to stop on top of it when i jump on it? other words how do i make this platform a soild? |
Author: | Cervantes [ Sat Jun 04, 2005 6:50 am ] | ||
Post subject: | |||
pokerface wrote: this may sound funny
Not at all. pokerface wrote: but how do i make a different platform for my character to jump on!!! i made the line
and now i want my character to stop on top of it when i jump on it? other words how do i make this platform a soild? You're asking about collision detection. There are several different ways to do this. One is using an if statement to check if the y value of your character is between certain values and the x value as well. Another method is to use whatdotcolour. Check out the Walkthrough. About a third of the way through there is a link to collision detection and another just after it to whatdotcolour. |
Author: | pokerface [ Sun Jun 05, 2005 12:14 pm ] |
Post subject: | |
no how many times i read the tuts i cant understand what to do with my line!!! please someone tell me exacly how to make it so i could learn from it and make more lines with the same formula!!! i really been reading and reading but i cant put it all together !!!!!!!!! PLEASE HELP!!!!!!!!!!! |
Author: | Cervantes [ Sun Jun 05, 2005 1:11 pm ] | ||
Post subject: | |||
Here's some simple jumping with whatdotcolour detection:
Notice, however, that you can do some funky things, like if you jump off the platform and then start to move back towards it while in mid jump, you can sort of hang on the bottom of the platform, if timed correctly. To fix this, you'd need to check more than just directly under the player. You'd have to use a for loop and check all across his width. |
Author: | pokerface [ Mon Jun 06, 2005 8:05 pm ] |
Post subject: | |
i could give my character a radius that would do the same thing as what ur saying with the for loop? |
Author: | Cervantes [ Mon Jun 06, 2005 8:27 pm ] |
Post subject: | |
Just giving it a radius doesn't help. What I think you are saying is check at his left and right edges, as well. Well, kinda. What I'm suggesting, however, is you check every single pixel in a horizontal line underneath the character. Now, provided you don't have any platforms that are one pixel wide, you could only check every other pixel. If you're smallest platform is 5 pixels, wide, you could check every 5 pixels. You should, however, at least check on either side of the character. |
Author: | pokerface [ Tue Jun 07, 2005 3:21 pm ] |
Post subject: | |
hey i just wanted to let u guys see what i got so far. please tell me what u think! |