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"?
pragati asked 3 weeks 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
Mannu answered 3 weeks ago
Your Answer

14 + 16 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com