Gamesalad Recognizing 2 of the same images (when one of them is made up of multiple ones)
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
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
-
MotherHoose Posts: 2,456
@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/pointMH
Answers
Welcome by the way!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User