Jump to content


Photo

Platform Code Problem


  • Please log in to reply
2 replies to this topic

#1 toahorkidatahu

toahorkidatahu

    fish out of water

  • New Member
  • 39 posts

Posted 20 May 2010 - 05:04 AM

Okay, im using a slope walking code for my platform game.

if(keyboard_check(global.kleft))
{
for (i=0;i<5;i+=1)
{
if (place_free(x-xspeed,y-i))
{
x -= xspeed
y -= i;
exit;
}
}
}

Now, the player moves if its in the air, but if its on the ground it stays put, whats my problem?
  • 0

#2 Martho

Martho

    GMC Member

  • GMC Member
  • 153 posts

Posted 20 May 2010 - 05:28 AM

Not sure about the problem but I have a platform slope engine here http://www.yoyogames...rm-slope-engine
  • 0

#3 NilsAnders

NilsAnders

    GMC Member

  • GMC Member
  • 527 posts
  • Version:GM8.1

Posted 20 May 2010 - 06:48 AM

Nothing wrong with your code, your problem is elsewhere.. Check your collision event with the ground. Try removing solids and replacing your code with place_meeting()
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users