Jump to content


Photo

Platformer Glitch


  • Please log in to reply
10 replies to this topic

#1 uberifix13

uberifix13

    GMC Member

  • New Member
  • 13 posts
  • Version:GM8

Posted 03 March 2012 - 10:18 PM

There is something wrong with my game
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!!!
  • 0

#2 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 10:27 PM

For starters you don't need that many objects, for walking and such. If you need them to walk use change sprite D&d.
How do you even jump your controls are all over place.
Alright, I see your problem just give me a minute.

Edited by DcoldSaviour77, 03 March 2012 - 10:33 PM.

  • 0

#3 uberifix13

uberifix13

    GMC Member

  • New Member
  • 13 posts
  • Version:GM8

Posted 03 March 2012 - 10:43 PM

D to walk right
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.

  • 0

#4 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16818 posts
  • Version:GM:Studio

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.
  • 0

#5 uberifix13

uberifix13

    GMC Member

  • New Member
  • 13 posts
  • Version:GM8

Posted 03 March 2012 - 10:51 PM

k i'll try

edit- how do i check for two keys pressed at once?

Edited by uberifix13, 03 March 2012 - 10:52 PM.

  • 0

#6 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16818 posts
  • Version:GM:Studio

Posted 03 March 2012 - 11:02 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!
  • 0

#7 uberifix13

uberifix13

    GMC Member

  • New Member
  • 13 posts
  • Version:GM8

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!


:wacko: Uhh... whats the gml way? i know a bit of coding but I use dnd when in a rush.
  • 0

#8 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16818 posts
  • Version:GM:Studio

Posted 03 March 2012 - 11:11 PM

GML is MUCH easier! Lets use my shift+w example again...

//IN THE KEYBOARD EVENT FOR "W"
if keyboard_check(vk_shift)
{
//two keys so do something...
}
else
{
//Normal "W" codes here...
}


Hope that helps!
  • 0

#9 uberifix13

uberifix13

    GMC Member

  • New Member
  • 13 posts
  • Version:GM8

Posted 03 March 2012 - 11:14 PM

thanks!!! also i am gonna be offline for a few hours.
  • 0

#10 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 11:26 PM

This is really weird. The only way to get unstuck from after touching the wall then the ground is to hold the left or right button and press the jump button. After debugging the problem has to lie in your object Fstand. For some reason it won't change instance to where it is walking, yet understands I'm pressing the button because I can press the D-key and press the W-key and I'll jump. Only I'll jump in the same place. I really can't tell why this is happening right now, but will keep trying.
  • 0

#11 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 03 March 2012 - 11:52 PM

I'm so dumb :tongue:
You had loop buddy. :sad: The problem wasn't in Fstand object but in both your walking objects.
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!!! :biggrin:

Edited by DcoldSaviour77, 03 March 2012 - 11:54 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users