Jump to content

How to place sprites inside funky shaped slots


Super Pooper
 Share

Recommended Posts

Refer to attached pic. I have sprites for each of the slot shapes. The idea is that you select one of the pieces (oval or triangle sprite) and then click on the appropriate slot to set it there.  What would be the best way to determine just what that appropriate slot would be?   For example, let's say I select the oval and want to place it in the blue oval slot in the pic.  The oval sprite will have to be rotated as needed and then set within the borders of the blue slot.  How would I make the slot capture the sprite?

Would there be a way to do it with collision detection?

Otherwise, the only thing I can think of is creating a JSON file that stores all the coordinates for every slot.  When the user clicks on a slot, it will compare the coordinates of the cursor with all the coordinates in the JSON file to identify the slot.  That seems like a lot of work.

Anyone have any ideas?

image.thumb.png.294fa5a10978669d8b685e473302688b.png

  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...