Try to search your question here, if you can't find : Ask Any Question Now ?

how can i make my character not stick to a "fence"?

HomeCategory: stackoverflowhow can i make my character not stick to a "fence"?
Avatarpragati asked 4 months ago

I’m trying to make a sort of fence in a game, and so far, all i have is the top and bottom of it. Problem is, when i’m right up against the fence, the charachter just sticks to it.

Here’s my code:

outbordernum = bordersout.length
while(outbordernum > 0) {
outborder = bordersout[outbordernum-1].split(", ")
if(direction == "down") {
  if(py < outborder[1] && py > outborder[3] && px < outborder[0] && px > outborder[2]) {
    return true
  }
  else {
    return false
  }
}
if(direction == "up") {
  if(py > outborder[3] && py < outborder[1] && px < outborder[0] && px > outborder[2]) {
    return true
  }
  else {
    return false
  }
}
outbordernum = outbordernum - 1
}

Is there a way i can fix this?

1 Answers
Best Answer
AvatarMannu answered 4 months ago
Your Answer

12 + 0 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com