Jump to content


Photo

move outside object


  • Please log in to reply
No replies to this topic

#1 Aero88

Aero88

    GMC Member

  • GMC Member
  • 419 posts
  • Version:GM8

Posted 27 December 2011 - 07:37 AM

Hi guys!. I am using GM 8,1 Standard, and I have a problem that is getting to be quite annoying. I simply want an object to move just outside of another object. The code I am using is this... To me it seems just fine, but it doesn't seem to work quite right. If you could take a look at it, or perhaps suggest an alternate method that would be great thanks!

//move off of the wall
        while(collision_rectangle(x-1,y-1,x+1,y+1,Bullet_Bounce_Parent,true,true))
        {
            x -= lengthdir_x(1,direction)
            y -= lengthdir_y(1,direction)
        }

For some reason it seems like it is moving it too far away from the wall... I think, but it is just acting weird.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users