Cargo-Bot – The first game on the App Store programmed on an iPad – has been released.
The Press Release follows.
Cargo-Bot
The First Game Programmed on iPad
Adelaide, Australia – April 24, 2012 – Two Lives Left and Rui Viana have released Cargo-Bot, a puzzle game where the player commands a robot to sort crates. Cargo-Bot presents players with fiendishly clever puzzles and features stunning retina graphics. It is available for free on the App Store.
Cargo-Bot was programmed entirely on iPad using Codea, a touch-based programming app for iPad created by Two Lives Left.
It’s the first game of its kind, prototyped, programmed and polished on iPad. Cargo-Bot was created by Rui Viana, a Codea user who developed his initial prototype and shared it with the Codea community. Two Lives Left reached out to Rui in order to turn his prototype into a published App Store game. They also enlisted the aid of Fred Bogg, a composer who developed a music library for Codea, to create the music for Cargo-Bot.
Coinciding with the release of Cargo-Bot, Two Lives Left is releasing the Codea Runtime Library source code under the Apache License Version 2.0. Registered Apple iOS Developers will be able to export their Codea projects into the Codea Runtime Library in order to release them as standalone apps, just like Cargo-Bot.
Adelaide, Australia – March 16, 2010 – Two Lives Left, developers of critically acclaimed iPhone game Wheeler’s Treasure announced today that, after a year of hard work and dedication, Pilot Winds has been released for iPhone, iPod touch and iPad for free on the Apple App Store.
In Pilot Winds, you play as a thrill-seeking penguin, speeding down a series of bridges that link an endless range of snow topped mountains. By holding your finger on the screen, you fall faster, increasing your speed on downward slopes, while releasing at the right moment lets you soar into the air.
Timing is everything, and if you time your presses perfectly you can reach incredible speeds! Watch out for the uphill slopes which can slow you down dramatically. However, if you manage to tap the screen just as you hit the ground you can bounce over them – maintaining your speed and giving you bonus points to boot!
This free game comes with the Mad Minute game mode, in which the player has 60 seconds to claim highscores. Players have the opportunity to upgrade via in-app purchase to unlock three more varied game modes. With exciting and interesting gameplay and many hidden combos, characters, bonuses and achievements! Pilot Winds also features online highscores and achievements through Game Center.
Further updates are planned with additional game modes being added for both free and upgraded games in the coming weeks, as well as new themes and unlockable characters.
For updates on the game follow Two Lives Left on twitter at http://twitter.com/TwoLivesLeft or subscribe to their news feed at http://twolivesleft.com
I recently had to implement a 2D conveyor belt animation in code, where sprites had to rotate around a capsule of any size with a constant velocity. It turns out it is pretty simple, but it required a few hours to figure it out. I’m posting the math here for anyone who is interested.
This is an image of what I am talking about. (Sorry about the MSPaint artwork, I’m just a programmer!) This shape is defined by 2 parameters. L, the length of the line on the top and bottom, and r, the radius of the half circles.
Here is another image with more labels and examples of the sprites rotating around.
There are 4 points marked here: t1, t2, t3, and t4. They are at the positions where the half circles at the ends meet the line segments joining them. The boxes are sprites and are supposed to be equal distances apart, and the arrows show the motion involved.
First thing to notice is that the structure is symmetric about 180 degree rotations, so for now I’ll just work on half of it.
I’ll work in units from t=0 to t=1, where t=0 is the point t1, and t=1 is the point t3.
You might recall that the arclength of a segment of angle a (in radians) on a circle of radius r is a*r. This means the length around the end from t1 to t2 is pi*r (another way to think about that is that its half the circumference of the circle).
The length from t2 to t3 is L.
The trick to the solution is finding the value of t2 from [0,1], then interpolating on the circle or the line depending on which side t lies.
Of course, we could set t2 to anything, but if it is too small, then the sprites will zip around the circle too fast (and slow down when they reach the line segment), or if it is too large, then the opposite will happen (they will speed up when they reach the line segment). We want to find the value of t2 that will maintain a constant velocity around the corner and along the edge.
Seeing as the total length around the corner and along the line is 1 t unit, we can equate this to the length in physical units. This is L+pi*r. Ie, converting from physical units to t units means we have to divide by L+pi*r.
Now, the point t2 is the proportion of the distance around the corner with respect to the total distance. This is pi*r/(L+pi*r) in t units.
So now, we interpolate the angle and calculate the position on the circle for points with 0 <= t <= t2. ie,
a = -pi/2 + (t/t2)*pi*r (the angle in radians around the half circle, starting at -pi/2 and going to pi/2)
p = (cos(a)*r+L/2, sin(a)*r) (we add half of L to x in order to move it right)
(assuming we are using the center of the capsule as the origin of the coordinate system)
As a side effect, we can also save a in order to rotate the sprites when we render them.
Now, if t2 < t <= 1:
a = pi/2
p = ( lerp(L/2, -L/2, (t-t2)/(1-t2) ), r) (lerp means linear interpolation, ie go from (L/2, r) to (-L/2, r) as t goes from t2 to t3)
That is it for half of the animation. Now you just need to modify it, so that it is flipped for t from 1 to 2
if t>1: #assuming t < 2 still, though I guess you could just take the fraction part
t -= 1 #make t go from 0 to 1 again
p, a = calculate pos as above
p = (-p.x, -p.y)
a += pi
And that is it. Good luck if you use this! It makes for a neat effect.