Thursday, January 13, 2011

2nd App Day

Today we made a lot of progress. We started off by figuring out exactly what our game was going to be like. We will have three different colored circles floating around the screen. The blue circle will only have to be tapped once in order for it to disappear, the yellow circle will have tapped twice, and the red circle will have to be sliced, kind of like Fruit Ninja. I am not sure exactly how we will make the double tap and the slice work, but I am hoping that Mr. Howe will blog about how this can happen.

So far, we have finished our short synopsis of our app and we are almost done with the diagram. We have also started working a little bit with the app itself. For instance, we have worked with Zwoptex and we have imported a plist and png into the resources, with the different colored circles. We have even added them into our app. Our next step will be to make a .h and .m file for both the red and yellow circles (since we already have a blue one). After this, we will work on the double tap and the slice, then we will finally work on the randomness and different levels. If we have time at the end, we will try to add a background to the app.

I am having a great time doing this. It's much harder than working with the class, but it is a lot of fun putting everything that you have learned into your own app and seeing what you get. I am very appreciative that Mr. Howe is putting up all the information on a blog, because without this, it would be insanely hard.

1 comment:

  1. Double-tapping and slicing have a couple of techniques...
    For double-taps, create a float variable in your main class (e.g., HelloWorld) called tapTimer. In update:, make the tapTimer get bigger by delta. Whenever you do a ccTouchEnded: you can reset the tapTimer to zero at the end of the function. This way, tapTimer is always keeping track of how much time there has been since the last tap.
    Next, in ccTouchEnded, (before you reset tapTimer) check it to see whether it is less than, say 0.5 seconds. If so, you've got a double tap on your hands!

    A simple swipe test might be to create a CGPoint variable called swipeStart in your header file. In ccTouchBegan:, before you return YES, record the touch location into the swipeStart variable. Then in ccTouchEnded:, you can then compare the swipeStart variable to where the touch is now. The trick then, is to figure out how to use the information in these starting and stopping points to find out if the swipe in the middle hit your target.
    I can think of another way of handling the swipe that involves recording a list of all the points the finger touches, as it moves - see me if you have questions.

    ReplyDelete