Building an iphone puzzle game
bbparis
Member Posts: 5
Hello,
I'm new here, and I would like to know if there is a way to view a tutorial ( video / html or pdf ) to learn how it's possible to build an iphone puzzle game, do you have an idea ?
I'm new here, and I would like to know if there is a way to view a tutorial ( video / html or pdf ) to learn how it's possible to build an iphone puzzle game, do you have an idea ?
Comments
Not sure. Haven't seen a puzzle template out there. Did you try doing a search?
Honestly...It might have to be a trial and error situation.
You can also do this with attributes, but i thought it was easier to explain like this and runs fine on a device as far as i have checked. If you need help understanding anything let me know, Hope i helped
If I had to do it, I would give a consequent number to every piece. Then put in a attribute "chosen1" and "chosen2", when you touch them.
Say you have 5 rows of 10 pieces:
Number the tiles from top left to top right, then do the same with row below etc..
Then:
If chosen2-chosen1=1 and chosen1%10 != 0
-> constrain y1 to y2 and x1 to (x2 + tile width)
or chosen1-chosen1=1 and (chosen2%10-1) != 0
-> constrain y1 to y2 and x1 to (x2 - tile width)
or chosen2-chosen1=10 and chosen1 < 41
-> constrain y1 to y2 and x1 to (x2 + tile height)
or chosen1-chosen2=10 and chosen1 > 10
-> constrain y1 to y2 and x1 to (x2 - tile height)
This should work. Just store chosen1 and chosen2 values with a switch.
When I wrote it I was thinking of a way that could allow to stick a piece to another without knowing it's place on the final composition but only comparing colour/shape, and at the same time allow the player to assemble portions of puzzle to drag all around... but cpu limits are the first sacred rule!
I've got to train harder before being really useful! :P
Edit: thinking of it, my solution was incomplete, anyway. Every piece would also have needed individual rules to stay sticked to the previous matches, and so the complexity would have been a lot incresed.
If expressions were allowed in attribute and actor names, GS would have been A LOT easier, at least in board games.