Just finished my 2nd app, and trying to get into the games area now. I'm really interested in doing a jigsaw or slider puzzle game but not sure how to even start this.
Do I use cocos2d? I've read on google that there used to be some sample code on the apple website. Could anyone point me in the right direction at all?
I've been doing research but there isn't really much out there.
Location: iTunes store : Scrambleface otherwise Scotland
Posts: 262
Quote:
Originally Posted by hodgey87
Hey guys,
Just finished my 2nd app, and trying to get into the games area now. I'm really interested in doing a jigsaw or slider puzzle game but not sure how to even start this.
Do I use cocos2d? I've read on google that there used to be some sample code on the apple website. Could anyone point me in the right direction at all?
I've been doing research but there isn't really much out there.
Cheers
Lee
I wrote Scrambleface in straight objective C as it is something very different and the daddy of all sliding puzzle games (it makes a puzzle straight from the video output from the camera(s) on the device). Writing a basic non video one in cocos2d would be very similar. I know of no decent sliding puzzle tutorial available on the net.
Do remember only certain starting combinations are solvable!
If you want to make sales you have to have a hook - theres 1000s of sliding puzzles out there!
I can't help you with cocos2d, but I can help you with this:
Quote:
Originally Posted by suksmo
Do remember only certain starting combinations are solvable!
How to detect an unsolvable configuration. I've programmed Photoscramble, which is also a 15puzzle clone with grid size 3x3 up to 8x8. When you randomly scramble the tiles, a puzzle is only solvable if an even number of inversions (switches) is needed to solve it. You can count the number of pairs where a larger number is in front of a smaller one. For example in a 3x3 puzzle:
5 3 4
2 6 1
8 7
When you look at this as a 1-dimensional array it would be (5, 3, 4, 2, 6, 1, 8, 7, 9) where 9 is the empty part. Then count the pairs where a larger number is in front of a smaller one -> 53 54 52 51, 32 31, 42 41, 21, 61, 87 this equals 11 pairs, 11 inversions are needed. This is not an even number, thus this configuration is unsolvable. If this is the case you can simply switch two arbitrary tiles to make it solvable. For example the first two, in the example 5 and 3.
I want to build a Jigsaw Puzzle game as well for the iPhone, but as I'm bit inexperienced in objective-c, I'd really appreciate some help. I recently finished watching the Stanford iTunes U materials, so I know how to build simple apps, but I'd need some help with this one.
Has anybody found some great links or examples besides the ones that were previously mentioned?
Hey guys, I got the jigsaw puzzle code as well. It programmically adds everything to an XIB. When you rn the project it automatically goes to the puzzle. Now i want to show a main menu screen before the puzzle actually starts. I added a SubClass with XIB to the project. How can i get this to load first before the puzzle?
A already tried remaking the project in a ViewBased application which worked and added a button that would take you to the puzzle when you click play, but it has a EXC BAD ACCESS error. Any ideas?