Gamesalad Recognizing 2 of the same images (when one of them is made up of multiple ones)

samircalviniyersamircalviniyer Member Posts: 16
edited April 2012 in Working with GS (Mac)
Dear Gamesalad Community,
I (a 15 year old) have been inspired by TShirtBooth's games and videos so I have started to make a new game. I wish to make a game where you need to make a object to match the picture supplied. However, is it is possible for game salad to recognize two different pictures (which are identical) where 1 of them has multiple object on them?

If this is not clear, imagine you need to make a football, but all the stuff and patterns are on the football need to be dragged on. If done correctly, the football you made will be identical to the football picture supplied.

I really would be grateful if someone could help.

What attributes would I need for this to work?

Cheers,
Samir

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    @samircalviniyer … agree with all … age is not relevant to skills in developing …
    so no bragging rights here for youth …

    as for your problem …
    make some notes for yourself and define what you want to have happen
    -user has pieces of an image … that can be combined/placed to match the image
    -to match correctly … those pieces must be in a particular place (correct X,Y)
    you in effect give the user a jigsaw puzzle to complete

    import your complete image into GS
    in your graphics program … chop up that image into the number of pieces you want
    -save each piece as a separate .png
    import those pieces into GS

    gameAttributes (1 for each piece) … boolean type … piece1; piece2; etc.

    add Actor for the whole image
    Rule: when (All)
    -Attribute: game.piece1 is true
    -Attribute: game.piece2 is true
    etc.
    --whatever you want to display for solved

    add Actors for each piece:
    actorAttributes: (2) … real type … correctX; correctY (fill with correct positions)
    actorAttribute: index type … my# … and make unique for each piece

    (your constrain to touch rules)
    Rule: when (All)
    Attribute: self.Position.X = self.correctX
    Attribute: self.Position.Y = self.correctY
    -Rule: when
    -Attribute: self.my# = 1
    --changeAttribute: game.piece1 To: true
    (you need nested rule for each piece number)

    above is example code syntax … not specific … try with 2-3 pieces to test

    Simply:
    computers store images in code … i.e. not as a visual elements
    the images are stored/referenced by id# … in a pixel/point colorCode array
    when displayed the pixel/point Color of the screen becomes visible for each pixel/point

    image MH

Answers

  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Yeah!, Search "End of the earth" in the app store, It was made with GameSalad by @gyroscope
    Welcome by the way!
  • samircalviniyersamircalviniyer Member Posts: 16
    oh wow! I see luckily the game is not the same concept that I have (phew) but it does show what I wanted to do. Where can I find the attributes that are required to make such a game?
  • ZoytZoyt Member Posts: 374
    Basically, have an object for each piece's place. The piece would detects if it collides with the object. When dropped on it, snap the object into position.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You could also have a table with each correct piece's x and y positions. Then check the magnitude (distance) from the piece dragged to the correct x and y positions. If the magnitude is small enough, award the player with a correct placement.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.