Category: News

Corona SVG Level Builder 1.3 features and examples!

 

The massive Corona SVG Level Builder 1.3 update has been finally released! It has dozens of new features and it finally comes with examples.

Now you can edit even more of your game properties direct into Inkscape. You will edit Lua source code only to add and take care of your game logic! Let’s take a look at the new features and at the examples!

Resolution Independence and Dynamic Scaling

Draw your levels just once and it will work for all resolutions: iPhone, iPhone Retina, iPad, Android Phones and Android Tablets.
Corona SVG Level Builder - Resolution Independent Levels
It comes with an example showing the resolution independence, so it is easy to achieve it. You just need to worry on exporting the different graphical assets on different sizes, other than that, Corona SVG Level Builder does all the job for you.

Spritesheets

Corona SVG Level Builder now loads and take care of spritesheets created with TexturePacker.

Assigning SpriteTo create levels that use spritesheets you just have to create them with TexturePacker and add one variable with the spritesheet name when you load your levels:

local level = svg:new("levelFile", {spriteGrabber = "game"})

You can have levels with:

  • Single spritesheet.
  • Multiple spritesheets.
  • Externally loaded spritesheets.

Assigning a game object with a sprite is as simple as assigning it with an image: the step is the same! Just add an image attribute with the sprite name.

Animations

Corona SVG Level Builder AnimationsTo add more sauce to the spritesheet support, you can have animated sprites and objects as simple as having static objects. By simple assigning the frame names, giving a pose name and frame positions to a game object, you can animate, change poses and pause it in your code, with methods provided by Corona SVG Level Builder (from SpriteGrabber)!

-- Grab the body with the ID you set
local monkeyNpc = level.bodies.monkeyNpc
-- Call playClip with the pose name
monkeyNpc:playClip("left")

Game Materials

This is one of the coolest additions. You can now define your materials (game objects properties) in an external file and they will persist for all your levels.

As an example let’s consider a game where you have a zombie and a type of block to construct the levels. You need to make 100 levels in Inkscape. If you had to define your block properties along 100 levels, this would be too time consuming. And what if you had to update properties (like friction) from this block? It would require you to manually edit 100 levels.

With game materials, you define and update only once, and the attributes and properties will reflect in all levels for bodies that use the materials name!

local gameMaterials = {
    brick = {
        type = "static",
        image = "brickImageName",
        width = 45,
        height = 20,
        friction = 0.5,
        bounce = 0
    },

    zombie = {
        type = "dynamic",
        image = "zombie",
        frames = "idle:1:1:100:0; walking:2:5:200:0",
        width = 40,
        height = 100,

        custom = {
            health = 120,

            lootRate = {
                coin = 10,
                ammo = 20
            }
        }
    }
}

Custom Attributes

Consider an example game where you add coins, and then you want to set the value of the coin. The “value” can be set as a custom attribute, additionally to all attributes you already add. Other examples could be the health of an enemy type, the score for a breakable block, etc.

That means: you are tweaking and editing game values in Inkscape. You don’t need to edit a line of Lua code!

You can also now set Custom Level Attributes, which allow you to set level specific attributes you can read in you game code. Examples of level attributes are the OpenFeint Leaderboard ID, Level Speed, Highscore ranks (10.000 = 1 star, 12.000 = 2 stars), whenever you need on a higher level just after loading the level, edited all in Inkscape.

Multiple Named Layers, z-ordering and object filtering

Now you can have multiple named layers, which means you can group common objects in your Inkscape drawing and treat them on your code accordingly to the layer they are in.

Also the order they are placed in Inkscape is the order that your game objects will be placed (z-ordering).

Want to put curtains above all your elements? Just move the layer with curtains above the other layers and all your game objects will be covered! I can’t imagine doing that manually in a level with 100+ elements!

Drawing Vectors and Primitives

You don’t need to always assign a sprite or image to your game objects. You now can have them in your game in the same way you drew them in Inkscape: as a rectangle, ellipse or path! Corona SVG Level Builder will even draw them with the fill color, stroke color and stroke size you choose.

Massive Documentation

Well, this isn’t new: the documentation has always been massive. But now it is even bigger! With all the new features it has grown up and got updated. You can check it here: http://levelbuilder.karnakgames.com/doc/.

Examples

Nothing better than learning by practice. Now Corona SVG Level Builder comes with source codes showing each one of its features. Some examples even add some more: what about an example with camera and level scrolling? You have it!

Let’s see a fast video showing the examples in action:

Platformer Game Kit

I’m working now on the Platformer Game Kit! Well, I think the name says it all, right? Along all the dozens and dozens of the Corona SVG Level Builder features, the Platformer Game Kit will be killer. You won’t have anything similar out there.

With the 1.3 update you can already make practically any type of level and game with the Corona SVG Level Builder, while editing your game values and properties all in Inkscape.

But, that is not enough for me: the Platformer Game Kit not only will contain the main features of the classic platformers, but will also come with menus, etc, that means: the source code for a complete game!

What now?

If you don’t have it, what are you waiting for? Go buy it now and save dozens if not hundred hours of development! Or you may consider checking all the features first? Here they are: levelbuilder.karnakgames.com!

Graphics

The 1.3 update uses Free Art Packs made by Vicki Wenderlich – http://www.vickiwenderlich.com/. All credits go to Vicki Wenderlich.

Angry Trolls and what’s coming to Corona SVG Level Builder 1.3

 

I made a slingshot game using Corona SVG Level Builder which features similar stuff as Castle Crusher and Angry Birds: characters expressions, progressive destructible objects, etc. For the shooting logic it uses Beebe’s Ghosts vs. Monsters sample code, but after that it has a complex custom camera and all the additional character and physics fancy features, plus lots of levels.

Initially this game was intended only to show Corona SVG Level Builder features, but I liked working on it so much, that it has grown up as a very playable and polished game (graphics may not look polished, but actually that’s the “troll/meme” style). It has been submitted to the AppStore already. You can follow about it in the official site www.angry-trolls.com and check it in action:

And where does all that stuff relate with Corona SVG Level Builder? First all levels are made in Inkscape and taken care by Corona SVG Level Builder. Take a look at how one of the levels look like in Inkscape:

Angry Trolls level in Inkscape

Upcoming Corona SVG Level Builder features

Next it simply contains everything that is coming to the next update:

  • Spritesheets support (TexturePacker and SpriteGrabber), with multiple spritesheets per level, persistent spritesheets, external spritesheets.
  • Dynamic scaling: draw your level only once and it will work for all resolutions, loading related graphics for the resolution.
  • Multiple layers support.
  • Composite backgrounds (images, vectors, colors).
  • Vector display objects as you draw in Inkscape (the actual support consists only in showing the physics objects assigned with images).
  • Persistent and external game materials: define all your objects in an external table and you can use them accross your SVG elements by assigning the material name to them. This makes life extremely easy, since you have to define objects properties only once. You may be wondering: isn’t there material support already? Yes, there is. But in the actual support you have to define your materials in your SVG level, for every level. This time you define them in an external lua file.
  • Mark objects as non physical.
  • Custom attributes for bodies and materials.

And an extensive list of fixes and small adjustments.

When is the update coming out?

I’m now working on the documentation, a game example and video tutorial and then it will be released!

Corona SVG Level Builder released! Get it now!

 

After two months of work, the Corona SVG Level Builder is here!

Corona SVG Level Builder is a set of libraries to be used in a Corona SDK game that allows you to create Corona SDK physics based games, levels and maps by just drawing in the free and open source vector drawing Inkscape. Everything you draw in Inkscape is automatically converted into Corona physics bodies or paths.

It supports almost every Inkscape tool, allowing the creation of simple (rectangles, ellipses) to very complex physics bodies and paths (bezier paths). Then you can set physical properties and attributes (density, friction, vertices, etc) direct into Inkscape, without ever programming them. It supports all Corona SDK physics properties.

With it you only have to program the game logic itself. You won’t have to worry about element placement and positioning, which can be very time consuming when done by hand.

You can see the complete list of features and buy it on the official page: http://levelbuilder.karnakgames.com.

What kinds of games can you make with it?

With the Corona SVG Level Builder you can create and edit Corona SDK physics based games and levels by just drawing in Inkscape and then setting physics properties with the built in Inkscape XML editor. Corona SVG Level Builder allows you to create very simple levels with just a few elements to very complex levels with lots of physics curves, complex terrains and lots of elements (example: an Incredible Machine like game).
It is a drag and drop level and physics editor.
Examples of games that can be created:
  • Platformers.
  • Top view racing games.
  • Labyrinths and mazes.
  • Slingshot based games.
Basically: any physics based game and level based game.

Big Discount

But even if it took all that time, not all planned features are implemented, including no Game Examples and no Templates. For this reason, it is being released with a price almost 65% off! Buy it now!

* Price increased by $10 on May 30, 2011. It will increase again once the first update is released. So grab it as soon as you can.


Corona SVG Level Builder: Complex Corona physics based terrains with Inkscape paths and bezier curves

 

It’s been more than one month since the first preview of the Corona SVG Level Builder! Since then I made a huge progress. It’s now possible to have any kind of Inkscape drawing as physics 2D bodies and game elements. This is going to be the perfect tool to any kind of physics driven game. I can’t image doing a Bezier curve coordinate by coordinate manually: with the SVG Parser you simply draw a Bezier Curve and it is added to your game as a Box2D static body, enabling perfect collisions and every supported Corona physics interactions.

You can create levels for “traditional” platform games (boxes, circles, curves), as well any kind of terrains, walls, etc. Take a look at this video:

Physics Materials

Next I’ll showcase physics settings and materials as well game elements templates. And then you will be ready to grab it!

Want to know more?

This is still a work in progress, so if you want to hear more about it when it is ready, you can follow me on Twitter: @KarnakGames and/or signup to my Corona Newsletter:

Karnak Games Corona SDK and Corona SDK book newsletter. Your e-mail:

Presenting the drag and drop level editor for Corona SDK with Inkscape and SVG!

 

Inkscape Level Editor for Corona SDK

I’m working on another cool Corona SDK thing along with the book: a SVG based level editor for Corona SDK!

By just dragging and dropping rectangles in an Inkscape* document you can have game levels with physics bodies deployed instantly.

No more manual physics bodies positioning and tuning! Take the pain out of level creation.

* Free and open source vector graphics editor – http://inkscape.org/

Demonstration and level creation process video

Want to know more?

This is still a work in progress, so if you want to hear more about it when it is ready, you can follow me on Twitter: @KarnakGames and/or signup to my Corona Newsletter:

Karnak Games Corona SDK and Corona SDK book newsletter. Your e-mail:

Disclaimer

This is not intended to be a competitor or replacement to the excellent Lime. Lime is totally based on Tiled. My level editor is based on Inkscape and SVG parsing (which is a XML file). Although I make use of Tiled, I don’t use the Tiled map itself, I just use the IMAGE exported from a Tiled map (File, Save as Image…).

Announcing the first Corona SDK book

 

This is something that has been on the works and I feel it’s time to start talking about it already!

I’m writing the first dedicated book about the Corona SDK, and it will be published by a very good and known publisher. Although I can’t reveal which one yet.

The book will be beginner focused, but that doesn’t mean you won’t learn advanced subjects. Also if you already are a programmer or game developer, it will help you learn Lua and the whole Corona SDK.

You will learn Lua and almost all details of the Corona SDK. The book will be tutorial and example driven: you won’t read boring texts about this or that. You will be actually making games while learning Corona! It will be a ready-to-action book.

I will try to give weekly previews about the book, this way I can get your feedback of what you think and expect. Expect more news soon!

Getting news about the book

There is nothing fancy set yet, but you can already like the Facebook page for the book, add the book’s official site to your bookmarks or follow me on Twitter, @KarnakGames.

Book newsletter. Your e-mail:

The last #iDevBlogADay for now

#iDevBlogADay has new rules, and for this reason, I have to give my spot to another person. It’s been almost 6 months of writing 4 posts per month. It was a pleasant and nice experience. And I could say that my time is over in a good moment: I have to focus on the book as well on the dozens of game development contracts I have on my hands.

That doesn’t mean the blog is over. I will keep writing and updating here, probably not weekly, but at least monthly (or weekly for the book previews). You can find constant updates from me on my Twitter @KarnakGames.

With #iDevBlogADay, my blog went from 200 visits/monthly to more than 4000, which is stable now. Thanks Miguel and all the community for the amazing #iDevBlogADay! And good luck for the blogger that is taking my spot.

Universal applications asset naming conventions, directory structure and macros

 

If you follow me on Twitter you probably noticed that I’m working on 2 Christmas games (if not, please check them here :), and both will be Universal. Since this is the first time I’m doing an Universal App (Game), I had to decide on an asset management strategy: how to manage, name and structure files for iPhone 3GS-, iPod Touch, iPad and iPhone 4?

The most common route is to name iPhone and iPod Touch’s assets as the plain name: texture.png and then for the iPad add a suffix to the file name with  “ipad”: texture-ipad.png. But going through this route add a bunch of if’s to your code to check whether the game is running on the iPad otherwise it is running on the iPhone / iPod Touch:

NSString *fileName;
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad))
    fileName = @"texture-ipad.png";
else
    fileName = @"texture.png";

Could you imagine this in a game code? Hundreds (or thousands) of additional work. I came to a simple solution: files always have the same name. The only difference is that iPhone and iPod Touch assets are inside a “graphics” folder, while iPad ones are inside “ipad/graphics”.

Wait – wouldn’t we still need to write those hundreds of if’s? Yes. But before I show you how to solve this issue, let’s talk about Folders References and Groups in Xcode.

Game Assets: Directory Structure

I’m not going to write about this subject, because there are 2 #iDevBlogADay articles (I found them via iDevBlogADay’s delicious account) on this subject and also one from Majic Jungle:

I really recommend that you read them before continuing. I’ll wait.

… ok, are you back? For my directory structure, I’m using David’s recommendations: a GameResources folder inside Resources, and then a Folder Reference (blue folder) to it in Xcode’s project. Also, don’t forget to add the script posted by David that notices Xcode of file changes and that automatically adds/removes/updates them from builds.

Directory Structure

This way you can freely add/remove/update game assets without ever worrying about referencing them on the project. Also you can have multiple files with the same name without problems (as opposite to using folder Groups – the yellow folders).

Xcode Folder References

One line macro for iPad or iPhone detection and for getting a file’s full path according to the device

How to get the path to an iPad or iPhone version of a file without writing if’s everywhere? Through a simple class (and then later a macro):

// Path.h
@interface Path : NSObject {
}

+ (NSString *)graphicsPath:(NSString*)filePath;
+ (NSString *)resourcePath:(NSString*)filePath;
@end

// Path.m
#import "Path.h"

@implementation Path
+ (NSString *)graphicsPath:(NSString*)filePath
{
	NSString *finalPath = @"GameResources/";

	if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
		finalPath = [finalPath stringByAppendingString:@"ipad/"];
	}

	finalPath = [finalPath stringByAppendingString:@"graphics/"];
	return [finalPath stringByAppendingString:filePath];
}

+ (NSString *)resourcePath:(NSString*)filePath
{
	NSString *finalPath = @"GameResources/";
	return [finalPath stringByAppendingString:filePath];
}
@end

To load a graphical asset:

// Cocos2D sprite loading
CCSprite *enemy = [CCSprite spriteWithFile:[Path graphicsPath:@"enemies/devil.png"]];
  1. [Path graphicsPath:] first sets the starting path to “GameResources”, then checks if the device is the iPad, if positive, add “ipad” to the path. So far we this path: GameResources/ipad/ or GameResorces/ (in case of iPhone or iPod Touch).
  2. Next it adds the “graphics” folder name  and then your given path, so you could get 2 different responses:
    • iPad: GameResources/ipad/graphics/enemies/devil.png
    • iPhone / iPod Touch: GameResources/graphics/enemies/devil.png

Let’s make it even simpler? Add the following macros to Path.h:

#define graphicsPath(_path) [Path graphicsPath:_path]
#define gameResourcePath(_path) [Path resourcePath:_path]

Add the following line to your ApplicationName_Prefix.pch file:

#import "Path.h"

Now every time you need to load an asset you may use these macros:

// Cocos2D sprite loading for Universal games
CCSprite *enemy = [CCSprite spriteWithFile:graphicsPath(@"enemies/devil.png")];

// Getting path to a sound asset inside GameResources/sounds/enemies
NSString *soundFilePath = gameResourcePath(@"sounds/enemies/devil.caf")];

// Getting path to a plist inside GameResources
NSString *randomFilePath = gameResourcePath(@"state.plist")];

Another useful macro for iPad detection

Even with the directory and naming question solved we may still need to check whether the application is running on the iPad or not, so I would like to share another super simple but useful macro. Add this to your .pch file:

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

Use it this way:

if (IS_IPAD)
    position = 300;
else
    position = 20;

Christmas Games

Now that I taught you the deep secrets about Universal Applications asset management, I’ll relax and tell a little about the two Christmas games I’m making.

Santa in a Hurry

Santa in a Hurry is about flying your sleigh! But you may be thinking that this is boring! What if I tell you that you are flying AND racing with your Santa holding his sleigh while trying to avoid and slide obstacles and still having to save the Christmas and avoiding different things and the BAD Santas (!?) and dropping presents and seeing nice and warm graphics and listening to Christmas musics and…. and… and…! Well, you will see!

But do you want to know the real hottest thing about Santa in a Hurry?

Once you play and complete “some things”, you will earn a present. And this present may turn itself into iTunes Gift Cards or Game Promo Codes on Dec 25th!

Present CatcherPresent Catcher is all about… catching presents! Oh, again you probably are thinking: that’s so “old”. Not with Present Catcher! Instead of telling you about it I’ll just ask that you start telling your friends about it until I publish the first screenshots and videos. Then you will see what catching presents is really all about!

Here is an exclusive conceptual screenshot of Santa in a Hurry (click to zoom):

Christmas Games - Santa in a Hurry - Night Level

Don’t forget to follow @PlayChristmas and @KarnakGames to be notified about news, and of course, there is an official site: http://karnakgames.com/christmas.

This post is part of iDevBlogADay, a group of indie iOS development blogs featuring two posts per day. You can keep up with iDevBlogADay through the web site, RSS feed, Twitter or delicious.

Santa Race and Present Catcher coming to the AppStore!

 

Prepare yourself for the BIGGEST CHRISTMAS CHALLENGE ever!

I’m excited to announce that we’re developing two games for the Christmas. They will hopefully be available on the AppStore in 15 days.

Santa Race

Present Catcher

Also, the games will come with some surprises :)
Visit the official site now to see what Santa Race and Present Catcher are all about! http://karnakgames.com/christmas

Follow us @KarnakGames and @PlayChristmas to be notified!

LH: our first game and its game design criteria

 

It’s finally time to write about Karnak Game’s first game! Let’s refer to it as LH for now. I prototyped at least 5 different games before deciding that I would make LH (all these prototypes were different games with varied mechanics and styles).

I decided to make LH because it is the only one that is capable of meeting or meets the following criteria:

  • 2D platformer.
  • Controls that make use of iPhone, iPod Touch and iPad hardware capabilities, be it accelerometer and/or the nice touch screen, instead of virtual d-pad: it’s so easy and intuitive that you can play LH even if you are holding the device with only one hand.
  • No entry barriers: you won’t have to read extensive and boring tutorials before you play the game. Just start it and play it.
  • A pick and play game: want to play your favorite level again? Want to restart the actual level? Want to skip this level and go to the next? Are you playing the game at a bus stop and the bus just arrived and you don’t want to lose your progress? Want to skip the next 10 levels? You will be able to do it (with some small restrictions sometimes).
  • Simple, memorable, fun and hysteric characters. Do you know that game about pigs and birds? Even a baby can remember about Angry Birds, because it deals with Birds Versus Pigs. LH follows the same roles.
  • An universal story: LH stands for something that every person in the world fights for everyday. It is the subject of most movies, books and poems.
  • Play it in any device: ok, by any I mean any iOS device, an universal game (iPod Touch, iPhone or iPad).
  • It meets some technical requirements proposed by players, which even John Carmack was looking for.
  • And yet it stills is innovative: even although LH is using proven mechanics and criteria it brings new elements and a new way of gameplay, which I’ll talk on future posts.

Next week I’ll show our artwork and maybe I’ll tell you what LH stands for, which means I may talk about LH game history too!

LH - Prototype 1

LH - Prototype 1

Resources:

This post is part of iDevBlogADay, a group of indie iOS development blogs featuring two posts per day. You can keep up with iDevBlogADay through the web site, RSS feed, Twitter or delicious.

And it begins!

 

It was about time! I’ve been waiting for this moment for years. I finally decided to start making games. Or I had started now or I would just give up, because I’ve been delaying this moment forever.

It’s a long story, but briefly: I started programming when I was 8 (15 years ago), because I wanted to make games. But since then, I have just worked doing software, websites and webapps for everybody, and I never touched game dev. And games have always a passion. But here I am, Karnak Games is officialy launched!

Karn… what?

If you want to know more about Karnak Games, the meaning of the name and more about me, please check the about page. I am an Indie Game Developer and I plan to write iPhone games.

And where are the games?

Our first game will be announced in this blog soon!

The blog?

In this blog you will find my development diary, along with info about the games. I’ll also try to share what I learn along the journey.