Cocos2d Tips: Scrolling, Parallax and wider levels

Wider Levels & Scrolling When you create a game in Cocos2d, your screen measures 960 pixels wide on iPhone4+ and 2048 on iPad. If we want him to move farther to the right then we need to make the level bigger.  Normally we set: levelSize = screenSize; But now we basically wish to make: levelSize = CGSizeMake(screenSize.width * 2.0f, screenSize.height); // levelSize code What we are doing is changing our scene levelSize to 2x the screenSize. Our level is now twice as big and we have a GameScene, which contains a GameplayLayer & a BackgroundLayer with some background image.  We want to add a layer that will scroll in the opposite… Read More

Continue Reading

How Cocos2d taught me iOS and OOP

I started studying iOS in 2009, started studying Cocos2d in 2011.  I never understood how to do things in code for iOS.   It was all a big mystery to me. What do you mean create a button programmatically and add it to the subview and position it and change its attributes?  I can just drag one from the Object Library onto the canvas and put it wherever I want and change its color etc… After a year of using Cocos2d, I know cherish its teachings as I find myself trying to make an app which requires objects such as UIPageControl and UIScrollView and UIImageViews with UIImages.  In doing this… Read More

Continue Reading

Cool Image Transparency Gradient Effect

So the other day I was trying to figure out how to do something in Pixelmator (Im pretty sure it works for Photoshop) and I accidentally stumbled into this effect. First, I opened up an image that I wanted to spruce up. Second, I Added a Layer Mask in the Layer Menu Then, I used a Transparent to Black Gradient and got this:   Why is this cool?  Well, now you can add a nice background color or even another image in the background to make some very professional looking artwork! 🙂     The original idea I was after was from a tutorial I found online which took a… Read More

Continue Reading