Platformer Glitch
#1
Posted 03 March 2012 - 10:18 PM
when i jump into a wall i fall and get stuck[falling is supposed to happen getting stuck isnt]
when i jump onto a floating block i get stuck
see for yourself here: http://dl.dropbox.co...avShifterX.gm81
please can someone fix this!!!
#2
Posted 03 March 2012 - 10:27 PM
Alright, I see your problem just give me a minute.
Edited by DcoldSaviour77, 03 March 2012 - 10:33 PM.
#3
Posted 03 March 2012 - 10:43 PM
A to walk left
walking right and w is jump right
walking left and w is jump left
walking right and space is slide right
walking left and space is slide left
edit- if you can can u make this all 1 obj please?
Edited by uberifix13, 03 March 2012 - 10:44 PM.
#4
Posted 03 March 2012 - 10:47 PM
edit- if you can can u make this all 1 obj please?
Erm... do it yourself? Thatīs the best way to learn! Itīs easy, all you have to do is in each keyboard event have the sprite change and place the movement codes.
#5
Posted 03 March 2012 - 10:51 PM
edit- how do i check for two keys pressed at once?
Edited by uberifix13, 03 March 2012 - 10:52 PM.
#6
Posted 03 March 2012 - 11:02 PM
So, say you want to check "shift" and "W"... You would create a variable in the create event called "modify" or something and set it to 0. Then in the KEY PRESS event of "W" AND the KEY PRESS event of "shift" you would then add 1 onto "modify" (set the variable to 1 and check the relative box). Next, in the KEY RELEASE event for those two keys you would take one off "modify" (set var to -1 relative). Finally, in the NORMAL KEYBOARD event you would have :
test variable "modify" equal 2
open block
whatever here as BOTH keys are pressed (it equals two)
close block
else
open block
whatever here as one key is pressed
close block
There you go and I hope that helps!
#7
Posted 03 March 2012 - 11:08 PM
Have two key checks, but in DnD itīs more complex and normally you would have to set a variable to achieve this as well...
So, say you want to check "shift" and "W"... You would create a variable in the create event called "modify" or something and set it to 0. Then in the KEY PRESS event of "W" AND the KEY PRESS event of "shift" you would then add 1 onto "modify" (set the variable to 1 and check the relative box). Next, in the KEY RELEASE event for those two keys you would take one off "modify" (set var to -1 relative). Finally, in the NORMAL KEYBOARD event you would have :
test variable "modify" equal 2
open block
whatever here as BOTH keys are pressed (it equals two)
close block
else
open block
whatever here as one key is pressed
close block
There you go and I hope that helps!
#8
Posted 03 March 2012 - 11:11 PM
//IN THE KEYBOARD EVENT FOR "W"
if keyboard_check(vk_shift)
{
//two keys so do something...
}
else
{
//Normal "W" codes here...
}Hope that helps!
#9
Posted 03 March 2012 - 11:14 PM
#10
Posted 03 March 2012 - 11:26 PM
#11
Posted 03 March 2012 - 11:52 PM
You had loop buddy.
Look at your Fstand when the player presses A or D it changes to one of the walking objects.
Now when in both your walking objects gamemaker sees an collision event with the block.
In that event your saying when it is in contact with that block to change instance back to Fstand.
Then when you press A or D again in the Fstand object it does the same thing again starting a loop.
I'm guessing you meant to put vspeed=0.
To be clear put vspeed=0 instead of the change instance and you'll be good!
I suggest you also put your movement into 1 object or else that can easily happen again. And it's only going to get harder to find the problem later with more objects and such if keep it the way you have it.
Do that and your good to move on in your game!!!!!
It looks nice too!!!
Edited by DcoldSaviour77, 03 March 2012 - 11:54 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











