Building an iphone puzzle game

bbparisbbparis Member Posts: 5
edited November -1 in Working with GS (Mac)
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 ?

Comments

  • joshmiller602joshmiller602 Member Posts: 206
    Welcome BBPARIS!!!

    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.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You would have each puzzle piece its own actor. You could put them in a bar at the bottom and have the user drag onto the play area. Then on the whole are you would have actors kind of like a grid to detect which piece is on it. In the grid piece you would have a rule when actor overlaps with actor piece one, then you can hit the add sign and add pieces 2,3 and so one. HAve the rule for when any condition is valid. THen in the behavior part put whatever you want to happen when its the wrong piece, and example is interpolate back to the original position in the piece select bar. Then in the same grid piece have another rule when actor overlaps with (whatever the piece that goes there) and when touch is released change position to that grid piece. What all that does is check when its overlaping with any of the wrong pieces, and then sends them back to where all the pieces are, but if its the right piece when you let go it sticks there. Then you would do the same for every other grid piece except switching out the lastoverlap for whatever piece is supposed to go there, and all others in the first overlap for the wrong actors.

    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
  • frariofrario Member Posts: 164
    Woah, that's hard!

    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.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    frario said:
    Woah, that's hard!

    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.

    You could do it that way, all the constrains arent good though. THe way i described is alot easier then it seems, and has worked pretty flawlessy on device. Im not trying to bring your idea down at all, well done puttin that together. But theres nothing worse then putting a project together only to find out it cant handle all the constrains. Well done though
  • frariofrario Member Posts: 164
    You must be right. I should have red in the forum that constrain are cpu intensive but I'm still a novice with gamesalad, so thanks for remembering me that.

    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.
Sign In or Register to comment.