dress up game problem

kesh17akikesh17aki Member Posts: 8
edited August 2012 in Working with GS (Mac)
hello. i really need help on how to drag and drop items to an actor ..like a dress up game, i really don't know how to snap the grids.
the scenario looks like this;
i have an actor named dodong. and the concept of this level is to dress him up. i have 4 actors. the shirt, pants, and a pair of shoes named shoe_1 and shoe_2. how can i snap these actor to my actor dodong,? like when i drag his shirt, it will automatically drop or snap to dodong's body when i release this actor. i really need your help .. thanks :)

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    edited August 2012
    @zombieadik17 … so many different ways to do this!

    try using a table for correct positions of clothing
    row for each item of clothing; column1 for X position; column2 for Y position
    in Home … Actors tab … add tags for shirt; pants; leftShoe; rightShoe

    have small invisible sensorActors on areas for clothing
    Example: sensorActor named shirt

    gameAttribute: collideItem … text type

    on sensor named shirt:
    Rule: when
    Event: overlaps or collides with actor with tags shirt
    changeAttribute: game.collideItem To: self.Name

    on items:
    Rule: when
    Event: overlaps or collides with actor type sensor
    Attribute: self.Tags = game.collideItem
    -changeAttribute: self.Position.X To: tableCellValue(selectTable,correctRow,1)
    -changeAttribute: self.Position.Y To: tableCellValue(selectTable,correctRow,2)

    image MH
  • kesh17akikesh17aki Member Posts: 8
    thanks a lot,, i tried it but i can't drag the shirt. is there any way to make it drag along? :)
  • kesh17akikesh17aki Member Posts: 8
    i used this rule to drag this shirt:
    if actor receives this event: touch is pressed
    change attribute: self.drag to 1
    otherwise
    change attribute: self.drag to 0

    then another rule:
    attribute: self.drag = 1
    constrain attribute: self.Position.X to game.Touches.Touch 1.X
    constrain attribute: self.Position.Y to game.Touches.Touch 1.Y

    then i added the rule that u gave me recently.
    actor receives event: overlaps or collide with actor of type sensorActor_shirt
    attribute self.Tags(when i used this attribute i only saw 4 options: contains,begins with,ends with,and is. i didn't see the = sign so i used:contains) contains self.Name

    change attribute: self.Position.X to tableCellValue(game.clothing position, game.collideItem,1)
    change attribute: self.Position.Y to tableCellValue(game.clothing position, game.collideItem,2)

    the sequence in the tableCellValue is first:
    game.clothing position- name of my table
    game.collideItem-name of my attribute that i added in the game attribute
    1 - is for the 1st column(which is my X column) in my table clothing position
    2 - is for the 2nd column(Y column) in table clothing position
Sign In or Register to comment.