A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Puzzle Pieces

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Location
    The other side of the shotgun
    Posts
    17

    Puzzle Pieces

    hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
    www.newgrounds.com
    #41 Popularity

  2. #2
    Senior Member tigersbite's Avatar
    Join Date
    Apr 2002
    Posts
    314
    Test to see if the piece is within a range instead of exact coordinates.
    for example:

    if ((_x> targetX-10 || _x<targetX+10)) && (_y> targetY-10 || _y<targetY+10))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center