Computer Science Canada Need help with game |
Author: | hojo12345 [ Mon Dec 19, 2011 1:26 pm ] | ||
Post subject: | Need help with game | ||
What is it you are trying to achieve? Hi ill get right to the point. I'm am trying to recreate frostbite for my class. I can't figure out how to make the guy jump like the guy in this video http://www.youtube.com/watch?v=iajqWQjchjY&safety_mode=true&persist_safety_mode=1&safe=active What is the problem you are having? I can't figure out how to make the guy jump right Describe what you have tried to solve this problem i have tried different codes all have ended in disaster Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) i have tried this
Please specify what version of Turing you are using i am using turing 4.0.4c |
Author: | chipanpriest [ Mon Dec 19, 2011 1:32 pm ] | ||||
Post subject: | Re: Need help with game | ||||
hojo12345 @ Mon Dec 19, 2011 1:26 pm wrote:
^This is what you have This is what you need
|
Author: | hojo12345 [ Mon Dec 19, 2011 1:40 pm ] |
Post subject: | Re: Need help with game |
thanks i didn't know how t fix that but i need help on how to get the movement right |
Author: | chipanpriest [ Mon Dec 19, 2011 1:48 pm ] |
Post subject: | RE:Need help with game |
Whats wrong with the movement? |
Author: | hojo12345 [ Mon Dec 19, 2011 1:57 pm ] |
Post subject: | Re: Need help with game |
i want the image to move like on the video |
Author: | chipanpriest [ Mon Dec 19, 2011 1:58 pm ] |
Post subject: | RE:Need help with game |
aha i cant see the video cause im at school :p |
Author: | hojo12345 [ Mon Dec 19, 2011 2:02 pm ] |
Post subject: | Re: Need help with game |
you can't use Youtube at school i can |
Author: | chipanpriest [ Mon Dec 19, 2011 2:06 pm ] |
Post subject: | RE:Need help with game |
lol no :/ it sucks, i know |
Author: | hojo12345 [ Mon Dec 19, 2011 2:13 pm ] |
Post subject: | Re: Need help with game |
have you ever trying HTTPS |
Author: | Dreadnought [ Mon Dec 19, 2011 3:32 pm ] | ||
Post subject: | Re: Need help with game | ||
I'm not sure if this will fix your problem, but its the first thing that caught my eye. You have something like this
When condition1 is true do condition2 and condition3 matter? If this was intended then I apologize for bringing this up. |
Author: | hojo12345 [ Mon Dec 19, 2011 3:53 pm ] |
Post subject: | Re: Need help with game |
it's there to change my picture when i hit the left and right keys |
Author: | Dreadnought [ Mon Dec 19, 2011 7:08 pm ] |
Post subject: | Re: Need help with game |
Yes, but your code wont change the picture while jumping. And you can only jump straight up (no sideways motion while jumping). And since your asking how to "jump right"... |
Author: | Velocity [ Mon Dec 19, 2011 7:46 pm ] |
Post subject: | RE:Need help with game |
to jump right you want something like this if KeyDown (RIGHT_ARROW_KEY) and keyDown ("Your jump key") then x += 5 % how long you want to jump on the x scale y += 5 % how high you want to jump on the y scale x := x %make a new x coord for the previous command y := y %make a new y coord for the previous command end if think about this in depth and you should get a solution in place. RE : You must program the jump using a more enhanced program and implement the function use an open command. if you dont want to do that then you can just make a key command for jump like i showed above without the "and" statement and then just press the right or left arrow key while you fall from your jump or you can make seperate keys for jumping left and jump right and jumping up, and keys for just moving left, and right. |
Author: | hojo12345 [ Tue Dec 20, 2011 7:40 am ] |
Post subject: | Re: Need help with game |
i meant jump correctly i wanted to know if there is a way i can get an image or shape to be able to jump like the guy in the video i posted above |
Author: | tg851 [ Wed Dec 21, 2011 11:15 am ] |
Post subject: | RE:Need help with game |
i think he means the way the character itself moves when it jumps,arching over on the jump |
Author: | Raknarg [ Thu Dec 22, 2011 6:29 pm ] | ||
Post subject: | RE:Need help with game | ||
With some effort, it will work. I'll make a small program to show you:
I'll explain this briefly. You have your x and y, obviously. The vy is also called "the change in y". You don't want to change y by a constant amount, because it isnt realistic; therefore, we need a changing number. This will suffice. The last important one is the jumping variable, which we use to detect if a character is in the air. First, we check to see if the player has pressed the up button. If the player hasnt already jumped, then the character will begin to "jump", or we set the vy variable. The part next to it isnt nesessary. All it does it see if the player has let go while the character is jumping. If they have, it stops going up and goes down. This only happens, however, when the character's vy is greater than 0.5. After this, the function will be counterproductive. "if y < 5 then..." I set 5 to be the ground. When he goes below the ground, I say he's not longer jumping and set vy to 0. Lastly, I add vy to y and if the player is jumping, I take gravity away from vy. Thats basically it. |