Tag: Cocoa Touch
-
Make a Clock in Sprite Kit: Adding Animation to the Clock
In our first installment, we added a label and set up a clock. We could easily do that with a story board and a wired up label. The point of series this is to have a lot of cool animation running in Sprite Kit for a non game UI. We will begin to add animation […]
-
Living Without Storyboards or Interface Builder: Grids and a Grid Class
Using Grids As Steve Jobs liked to say… “Oh, and one more thing more thing.” In my last post Living without Storyboards or Interface Builder, I mentioned scribbling on a piece of paper. I do that often, but it is helpful to go one step further: use a preset grid. The web building world, at […]
-
from Apple to Raspberry Pi: Making Classes in Python
Objective-C and Python are similar when it comes to defining new classes, but be careful with their differences. In Objective-C we would define a class with two files: a header and an implementation file. In the header we would declare properties like this And possibly public methods In the implementation file we would have the […]
-
The Slippy Flippy Dare: How to Use Basic Physics in Sprite Kit
In the last installment of this series I showed two kinds of animation: SKAction and using the update: method from frame animation. The third major type of animation is using the physics engine. A physics engine takes the mathematical laws of physics and adds them to the scene. It removes the developer from the math […]
-
From Apple to Raspberry Pi: While Loops
In Xcode, both in Objective-C and C, we have the while loop. The python equivalent is also while Since we already understand the block, know sometimes as a suite in Python, while loops in Python are very simple to use. We can use break in a loop to break execution. This is a valid loop […]
-
The Slippy Flippy Challenge: How to Move a Sprite
Back in February, I bragged once that I could put together Flappy Bird in a week. Someone called my bluff, and I was challenged to do so. I did put together a game like Flappy Bird, and now I’ll show you how I did it. Last time we put a sprite of a penguin on […]
-
Apple to Raspberry Pi: Python’s If
In Objective-C, we would write an if statement like this: if(number1 == number2){ NSLog(@”equal”); } in Python it is this: if number1==number2 : print(‘equal’) There is no parentheses required around the logical expression. Instead of the {} to show the block to run, a colon (:) and indentations find the code to run. Note that […]