Custom actor shapes?

freerangeeggheadsfreerangeeggheads Member Posts: 19
edited November -1 in Working with GS (Mac)
I am trying to create an event where an irregularly shaped actor will have something happen to it if it's touched, so I created a transparent PNG but the file is still picking up the part of the actor that is transparent.

Is there any way to create an actor that is an irregular shape so that if you touch outside the actor nothing happens, even if it's "inside" the transparent part of the image? Does that make sense?

Thanks!

Comments

  • Rob2Rob2 Member Posts: 2,402
    That would be polygon collision and it is on the roadmap, you can get creative with very thin/small invisible actors defining the collisions for your visible actor. :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    freerangeeggheads said:
    Is there any way to create an actor that is an irregular shape so that if you touch outside the actor nothing happens, even if it's "inside" the transparent part of the image? Does that make sense?

    Thanks!

    Unfortunately no, at this time you cannot really even mimic something like touch only affecting non transparent areas with the technique rob has mentioned. What he mentions is for actor collisions and still only really works for stationary objects.

    ___________________________________________________________________________________
    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    Expanding Option Menu Template HERE!!
    Tenrdrmer's Menu # 3 HERE!!
    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • Rob2Rob2 Member Posts: 2,402
    you most certainly can.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    You can do if touch is pressed and mouse position x and y are greater and less than target area.

    Ace
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Ace - how would you do that for a puzzle with irregular shapes? You'd have to figure out the x,y coordinates for every line of resolution. I'm trying to build a simple puzzle app. Is there a workaround, or would I need go to back to Python or C? *shudders*
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    There will be a way... There always is ;)

    Can you post images of what you mean, I'm English, but I'm crap at reading haha

    Ace
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Oh, I just mean like a puzzle puzzle like this http://www.davemanuel.com/images/google_puzzle.jpg

    if i were going to create a puzzle where you could drag and drop the shapes and lock them into place when they were dropped correctly, i would need two actors of each shape - one static stuck to the background, and one moveable.

    When the moveable actor was dragged over the correct static actor and released, the movable actor would be destroyed and the static actor would change color giving a "completed piece" effect.

    But if custom actor shapes cannot be acquired, and only rectangles and circles can be used, then it would be possible to release a movable actor over a spot occupied by two static actors. this would make creating a puzzle impossible.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    oh, you could easily do that, the snap effect would be x and y based so there is no need for the complex collision shapes, then you would just add rules that only snap to the certain x and y if it is the right way around and in the right place. I wouldn't even have physics turned on for it, I would just use x and y values and constraints.

    Ace
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    @Ace - right, but there's no way to tell which actor is being picked up. If two underlying shapes overlap, how can you tell where you are trying to drop it?

    For instance, you know those toddler puzzles that have the shapes colored on the board and you have to put the movable shapes into the right spot? Imagine that, but digitally. You pick up a piece, you move it over the board, and whereever your finger hovers, that piece lights up to activate to show, hey, this is where you're trying to drop this piece. But if the pieces underneath are overlapping because the actor shapes are regular, then many times, two options will light up at once and if a shape is dropped then, where does it go? Which piece did you MEAN to light up? I can't figure out how it would be possible without custom actor shapes. It would make for a frustrating user experience, I think.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Gimme a sec and I'll make a project file for you

    Ace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Here you go, I hope this helps:

    http://instantmashgames.com/files/Shapes.gameproj.zip

    Ace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    If you drag the Triangle into the circle it snaps back to the starting point, if you put it in the triangle, it'll snap into the hole.

    Ace
  • pazappapazappa Member Posts: 7
    Noone thanked you for this kind help so I will do it instead. Thanks :)
Sign In or Register to comment.