They're not waterproof, but they are official Bicycle Playing Cards. I imagine a game would go pretty well for players who happen to like Kassandra. The real question is what would Kassandra's game be? Poker, blackjack, go fish? A game with extremely high stakes?
This started out as a way to test and quickly roll through some animation I'm working on, and I thought it would be cool to share some of it with you. (I'm building on a thousand informative Cocos2d forum posts, and the animation tutorials by Ray Wenderlich and the rocking team at Get Set Games--so check out their blog posts on animation, awesome stuff).
One of things I love about the Cocos2D framework is how easy it is to set up a batch of animations and then shift between them with a call. So, you can load a spritesheet (an image with a bunch of images--sprites. These can be a sequence of frames in an animation--or more likely a bunch of sequences showing your characters, space ships, asteroids, frogs, sea dragons in different states--fighting, swimming, running, falling, etc.) and in the course of play and state change, your app shifts to different blocks of animation.
Here's a shot of a sea dragon animation I'm drawing--making it easy at this stage by doing everything on one side and mirroring it for the other:
There are certainly better ways to display animation in a real game, but for my test app I've set up a SeaDragonType, placing this in SeaDragonScene.h
typedef enum
{
DragonTypeLiving = 0,
DragonTypeDead,
DragonTypeGlowing,
} DragonTypes;
And then I keep track of which dragon type is being displayed at the moment, looking for a screen tap to rotate through the dragon animations.
Essentially, it's
What dragon do I want to show now?
Run the action for that dragon type.
Stop the action for the prior dragon type.
_dragonType = DragonTypeDead;
[_spriteDragon runAction:_undeadAction];
[_spriteDragon stopAction:_liveAction];
I'm using Zwoptex (http://zwoptexapp.com) to create spritesheets. See Ray Wenderlich's post and the Zwoptex site for details on how to use the util. Powerful stuff. Here's my sheet for this app, three variations of the same sea dragon, a healthy living version, a sort of glowing one, and an undead version, each with the same bit of flipper action.
Using the Accelerometer on the iPhone and iPad to manipulate your sprites
This is easier than you might think. Let the app know you want to use the accelerometer up in your init:
// enable accelerometer
self.isAccelerometerEnabled = YES;
And then drop in the accelerometer callback, which let's us know what's going in with the device. (Debugging on the device is necessary for this, so set your target for Device and run to see this work). It doesn't do a lot, simply rotates the dragon--positioned in the center of the screen--in the direction the user tilts the iPhone/iPad.
- (void)accelerometer:(UIAccelerometer*)accelerometer
didAccelerate:(UIAcceleration*)acceleration
{
static float prevX=0, prevY=0;
#define kFilterFactor 0.05f
float accelX = (float) acceleration.x * kFilterFactor +
(1- kFilterFactor)*prevX;
float accelY = (float) acceleration.y * kFilterFactor +
(1- kFilterFactor)*prevY;
prevX = accelX;
prevY = accelY;
_dragon.rotation = - (-accelX * 120);
}
Supporting different screen orientations in Cocos2d
I've basically swiped the UIKit rotation code Frogblast posted on the Cocos2D site, and included it in my test project to see what happens to the animation when I turn the device around. This method pushes the rotation handling off to a UIViewController (MultiplatformViewController) I'm using the UIInterfaceOrientationPortrait and UIInterfaceOrientationPortraitUpsideDown, and ignoring landscape views.
Here's the SeaDragonTest project zipped. I'm using Cocos2D v0.99.4 (current stable release) and iOS 4.1 SDK.
Have fun. Make something cool with Cocos2D!
.
Keeping in mind that this is a work in progress—with a very concrete short term goal of getting feedback on an application for the iPad, here are the elements of the version 1.0 structure: Home, Content, About, Links, Settings, and Game. My ultimate goal, after sorting out what works and what doesn't, is to build a reusable framework for just about any book. Drop in art, animation, music and effects audio, sample chapters, author photo, links, a little bit of custom configuration, and you're ready submit to the iTunes app store.
See the workflow "poster" below--click on it for the full view. I've also included a download link at the end of this post if you want the printable full view, 13 x 19 inches at 300 dpi, about 20MB.
To test drive this framework I'm using my first novel, Seaborn (Juno Books, 2008), and it will feature a fast paced, animated, deep-sea diving adventure called "Jelly Jam"--blogged about it here:
"Enhanced ebooks" and the near-future of book promotion
and also see my first post on this idea here:
All the screenshots in the poster below (except the About and Links pages, which I'll put together last) are from the latest built of my actual working app on the iPad. The game is working, with two levels complete. It scores and saves points, tracks jelly stings and, if you avoid any in one of the six waves you have to go through in each level, you get a "No Sting Bonus". The game starts out relatively easy while players get the feel of swimming, speeding up, slowing down, maneuvering, and using the various tools like Light and Shields. Also, it's not all avoiding jellies. There's a batch of mean squid, there are zombie jellies that you want to avoid and destroy.1. Online high score tracking
2. Paging for content with gestures
Workflow (CLICK FOR THE FULL VIEW):
Download the printable view of the workflow "poster".
.
I'm designing a framework for a book promotion app--a framework that will allow me to drop in content, a bit of custom work, and create something exciting and fresh for just about any book. The first title is Seaborn--really a first test of this framework to get it out there, into the app store, get some feedback, and then come back and refine everything. The general idea is an app that showcases a novel's story, characters, art, notes, author info and linking, all wrapped around a complete (animation, music, scoring, progression, etc.) and engaging game based on the world, characters, scenes, or ideas from the book.
And I'm nearly complete with the first iPad book/game app...expecting to wrap it up this week.
Seaborn--the app--will feature a fast paced, animated, deep-sea diving adventure called "Jelly Jam"--which, although there are boatloads of Cnidarians (the phylum that includes jellies, sea anemones, corals, etc.), it also includes what I think are some cool visual bursts of action--the one with Kassandra rocketing past a whale in the abyss gave me goosebumps. It's one thing to know your characters, having written books about them. It's also one thing to draw and paint your characters. Somehow--I didn't expect it--it's entirely another thing to see your character in motion. Unexpectedly beautiful motion.
A bunch more to say at this point, but I'm tired, and I'm going to sleep.
Here's a batch of screenshots of a test sequence on the iPad--and I'm telling you, as stills, these just don't do the game justice. Here's the one that gave me goosebumps--I'm playing a game, and it's like I'm in the freakin' story. I've designed this game, created this look, every animation, coded it all, and still it shocked me to see my character shooting past this whale in the deep blue.
Click on the others to see the full view.
Love to hear what you think! Email me at [email protected]
.
Screenshots of a working piece of a game:
And if the bad guys get you...
I was up way too late painting in Art Rage last night. I must have cleared layers twenty times before I settled on a fierce gamer, old-school percentage dice thrown, right hand doing a full on Darth Vader crush all resistance fist--you know, somewhere between making a fist and a claw. This idea came out of a comment conversation with irulan_amy who's going to feature my art and/or writing on the geekfemme blog next month. What's a feature without some art to go with it?
Click for the full view!
.
What color is your thumb? Are you brilliant green,
a desert-maker, are you a Wednesday Addams sort of gardener (poisons and irritants),
flowers only, veggies only, wildflowers, weeds? If you don't garden, what would be your ideal place for plants if you did? Forget time, money, land--say you had everything you'd need to get started on whatever particular green leafy adventure you like.
Alice is the gardener in the family, not me, but I'm pretty sure I can take care of plants. The question is what would I want in a garden? I'm leaning toward seaweeds, probably brown algae like Macrocystis sp.--I mean, if you're going to grow something--and there's no limit on cost, make it different, right? And by "different" I mean make it the "fastest linear growth of any organism on earth." (Stop it. No, there's no deeper meaning here. I just think giant kelp is cool. Okay, I can't resist. Two words: Kelp Spam).
Alice is not only the gardener, she's also the most devastating Plants vs Zombies game player out there. (In deep zombie dens around the world, the name "Alice" is spoken with awe. Zombie kings fear her, zombie children are threatened with her name and gardening skills). Me? I'm a newb. I played my first game ever last night, spent about two hours hooked, and dropped a ton of zombies, even a few of those bastards with screen-door shields. Eat mushroom poison, zombies!
If you haven't played, check it out here: http://www.popcap.com/extras/pvz/ and also try the "Zombator" which lets you create funny what-if-you-were-a-zombie avatar images like the guy up on the top left--yeah, that's me as a zombie. Yes, of course I'd dye my hair a cool purple and wear nothing but black turtleneck sweaters. You think I'd stop being a writer just because I'm undead?
.
Alice and I walked up to the Stratham town center to vote a few hours ago, setting out just before the polls opened. We're in New Hampshire, and everything opened here at 8 AM. Parked voters' cars line our street.
Lines were long, but wouldn't have been too bad if I wasn't already sick--I'm down, as they say, with a wicked awful cold. Anyway, long lines, got through them, went behind the curtain, filled in ballot, and slid it into the machine.
While standing in line talking, it occurred to Alice and I that Chloe--our oldest child--will be able to vote in the next presidential election. Isn't that crazy?
If you don't already know, the image on the left is from the cool Yeti-bama t-shirt from the coolest of cool design companies, Gama-Go in SF. They're all sold out, the proceeds went to the Barak's campaign.
SF & fantasy author of Seaborn, Illustrator of steampunk cities, software engineer
Recent Comments