IwGame 0.4 Coming Very Soon – IwGame is Going Portable


Awesome news. IwGame 0.4 is on its way, we are aiming for a release this week (with a little luck). Be warned there are a mass of changes and fixes as well as some awesome new features.

We are also abstracting the Marmalade SDK out of the IwGame engine so it can be easily ported to native platforms. This is not to say that we will no longer be supporting Marmalade, we still love Marmalade and it will remain a target platform that IwGame can link with, although you will require a Marmalade license to use the Marmalade version of IwGame.

This weeks release will not be fully portable as we have just started the platform abstraction process. We will be working on porting IwGame to Windows, Mac, iOS, Android, WP8 and possibly BlackBerry OS 10 over the coming months. The final portable version of the game engine (IwGame 0.5) will be renamed to give it its own identity. The tentative new name will be the “Core Engine”

Our aim is to provide a commercial grade stand alone cross platform mobile and desktop game and application SDK along with a rapid application development system that requires no compilers or IDE’s and simple single click deployment and testing.

Space Duck Hunting – Made with IwGame

We are very pleased to announce that “One Man Army” have just released their latest game “Space Duck Hunting” for Android using our very own IwGame Engine.

Here’s a little info about the game:

Game with great combination of action & logic. Kill space ducks, earn bucks, and buy specific combinations of temporary gun modes to smash ducks special formation.
You will have to spend your bucks wisely, buy the appropriate improvements, depending on the situation, otherwise you will not beat the ducks.
Face the dodgy ducks and watch out for their special attack formations, shields and mines which they use. You think ducks aren’t that clever and they’re easy to hunt? Wrong. Once you get all of them you can be really proud of yourself as it’s no small feat. Test your skills on over a dozen various levels, beat amazing records and wreak terror in the duck world. You will get a super effective steering system and an array of accesories for your weapons.
Remember, the ducks will try and outsmart you in a thousand ways, keep your eyes in the back of your head at all times, in every gameboard!
Features:
– Hours of great fun
– 16 levels to accomplish
– Great challenge
– 15 achievements to accomplish
– 5 shooting gun modes
– 12 different ducks
– great Boss on the end
– 3 different map types

You can download Space Duck Hunting from Google Play for FREE, so go grab a copy now!

The game will also be available soon on iOS

AppEasy Version 1.4.1 is Now Available

AppEasy Version 1.4.1 is Now Available

AppEasy the cross platform mobile game and app development system for iPhone, iPad, Android and Windows that is aimed at all levels of experience releases latest update

AppEasy version 1.4.1 is now available for download from here.

Please upgrade to the latest version. Note that before updating, close down your current version of AppEasy, rename c:\AppEasy to c:\AppEasy2, install and run AppEasy 1.4 then copy any changes / certificates from c:\AppEasy2 to c:\AppEasy. Note that if you install the update before renaming c:\AppEasy then simply exit the AppEasy project manager, rename the folder and run AppEasy again.

Changes include:

Project Manager

  • XML pool settings have been removed as there is now need for them now

Core Engine

  • Removed the need for setting up the XML pool system. AppEasy now pre-scans files to count the tags and attributes and allocates its own pools on a per file basis
  • VideoCam now has direction property which specifies which camera to use (front or rear)
  • actor.children() added that returns a list of child actors
  • If a File resources target Variable is an array and the files contents contains comma delimited data then the data is split at commas and added to the array
  • New SceneSwitch example added that shows how to switch between different scenes
  • BUG FIX: XML system was trashing small areas of memory

AppEasy 1.4 available – New Lua API, Web View, Ad Support, Video Cam Streaming

AppEasy Version 1.4 is Now Available

AppEasy the cross platform mobile game and app development system for iPhone, iPad, Android and Windows that is aimed at all levels of experience releases latest update

AppEasy version 1.4 is now available for download from here.

Please upgrade to the latest version. Note that before updating, close down your current version of AppEasy, rename c:\AppEasy to c:\AppEasy2, install and run AppEasy 1.4 then copy any changes / certificates from c:\AppEasy2 to c:\AppEasy. Note that if you install the update before renaming c:\AppEasy then simply exit the AppEasy project manager, rename the folder and run AppEasy again.

Lua API has had a major overhaul

We felt that the Lua API was not going in the right direction and was starting to look messy so we rewrote it. Functions have now been split up into libraries to make the API more organised and easier to use. Heres a full list of the libraries we have planned:

  • actions – Deals with XOML actions
  • actor – Deals with actors
  • brush – Deals with brushes (coming soon)
  • camera – Deals with virtual scene cameras (coming soon)
  • facebook – Deals with facebook interaction (coming soon)
  • font – Deals with fonts (coming soon)
  • sys – Deals with general system interaction
  • http – Deals with HTTP communications (coming soon)
  • image – Deals with images (coming soon)
  • input – Deals with device input
  • market – Deals with in-app purchasing (coming soon)
  • media – Deals with audio and video playback
  • physics – Deals with physics (coming soon)
  • program – Deals with XOML programs
  • resource – Deals with generic resources
  • scene – Deals with scenes
  • shape – Deals with shapes (coming soon)
  • template – Deals with templates
  • timeline – Deals with timelines
  • variable – Deals with XOML variables

Over time new functions and even new libraries will appear

New Lua functionality has been added such as querying collision contacts, creating scenes, appending XOML arrays, controlling device vibration, disabling device power saving etc..

Web View

The Web View now works on iOS and Android. You can create web views of any size modal or none modal and either navigate them to a URL or write html / javascript content to them from actions, commands and scripts.

Video Cam Streaming

A new resource type called VideoCam has been added which enables streaming of the devices video camera to an Image, which can in turn be displayed via actors.

New Actor Properties

Actors have been given some new properties, including:

  • IgnoreCamera – Forces actor to ignore camera transform
  • Orphan – Allows child actors to sort via normal actor layers
  • UserData – A simple integer that can be used to store user data such as an index into a script table

Brush UV coordinates

Brushes got a new property called UV, which allows you to set the UV coordinates of the brush directly instead of using SrcRect. Currently only works with image brushes.

Ad Support Added

We decided to add support for HTML ads to AppEasy as they offer a wide range of features compared to basic text or banner ads. For example using HTML ads you have access to the following types of ads:

  • Animating banner and text ads of any size
  • Video ads
  • Interstitial ads
  • Interactive ads
  • Forms based ads
  • Offer walls

We have added information about ad integration to section 20 of the XOML User Guide. We have also added information showing how to get set up and integrated with Leadbolt. We will include additional integrations on the next release.

Complete list of changed in 1.4 include:

Changes to AppEasy Project Manager

  • If project is saved with no location then the location is set to the folder where the project is saved
  • You can now set the size of the XML pools used by AppEasy. Format is (max-tags,max-attributes). Note that these are preallocated data pools so they will eat into your applications memory, so you may need to increase the amount of memory available to your app. Each tag consumes 104 bytes and each attribute consumes 60 bytes plus additional space for parsed strings

Changes to AppEasy Core Engine

  • Lua API has been replaced with a more intuitive Lua API
  • If you now try to add a resource that already exists in the scope it is loaded then a warning will be displayed and the resource will be overwritten
  • WebView now supports new Html attribute which can be used to pass html to the web view to be displayed
  • WebView now works in screen coordinates and not virtual canvas coordinates
  • Actors now have new UserData property that can be use to store a single integer, can be used to store index into script table / array for additional data
  • Actors now have new IgnoreCamera property that allows them to ignore the scenes camera transform
  • All examples now have schema set
  • All examples have been updated to use new Lua API
  • Actors have new property called Orphan. When set to true, actor is taken out of the usual sprite parent / child hierarchy and moves into the normal layer system. This enables child sprites to sort using layers, however actor to actor clipping may be affected
  • New scene.create() method added to allow creation of scenes from lua
  • New actor.getStartContacts() and actor.getEndContacts() functions added to give access to actors that a particular actor has started or ended collisions with
  • New VideoCam resource added that allows you to stream the devices video cam to an image
  • New ChangeVideoCam action added
  • New Lua functions added to change video cam media.changeVideoCam(), can be used to stop and start feed
  • New Lua variable.add() function added to add a value to a XOML variable
  • New Lua variable.append() function added that enables you to append additional elements onto the end of a XOML array
  • New Lua functions sys.vibrate() and sys.stopVibrate() added to control vibration
  • New Lua function sys.changePowerSaving() added to prevent back-light from switching off
  • New Lua function input.touchInfo() which returns information about touches
  • Image brush now supports setting of UV coordinates directly
  • Ads are now integrated via the web view (see section 20 of XOML User Guide)
  • BUG FIX: Some Lua functions were displaying incorrect errors and warnings
  • BUG FIX: Web view now works on iOS and Android (does not work on Windows)
  • BUG FIX: AspectLock fixed
  • BUG FIX: None batched sprites now render correctly at edges
  • BUG FIX: Some examples were broken
  • BUG FIX: Deleting particle actor that was child of another actor crashed when removing particle actor
  • BUG FIX: Particle actor placed inside parent actor didn’t scale by parents opacity when UseParentOpacity set
  • BUG FIX: Empty Param2 in FromTenplate action / commands crash
  • BUG FIX: Fixed changing orientation resizing
  • BUG FIX: Touch panning glitch fixed

Example Changes

  • Added New VideoCam example
  • Added new AdvancedCollision example
  • Added new DynamicWebView example

AppEasy 1.3 Now Available

AppEasy Version 1.3 is Now Available

AppEasy the cross platform mobile game and app development system for iPhone, iPad, Android and Windows that is aimed at all levels of experience releases latest update

AppEasy version 1.3 is now available for download from here.

Please upgrade to the latest version. Note that before updating, close down your current version of AppEasy, rename c:\AppEasy to c:\AppEasy2, install and run AppEasy 1.3 then copy any changes / certificates from c:\AppEasy2 to c:\AppEasy.

iOS App Store Signing

You can now sign your apps for distribution using a valid distribution certificate and distribution profile. If you have an app ready for App store submission then please let us know how you get on.

Windows Platform Added

You will notice that the AppEasy project manager has got a few new options, including a new deployment platform (Windows). You can now deploy a native Windows application which you can commercialise or use for demo purposes. There is also an option for Apple Mac but that is not currently enabled. We are looking to offer Mac support by 1.5.

AppEasy Wizard

We have added a new feature called the Easy Wizard. This wizard is an app that provides a step by step process for new iOS developers. It walks the developer through 9 steps including creating a developer account, creating a signing certificate request (on Windows), getting certificates, adding test devices, getting provisioning profiles and more, all steps are explained with additional available help built into the program. We will be adding steps for app store submissions and an Android version of the wizard for 1.5.

Inline Scripting

Its now possible to execute raw script from actions and commands. The script can be included within the action / command parameter or provided from a XOML variable, allowing dynamic scripting. This also saves having to call script functions when not needed, embedding logic into templates etc..

Rendering Engine Upgrade

We have upgraded the rendering engine to use floating point, so you should notice an improvement in rendering quality.

Complete list of changed in 1.3 include:

Changes to AppEasy Project Manager

  • iOS App Store signing now implemented, you can now sign your apps and submit them to the Apple App Store
  • Deployment to Windows platform added. You can now build commercial PC apps and games using AppEasy
  • Advanced options have been moved up to the top of the options panel
  • Simulator screen size moved up to top of the options panel
  • New debug info selector which can be used to change how much debug info is shown in builds (does not affect simulator test as this always shows max debug info)
  • New Windows deployment options section added
  • Support for more video cards added to the simulator
  • Apple Wizard tool added
  • BUG FIX: Fixed screen size label misplacement
  • BUG FIX: Deployment of app with space in location filename fails
  • BUG FIX: Drop down screen size settings now applied immediately
  • BUG FIX: Can no longer deploy an Android / iOS app store app without the proper key store / provisioning profile information

Changes to AppEasy Core Engine

  • Rendering engine has been upgraded from fixed point to floating point
  • Raw script can now be executed inline using the new “Inline” action and “inline” command. P2 specifies scene in which to run the script (omit to run in global script space)
  • Actors that have Draggable set to true will also set Hittest to true unless you override it
  • Lua Change Program now has new restart, next, priority and goto commands. Also takes optional 3rd parameter which is used as name of command to goto
  • New getDistanceBetween() Lua function added which returns the distance between two parent actors (does not take into account transforms)
  • New getAngleBetween() Lua function added which returns the angle (in degrees) between two parent actors (does not take into account transforms)
  • New Lua getFreeMem() function added to get total free memory available
  • New Lua functions ScreenToScene() and SceneToScreen() which convert between screen and scene coordinates
  • If a script function does not exist in the scenes script space then the system will attempt to call the same named function in the global script space. This allows you to call global functions in the global script space from any scenes script engine.
  • Lua getVariable(), getProgram(), getActor() and getResource() now look to the script engines container scene if the scene is not supplied. If no scene is available (the script is declared globally) then the global script space will be used. if no valid scene is found for getActor() then an error will occur as actors can only exist inside a scene.
  • All files are now Preload and Blocking by default
  • BUG FIX: Template parameter case issue fixed
  • BUG FIX: Nop command now returns immediately
  • BUG FIX: Lua crash when garbage collector kicks in crash fixed
  • BUG FIX: Crash when not assigning brush a type. Defaults to Image with a warning
  • BUG FIX: When actor is created via Lua createActor() and parent is an actor then depth of child is set to 0
  • BUG FIX: WebView was not positioned correctly when scene origin was set to something other than centre

Example Changes

  • Added Complex UI example

Tic Tank Toe Now Available

New made with IwGame Engine game available for iOS called Tic Tank Toe. Here’s the details:

Play the brand new TicTankToe on your smartphone!
Tired of silly games? This game will challenge you!
TicTankToe is the best TicTacToe game of all-time.

This game supports one player and two player gameplay, so you can play against another human or against your device. You can also play the amazing military campaign divided into 20 levels! Every 5 levels you can unlock deadly new tank! Become the Master of the TicTankToe Universe and send your score online!

TicTankToe offers a host of exciting features, including:
* Great graphics and exciting sound effects
* Undo function
* Post scores on Facebook
* 20 fantastic levels for free! And many more in future versions!

You can download Tic Tank Toe for your iOS device from here

Congratz to zapmobilegames

AppEasy Beta Begins – The new Easy way to Create Mobile Apps and Games

AppEasy Logo

We have some wonderful news. Today we finally began closed beta testing of our up and coming Marmalade / IwGame powered cross platform app development system AppEasy. AppEasy allows you to develop games and apps using mark-up language similar to HTML but designed specifically for high performance native games and apps. You can also use the optimised Lua API to enhance apps and games developed using AppEasy. You can find out more about AppEasy by visiting our “work in progress” web site at http://www.appeasymobile.com/. AppEasy puts mobile app and game development into the hands of everyone.

We have decided to double the number of users that can join our beta test program. If you would like to join then please register your interest at http://appeasymobile.com/register-interest

AppEasy – Coming Soon – Beta Testers Wanted

I would like to mention a new service that we plan to roll out very soon called AppEasy. AppEasy is a game and app development system that enables anyone to develop cross platform games and apps for iOS, Android (soon Samsung Bada and BlackBerry PlayBook) without the need for C++, Objective-C, Java or compilers / other SDK’s etc.. The AppEasy system involves using XOML and Lua (other script languages to be added soon) to create apps. To build an app you simply drag and drop all of your assets onto a web app, set some parameters for your game or app, such as icons, app name etc.. then hit deploy. Builds for each platform are then created that you can submit to the app stores. You can also hit a debug button to test your app locally. The system will be Windows only to begin with as we cannot gain elevated security permissions on Mac from Silverlight 5, we are still looking into options for Mac and Linux. If you are interested in beta testing this new service then get in touch with us at http://www.pocketeers.co.uk/?page_id=8. We are only offering a limited number of spots initially, so grab them whilst they are available. Now for a quick poll:

[poll id=”6″]

Whilst the pricing structure is not yet final, AppEasy will be priced competitively, although a free version will most likely be made available that embeds an Ad into deployed apps that generate revenue for us on start up. Money made from AppEasy will be spent on improving IwGame / AppEasy and other cool developer tool projects (such as the IwGame editor) that we have in the works.

If there is anything that you strongly agree / disagree with then please feel free to comment.

IwGame Engine v0.36 Released – XML Data bindings, Video, True Type Fonts and First 100% XOML Mark-up Driven Game

New here? What’s IwGame? IwGame is an open source free to use cross platform game and app engine for iPhone, iPad, Android, Bada, Playbook, Symbian, Windows Mobile, LG-TV, Windows and Mac, built on top of the Marmalade SDK. You can find out more and download the SDK from our IwGame Engine page.

Its been a while (again) since we last released an update for IwGame but 0.36 has finally landed. Our plans to make IwGame viable as an app development platform as well as game development platform continue to go ahead as you will see from this update. In particular the supoprt for true type fonts and XML data bindings

Below is the latest list of changes for IwGame 0.36:

  • IwGame can now be put into Open GL compatible mode, which allows mixing of raw GL with IwGame rendering
  • New variable type added called CIwGameXomlVariableXML. This variable type is used to store structured XML data. XML files can be loaded and assigned to an XML variable at which point they will be parsed into an XML tree which can be accessed later.
  • All action parameters can now take variables as parameters as well as values
  • Array variables have a new property called BindXML. BindXML will bind XML data to an array. The binding can pick specific tag / attributes out of XML data and bind it to the array. The format of BindXML is BindXML=”XML_Variable_Name:XML_Tag:XML_Attribute”
  • New File type added to XOML that allows loading, conversion and binding of generic local and remote files to variables
  • New LoadFile action added to XOML which enables files to be force loaded or replacement of an already loaded files data
  • New SetKeyFocus action added which allows you to switch which actor has key focus
  • New IwGameVideo added. Marmalade video play back wrapped up into CIwGameVideoPlayer. XOML also supports Video resource types (local and remote)
  • New UI control added called VideoOverlay. This UI control allows you to display a video located locally or remotely as a UI element. Supports AutoPlay, Volume, Repeat, OnStart, OnEnd, OnPause, OnResume events and control playback using command property
  • Support added to sprites and actors for an AlphaMode
  • Actors can now be conditionally loaded
  • Support added for true type fonts, located in resource groups, in local files or on a web server. Fonts that are generated from the same external font TTF file will re-use already downloaded TTF to save re-download
  • Support added to fonts for auto point size calculation based on max screen dimensions vs number of lines allowed on display when creating fonts from TTF’s
  • Fonts that are defined without preload will only be loaded when an actor that uses it is displayed.
  • Timelines are no longer stored in the resource system. They now have their own timelines manager. Actors and scenes have their own timelines manager and a global timeline manager is also available. This cuts down the noise in the main resource manager, makes resource and timeline searches faster and allows timelines to be declared local to an actor
  • Actions are no longer stored in the resource system. They now have their own actions manager. Actors and scenes have their own actions manager and a global actions manager is also available. This cuts down the noise in the main resource manager, makes resource and actions searches faster and allows actions to be declared local to an actor
  • System:9 added to check if pointer is available
  • Preset animations now resize to fit screen orientation changes
  • Labels now have an AutoHeight parameter that causes them to resize to fit the height of the text that they contain
  • UI components can now be marked as SizeToContent, which causes them to base their size on the content that they contain. Siznig can be locked to a specific axis using x, y, xy or none
  • OnKeyBack / OnKeyHome support added to UI actors
  • List Box now supports key navigation
  • Optimisations: Optimised scene and sprite systems to eliminate the thousands of allocs / deallocs every second in complex scenes (if you check metrics you will notice that free and malloc are being called like mad). Unfortunately this has meant limiting the range of layers for scenes to 10. Any scenes with a layer order of 10 or more will now be rendered after layers 0-9 and in no particular order
  • StackPanel now supports horizontal centering in horizontal orientation and vertical centering in vertical orientation
  • Actor brush can now be the target of an animation
  • Support added to actors for separate x and y position bindings / properties and animation targets
  • XOML variables can now be created conditionally
  • Image based actors / UI now support AspectLock property. This allows you to lock the aspect ratio of an actor that is sized using proportional sizing. For example, if you have an icon inside a horizontal stack panel who’s height is proportional to the size of the scene, ordinarily if you made the proportional size of the icon 50% on both axis, it would get stretched on the x-axis. By setting the AspectLock to the y axis, the height of the icon will be locked to 50% of the height of the stack panel, but the width of the icon will be calculated based on the size of the brush / src_rect that is used to represent the icon.
  • Pre-defined animations PA_ScrollOnFromLeft etc now only affect the relevant axis
  • Timeline has new TimeScale attribute which scales the rate at which animations within the timeline are played back. Actors also have a new target property called TimeScale, which can be used to adjust the TimeScale of the currently attached timeline (can be set via set property, bindings or animation target)
  • New wait_var_is_value command added to program system. This command will pause program execution until a variables value is a specified value
  • CIwGameString now has a Split method which splits a string into an array of strings using a specified separator
  • Images will no longer be converted to a default RGBA5551 format, if no format is specified. You can also set the format via code (must be set before calling Init())
  • Updated grid / list box controls to work with dynamic data
  • Condition variable operands can now be variables and condition variables can now use arrays
  • Inverse conditions are now available for all elements that use conditions by pre-pending the exclamation mark ‘!’ character to the front of the condition variable name
  • Animations now have categories
  • Added new extension modifier CIwGameModCollisionNotiify. If you attach this modifier to an actor and define OnCollisionBegin / OnCollisionEnd event handlers you can execute actions based on collision between different objects. A mask can also be provided when defining the modifier to allow masking of actors by type
  • Added new XMLGrid example app which shows how to bind XML data to a grid
  • Added ActorTest example (shows parent / child actors in XOML)
  • Added ActorTest2 example (shows many actors in XOML)
  • Added GameSceneGL example (shows how to mix raw Open GL with IwGame)
  • Added Game Of 10 example game (100% XOML driven)
  • BUG FIX: Grid auto column / row sizing was broken
  • BUG FIX: Fixed grid cell horizontal alignment. Also fixed grid resizing when orientation changes
  • BUG FIX: ListBox crashes when re-assigning a new array to an already existing ListBox
  • BUG FIX: When an action is declared in the scene and called from an actor event it wasn’t being found
  • BUG FIX: Fonts were not being searched for by name
  • BUG FIX: Sprites transform is now rebuilt when changing opacity from 0 to some other value
  • BUG FIX: Fixed many crashes related to duplicated resources
  • BUG FIX: Ad click not recognised when ads view not inside a scene
  • BUG FIX: Grid row horizontal alignment fixed
  • BUG FIX: Grid orientation change resizing fixed
  • BUG FIX: When a scene / actor is created it will now update its data bindings immediately after creation
  • BUG FIX: Can now set Background, SelectedBackground and DisabledBackground to NULL, which will remove the background image of the control

That’s quite a few changes, although there are quite a few bug fixes in there that will make some of you very happy. Lets take a look at some of the more notable changes:

100% XOML Mark-up Driven Development

We wanted something cool and different to show off for 0.36 so I spent some time over the weekend designing, creating and documenting a small game that is created using entirely in XOML mark-up and no C/C++ / script coding. I’m very pleased with the results and decided to include the game (GameOf10) with the 0.36 release as an example that others can use to try creating their own 100% XOML games and apps. If you do create any 100% XOML apps or games then please get in touch and let us know.

XML Data Bindings

Another new cool feature we have added to 0.36 is the ability to bind data directly parsed from a local or remote XML file to user interface components. This may not seem like a big deal but it is in the app development world and in some respects also in the game development world. Imagine if you will a vendor that wants an app that he / she can give away to customers that shows all of his / her very latest offers. Usually the vendor would need to add the new offers to his app, rebuild it and resubmit it to the app stores. Using XML bindings he / she no longer needs to do that. The vendor simply places the latest products into an XML file and uploads them to the shops web server. The vendor then creates some XOML UI to display the XML file and submits the app to the app stores. Users come along and download the app, the app pulls the vendors latest offers data from the server and displays all of the vendors offers in the app. The vendor has to do nothing else besides maintain his offers XML file. Nice eh? Well the vendor seems to think so because sales are up 🙂

This very same approach can be applied to game development and many developers already do just that, such as the famous Zygna games. You can store game content on a server and bind the data to your games UI / game objects. You can modify the game any time you like after release. Bugs? What bugs, I just modified my XML files and fixed them 🙂

So how to use this new cool feature?

Array variables have a new property called BindXML. BindXML will bind XML data to an array. The binding can pick specific tag / attributes out of XML data and bind it to the array. The format of BindXML is BindXML=”XML_Variable_Name:XML_Tag:XML_Attribute”. Lets look at an example:

[sourcecode language=”xml”]
<Variable Name="BookXML" Type="xml" />
<File Name="File3" Location="test1.xml" FileType="xml" Preload="true" Variable="BookXML" />
<Variable Name="GridItems1" Type="arraystring" BindXML="BookXML:Chapter:Brush" />
<Variable Name="GridItems2" Type="arraystring" BindXML="BookXML:Chapter:Name" />
<Variable Name="GridItems3" Type="arraystring" BindXML="BookXML:Chapter:Description" />
<Variable Name="GridItems4" Type="arraystring" BindXML="BookXML:Chapter:Pages" />
[/sourcecode]

In this example we create an XML variable then load the file test1.xml into BookXML. We then create 4 arrays and bding the Brush, Name, Description and Pages attributes of each Chapter tag to the arrays. Heres the example test1.xml file:

[sourcecode language=”xml”]
<Contents>
<Chapter Name="Chapter1" Description="This is chapter 1" Pages="10" Brush="Button1Brush" />
<Chapter Name="Chapter2" Description="This is chapter 2" Pages="12" Brush="Button2Brush" />
<Chapter Name="Chapter3" Description="This is chapter 3" Pages="11" Brush="Button1Brush" />
<Chapter Name="Chapter4" Description="This is chapter 4" Pages="5" Brush="Button12rush" />
<Chapter Name="Chapter5" Description="This is chapter 5" Pages="7" Brush="Button12rush" />
<Chapter Name="Chapter6" Description="This is chapter 6" Pages="9" Brush="Button1Brush" />
<Chapter Name="Chapter7" Description="This is chapter 7" Pages="2" Brush="Button12rush" />
<Chapter Name="Chapter8" Description="This is chapter 8" Pages="4" Brush="Button12rush" />
<Chapter Name="Chapter9" Description="This is chapter 9" Pages="6" Brush="Button1Brush" />
<Chapter Name="Chapter10" Description="This is chapter 10" Pages="16" Brush="Button1Brush" />
<Chapter Name="Chapter11" Description="This is chapter 11" Pages="16" Brush="Button2Brush" />
<Chapter Name="Chapter12" Description="This is chapter 12" Pages="16" Brush="Button2Brush" />
<Chapter Name="Chapter13" Description="This is chapter 13" Pages="16" Brush="Button1Brush" />
<Chapter Name="Chapter14" Description="This is chapter 14" Pages="16" Brush="Button1Brush" />
</Contents>
[/sourcecode]

Now we generate a grid to show the data:

[sourcecode language=”xml”]
<Template Name="GridItemTemp">
<Label Name="Grid1Item$index$" Size="-20, 90" Background="Button1Brush" BackgroundColour="200, 200, 200, 255" SelectedColour="200, 255, 200, 255" Font="trebuchet_12" GridPos="$gridpos$" HitTest="true" SelectType="toggle" Selected="false" />
</Template>
<Grid Name="ItemsGrid" Size="-100, -100" Background="PanelBrush" BackgroundColour="255, 255, 255, 255" HitTest="true" ClipMargin="10, 10, 10, 10" MultiSelect="false" SelectedIndex="5" UseParentOpacity="false">
<RowDefinition Name="r0" AlignV="middle" Height="100" />
<ColumnDefinition Name="c0" AlignH="left" Width="-20" ItemsData="GridItems1" ItemsTemplate="GridItemTemp" ItemsTargetType="background" />
<ColumnDefinition Name="c1" AlignH="left" Width="-20" ItemsData="GridItems2" ItemsTemplate="GridItemTemp" ItemsTargetType="text" />
<ColumnDefinition Name="c2" AlignH="left" Width="-40" ItemsData="GridItems3" ItemsTemplate="GridItemTemp" ItemsTargetType="text" />
<ColumnDefinition Name="c3" AlignH="left" Width="-20" ItemsData="GridItems4" ItemsTemplate="GridItemTemp" ItemsTargetType="text" />
</Grid>
[/sourcecode]

Video

A new sub-system called CIwGameVideoPlayer has been added that wraps the Marmalade SDK video playback code up into a nice and easy to use singleton called IW_GAME_VIDEO. We also have a new type called CIwGameVideo which represents a video resource that can be created in code or in XOML. Videos can be loaded from local storage or remotely from a web server either immediately or on-demand via the new VideoOverlay UI component. Lets take a quick look at an example:

[sourcecode language=”xml”]
<Video Name="Video1" Location="http://www.drmop.com/video1.mp4" Codec="MPEG4" />

<StackPanel Name="SP1" Size="300, -100" Background="PanelBrush" Orientation="vertical" AlignH="centre" AlignV="top" SizeToContent="none" >
<Label Background="Button2Brush" Size="-90, 100" SelectedColour="128, 255, 200, 128" Text="Option 1" Font="trebuchet_12" />
<Label Background="Button2Brush" Size="-90, 100" SelectedColour="128, 255, 200, 128" Text="Option 1" Font="trebuchet_12" />
<Label Background="Button2Brush" Size="-90, 100" SelectedColour="128, 255, 200, 128" Text="Option 1" Font="trebuchet_12" />
<Label Background="Button2Brush" Size="-90, 100" SelectedColour="128, 255, 200, 128" Text="Option 1" Font="trebuchet_12" />
<VideoOverlay Name="Vid1" Background="Button2Brush" SelectedColour="128, 255, 200, 128" Video="Video1" Size="-90, 100" AutoPlay="false" Volume="0.3" Repeat="1" AspectLock="x" OnEnd="VideoEnd" OnTapped="Play">
<Actions Name="VideoEnd">
<Action Method="HideActor" Param1="SP1" />
</Actions>
<Actions Name="Play">
<Action Method="SetProperty" Param1="Command" Param2="play" Param3="Vid1" />
</Actions>
</VideoOverlay>
<Icon Background="Button1Brush" />
</StackPanel>
[/sourcecode]

This example creates a video resource for a video file located on a web server. We then create a stack panel that contains 4 labels and a video overlay stacked on top of each other. The video is not loaded or played until the user taps on the space containing the video. When the video ends the whole UI will be hidden.

Now I don’t think you can ask for a simpler way of integrating video into your products 🙂

True Type Fonts

The font system has been reworked to add support for true-type fonts that are either located in a Marmalade resource group or located in a local or remote TTF file. Lets take a quick look at an example:

[sourcecode language=”xml”]
<Font Name="font1" Location="Serif.ttf" AutoPointSize="50" PointSize="0" Preload="true" />
<Font Name="smallfont1" Location="Serif.ttf" AutoPointSize="60" PointSize="0" Preload="true" />
[/sourcecode]

In this example, we create two different sized fonts from a local TTF file. We have the ability to auto generate the correct font point size based on the devices screen size. You simply specify how many lines of text you would like to fit onto the display using AutoPointSize. Note that PointSize will be added onto the calculated point size. Also note that, fonts will re-use font files to save having to reload / download them. For example, because font1 already loaded the Serif.ttf file, smallfont1 will re-use that same file.

OpenGL Compatibility

You can now freely mix Open GL with IwGame. A new example has been provided that shows how to mix Open GL with IwGame.

Action Variable Parameters

We have reworked the action parameter system to enable variables to passed as parameters as well as values. For example:

<Action Method=”SetProperty” Param1=”Timeline” Param2=”StillAnim” Param3=”SelectedCardNames:0″ />

This action assigns the “StillAnim” timeline to the actor whos name is stored as the first index in the SelectedCardNames array.

Conditions can now use inverse condition checking by pre-pending an exclamation mark ni front of the condition variable name, this saves having to create inverse conditions. For example, HasBullets becomes !HasBullets

Optimisations and Clean-up

We have reworked the actions and timeline systems to remove them from the resource system as the resource system can quickly become cluttered making searching for resources slower than it should be. A cool side affect of this change is that actors can now have their own local actions and timelines lists, reducing the chances of naming conflicts.

We have also gone through almost every line of code and removed the excessive use of memory allocation / deallocation that were occurring every frame.

New Collision Modifier Added

Added new extension modifier CIwGameModCollisionNotiify. If you attach this modifier to an actor and define OnCollisionStart / OnCollisionEnd event handlers you can execute actions based on collision between different objects. A mask can also be provided when defining the modifier to allow masking of actors by type

There are also a ton of other changes such as Labels that now size to the text they contain and UI elements can be told to size to their content

Well that’s it for this update. We’ve just started looking into LUA integration as well as creating TileMaps. Hopefully those features will make it into IwGame 0.37.

The Worlds first 100% XML Mark-up Driven Puzzle Game made with XOML

Well we finally cracked it, we’ve been aiming to create a game in 100% XOML mark-up and it finally happened. We created a small logic puzzle game called 10.

The game itself has simple rules. The screen is filled with cards, each card having a value of 0 to 9. The user selects 3 cards, who’s total value must total 10. When the user selects 3 cards that total 10 they are removed from play. To complete the round the user must eliminate all cards on the play field. The idea is simple but the game can be become incredibly difficult.

The game is 100% XOML based using only actions and variables to create the logic and no additional C/C++. We will be providing the project as an example project when we release IwGame 0.36.

Note that the game will not work with version 0.35 of IwGame.

We are getting closer to bringing cross platform mobile game and app development to the hands of none programmers 🙂

Oh and For the sake of clarity, we are not stating a worldwide claim over all mark-up languages as that would be ludicrous, only the XOML mark-up language.

A Windows build of the Game of 10 is available for download at http://www.drmop.com/wp-content/uploads/2012/06/Game-of-10.zip

[sourcecode language=”xml”]
<?xml version="1.0"?>
<xml>

<Style Name="GenericSceneStyle">
<Set Property="CanvasSize" Value="-100, -100" />
<Set Property="CanvasFit" Value="none" />
<Set Property="CanvasOrigin" Value="centre" />
<Set Property="Colour" Value="255, 255, 255, 255" />
<Set Property="AllowSuspend" Value="false" />
<Set Property="Physics" Value="false" />
</Style>

<!– Load a UI style to style the user interface –>
<LoadXOML File="UIStyle.xml" />

<!– Create a scene to hold or game –>
<Scene Name="GameScene" Style="GenericSceneStyle" Camera="Cam" Extents="-1000, -400, 2000, 800" Current="true" Batch="false" ClipStatic="true">

<!– Create a camera –>
<Camera Name="Cam" Position="0, 0" Angle="0" Scale="1.0" />

<!– Score / round variables –>
<Variable Name="Score" Type="int" Value="0" />
<Variable Name="RoundScore" Type="int" Value="0" />
<Variable Name="CurrentRound" Type="int" Value="0" />
<!– TargetValue determines the valuue that all 3 user selections should add up to gain a correct answer –>
<Variable Name="TargetValue" Type="int" Value="10" />
<!– TotalCardsValue is the current value of all selected cards –>
<Variable Name="TotalCardsValue" Type="int" Value="0" />
<!– CardValues is an array that holds the value of each card –>
<Variable Name="CardValues" Type="arrayint" Size="15" Value="0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0" />
<!– CardsCount is the total number of cards in play –>
<Variable Name="CardsCount" Type="int" Value="15" />
<!– CardsFoundCount is the total number of cards that the user has successfully found –>
<Variable Name="CardsFoundCount" Type="int" Value="0" />
<!– SelectedCardNames is an array that holds the names of the currently selected cards –>
<Variable Name="SelectedCardNames" Type="arraystring" Size="3" Value="none, none, none" />
<!– CardIndex is the current selection index –>
<Variable Name="CardIndex" Type="int" Value="0" />

<!– CardIndexIs are conditions used to determine the currently selected index –>
<Variable Name="CardIndexIs0" Type="condition" Value="CardIndex == 0"/>
<Variable Name="CardIndexIs1" Type="condition" Value="CardIndex == 1"/>
<Variable Name="CardIndexIs2" Type="condition" Value="CardIndex == 2"/>
<Variable Name="CardIndexIs3" Type="condition" Value="CardIndex == 3"/>
<!– CardsMatch is a condition used to determine if the total of all currently selected cards add up to the the target value of 10 –>
<Variable Name="CardsMatch" Type="condition" Value="TotalCardsValue == TargetValue"/>
<!– NoCardsLeft is a condition used to determine if there are any cards left in play –>
<Variable Name="NoCardsLeft" Type="condition" Value="CardsCount == CardsFoundCount"/>

<!– IsRound is a condition used to determine the current round –>
<Variable Name="IsRound0" Type="condition" Value="CurrentRound == 0"/>
<Variable Name="IsRound1" Type="condition" Value="CurrentRound == 1"/>
<Variable Name="IsRound2" Type="condition" Value="CurrentRound == 2"/>

<!– Load the first set of cards –>
<File Name="RoundFile" Location="Round1.txt" FileType="text" Preload="true" Blocking="true" Variable="CardValues" />

<!– Action that resets the round –>
<Actions Name="RestartRound">
<Action Method="SetVar" Param1="RoundScore" Param2="0" />
<Action Method="SetVar" Param1="TotalCardsValue" Param2="0" />
<Action Method="SetVar" Param1="CardsFoundCount" Param2="0" />
<Action Method="CallActions" Param1="ResetSelection" />
<Action Method="ShowActor" Param1="Card0" />
<Action Method="ShowActor" Param1="Card1" />
<Action Method="ShowActor" Param1="Card2" />
<Action Method="ShowActor" Param1="Card3" />
<Action Method="ShowActor" Param1="Card4" />
<Action Method="ShowActor" Param1="Card5" />
<Action Method="ShowActor" Param1="Card6" />
<Action Method="ShowActor" Param1="Card7" />
<Action Method="ShowActor" Param1="Card8" />
<Action Method="ShowActor" Param1="Card9" />
<Action Method="ShowActor" Param1="Card10" />
<Action Method="ShowActor" Param1="Card11" />
<Action Method="ShowActor" Param1="Card12" />
<Action Method="ShowActor" Param1="Card13" />
<Action Method="ShowActor" Param1="Card14" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card0" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card1" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card2" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card3" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card4" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card5" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card6" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card7" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card8" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card9" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card10" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card11" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card12" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card13" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="Card14" />
</Actions>

<!– Action that moves to the next round –>
<Actions Name="NextRound">
<Action Method="CallActions" Param1="RestartRound" />
<Action Method="AddVar" Param1="CurrentRound" Param2="1" />
<Action Method="LoadFile" Param1="RoundFile" Param2="true" Param3="Round1.txt" Condition="IsRound0" />
<Action Method="LoadFile" Param1="RoundFile" Param2="true" Param3="Round2.txt" Condition="IsRound1" />
<Action Method="LoadFile" Param1="RoundFile" Param2="true" Param3="Round3.txt" Condition="IsRound2" />
</Actions>

<!– Action that is called when a correct answer is given –>
<Actions Name="CorrectAnswer">
<Action Method="AddVar" Param1="RoundScore" Param2="1" />
<Action Method="HideActor" Param1="SelectedCardNames:0" />
<Action Method="HideActor" Param1="SelectedCardNames:1" />
<Action Method="HideActor" Param1="SelectedCardNames:2" />
<Action Method="AddVar" Param1="CardsFoundCount" Param2="3" />
<Action Method="SetProperty" Param1="Text" Param2="Correct, well done" Param3="AnswerNotification" />
<Action Method="SetTimeline" Param1="AnswerNotificationAnim" Param2="AnswerNotification" />
</Actions>

<!– Action that is called when an incorrect answer is given –>
<Actions Name="WrongAnswer">
<Action Method="SetProperty" Param1="Text" Param2="Incorrect, try again" Param3="AnswerNotification" />
<Action Method="SetTimeline" Param1="AnswerNotificationAnim" Param2="AnswerNotification" />
</Actions>

<!– Action that is called when the user has finished selecting 3 cards –>
<Actions Name="ResetSelection">
<Action Method="SetVar" Param1="CardIndex" Param2="0" />
<Action Method="SetVar" Param1="TotalCardsValue" Param2="0" />
</Actions>

<!– Action that is used to check the answer –>
<Actions Name="CheckAnswer">
<Action Method="CallActions" Param1="CorrectAnswer" Condition="CardsMatch" />
<Action Method="CallActions" Param1="WrongAnswer" Condition="!CardsMatch" />
<Action Method="CallActions" Param1="ResetSelection" />
<Action Method="CallActions" Param1="RoundComplete" Condition="NoCardsLeft" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="SelectedCardNames:0" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="SelectedCardNames:1" />
<Action Method="SetProperty" Param1="Timeline" Param2="StillAnim" Param3="SelectedCardNames:2" />
</Actions>

<!– Action that is called when the round is complete –>
<Actions Name="RoundComplete">
<Action Method="AddVar" Param1="Score" Param2="RoundScore" />
<Action Method="CallActions" Param1="NextRound" />
</Actions>

<!– Create a grid cell actor template to represent our card –>
<Template Name="CardTemplate">
<Label Name="Card$index$" Size="-18, -28" Background="Button1Brush" BackgroundColour="255, 255, 200, 255" SelectedColour="200, 255, 200, 255" Font="font1" GridPos="$gridpos$" HitTest="true" SelectType="normal" Selected="false" OnTapped="CardSelected">
<Timeline Name="FlashAnim" AutoPlay="true">
<Animation Anim="Flashing" Repeat="0" Target="Scale"/>
</Timeline>
<Actions Name="CardSelected">
<Action Method="SetVar" Param1="SelectedCardNames:0" Param2="Card$index$" Condition="CardIndexIs0" />
<Action Method="SetVar" Param1="SelectedCardNames:1" Param2="Card$index$" Condition="CardIndexIs1" />
<Action Method="SetVar" Param1="SelectedCardNames:2" Param2="Card$index$" Condition="CardIndexIs2" />
<Action Method="AddVar" Param1="TotalCardsValue" Param2="CardValues:$index$" />
<Action Method="AddVar" Param1="CardIndex" Param2="1" />
<Action Method="SetTimeline" Param1="FlashANim" />
<Action Method="CallActions" Param1="CheckAnswer" Condition="CardIndexIs3" />
</Actions>
</Label>
</Template>

<!– Create a grid that contains our cards –>
<Variable Name="SelectedCard" Type="int" Value="-1" />
<Grid Name="ItemsGrid" Size="-100, -90" Docking="bottom" Background="PanelBrush" BackgroundColour="150, 200, 255, 255" SelectedColour="150, 200, 255, 255" HitTest="false" ClipMargin="10, 10, 10, 10" MultiSelect="true" UseParentOpacity="false" ItemsData="CardValues" ItemsTemplate="CardTemplate" ItemsTargetType="text" Selection="SelectedCard">
<RowDefinition Name="r0" AlignV="middle" Height="-33" />
<RowDefinition Name="r1" AlignV="middle" Height="-33" />
<RowDefinition Name="r2" AlignV="middle" Height="-33" />
<ColumnDefinition Name="c0" AlignH="left" Width="-20" />
<ColumnDefinition Name="c1" AlignH="left" Width="-20" />
<ColumnDefinition Name="c2" AlignH="left" Width="-20" />
<ColumnDefinition Name="c3" AlignH="left" Width="-20" />
<ColumnDefinition Name="c5" AlignH="left" Width="-20" />
</Grid>

<!– Create the menu at the top of the screen –>
<StackPanel Size="-100, -10" HitTest="false" Docking="top" Orientation="horizontal">
<Label Name="Restart" Background="Button1Brush" SelectedColour="80, 80, 80, 255" Size="-15, -100" Font="smallfont1" Text="Restart" Margin="0, -5, 0, 0" OnTapped="RestartRound" />
<Label Background="PanelBrush" Size="-10, -100" Font="smallfont1" Text="Round" />
<Label Name="RoundScore" Background="PanelBrush" Size="-10, -100" Font="smallfont1" Binding="[Text]CurrentRound" />
<Label Background="PanelBrush" Size="-10, -100" Font="smallfont1" Text="Score" />
<Label Name="Score" Background="PanelBrush" Size="-10, -100" Font="smallfont1" Binding="[Text]Score" />
<Label Background="PanelBrush" Size="-10, -100" Font="smallfont1" Text="Round Score" />
<Label Name="RoundScore" Background="PanelBrush" Size="-10, -100" Font="smallfont1" Binding="[Text]RoundScore" />
<Label Name="Test3" Background="PanelBrush" Size="-10, -100" Font="smallfont1" Binding="[Text]TotalCardsValue" />
</StackPanel>

<!– Create answer notification overlay –>
<Animation Name="AnswerNotificationAnim" Duration="2" Type="float">
<Frame Value="-2000" Time="0" Easing="quadin" />
<Frame Value="0" Time="0.5" />
<Frame Value="0" Time="1.5" Easing="quadout" />
<Frame Value="2000" Time="2" />
</Animation>
<Timeline Name="AnswerNotificationAnim" AutoPlay="true">
<Animation Anim="AnswerNotificationAnim" Repeat="1" Target="PositionX" />
</Timeline>
<Label Name="AnswerNotification" Position="-2000, 0" Size="-50, -15" Background="PanelBrush" BackgroundColour="80, 255, 80, 255" Font="font1" HitTest="false" />

</Scene>

</xml>
[/sourcecode]