Enemy with multiple parts

Hello ALL. Im trying to make an enemy character that has more than one part. For example let’s say the enemy character has a Hat on. I want to be able to hit the enemy a few times then the hat falls off. I know I can constrain the hat to the enemy but here is the problem I will have the same character multiple times on the screen, so 1. how can I put it that after a few hits to remove the constrain from the hat from the enemy, and 2 how can I spawn the same character (enemy + hat) to come out together onto the stage. Or is there a better way than constrain? thank you

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @fueguito said:
    I want to be able to hit the enemy a few times then the hat falls off.

    Make an attribute (hits), when hits > 5 then destroy the constrained hat and spawn a new one in its place that doesn't have the constrain behaviour and falls to the ground.

    @fueguito said:
    I know I can constrain the hat to the enemy but here is the problem I will have the same character multiple times on the screen . . .

    You will need to give each enemy a unique ID, make a game attribute, let's call it 'ID', as each character is spawned it changes the game attribute ID to the game attribute ID + 1 - it then copies this ID to a self.attribute - it (the enemy you have just spawned) then spawns its own hat - and passes its ID onto this hat.

    This might help for constrains:

    http://forums.gamesalad.com/discussion/62202/linkmachine

  • fueguitofueguito Member Posts: 15

    That is awesome. Thank you very much :)

  • SocksSocks London, UK.Member Posts: 12,822

    @fueguito said:
    That is awesome. Thank you very much :)

    Here's a very very (very) crude example of replacing one actor with another actor that looks the same but has different rules . . .

    Pick up the grey block and throw it at the hat, after 3 hits the hat will become loose and fall off . . it looks crap but gives you the basic theory.

    Link: https://www.mediafire.com/?365ndbiada9jyqd

  • SocksSocks London, UK.Member Posts: 12,822

    @fueguito said:
    That is awesome. Thank you very much :)

    Here's a quick (and messy!) example of giving each actor a unique ID . . .

    link: https://www.mediafire.com/?zdn53wdrj700owa

  • fueguitofueguito Member Posts: 15

    That box is hilarious :smiley: .But its perfect. that really is it, i can do graphics so not a problem for me.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @fueguito said:
    That box is hilarious :smiley: .But its perfect. that really is it, i can do graphics so not a problem for me.

    No way can you do graphics better than my 'hat', that's high quality professional graphic design you are looking, I normally charge $400 for a hat like that. :p

  • fueguitofueguito Member Posts: 15

    no i was talking about the first one you send with the word HAT! in the box lol

  • fueguitofueguito Member Posts: 15

    If you made that second one my hats off to you :)

  • SocksSocks London, UK.Member Posts: 12,822

    @fueguito said:

    Here's another method . . . I've just turned the density of the hat up very high, so it takes a few goes to dislodge it . . .

    Same deal, pick up the grey block and throw it at the hat . .

    Link: https://www.mediafire.com/?7oejbpaqlqdenku

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @fueguito said:
    If you made that second one my hats off to you :)

    I did it all myself by typing hat into Google.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @fueguito said:
    no i was talking about the first one you send with the word HAT! in the box lol

    Yes, that's what I was talking about, $400, actually the text is extra, I'd normally charge $480 for the full package of box + text :p

  • fueguitofueguito Member Posts: 15

    thx alot. this is awsome.

Sign In or Register to comment.