Kiwi.js is the world's easiest to use Open Source HTML5 game framework for making both mobile and desktop HTML5 browser games.
Our focus is blazingly fast WebGL rendering and complementary tools to make professional quality serious games. We use CocoonJS for publishing games and App creation.
Version: 1.4.0 "Cole"
Born out of a desire to democratize HTML5 game development and to make something that we love available to the masses, we bring you Kiwi.js.
We don't mean to brag (too much), but Kiwi.js is fast. With hardware accelerated WebGL rendering, you can expect your games to be easily deployed across mobile and desktop browsers. But wait, they can also be deployed to mobile devices as native apps, using the CocoonJS framework.
Our mission is to follow the best open source community practices. We're backing that up by providing professional support when its needed, so everyone — commercial developers as well as indies — feel the love.
And we do think you're going to feel the love. What couldn't you love about a game engine that is named after a fluffy adorable bird and one of the world's greatest game inventors?
Have you ever been trying to figure out how to do something on a website and the help pages resemble a Goosebumps choose your own adventure book? So have we, which is why we have spent literally hundreds of hours writing good help documents for Kiwi.js developers.
Our Official Documentation Codex is here if you do get stuck.
Number tags refer to GitHub issues.
Geom.Transform.ignoreChild
property added. Defaults false
. If set to true
on a Group
or State
, its children will not inherit transforms. They will be positioned from (0, 0). This can save a matrix concatenation operation for every object in a group that doesn't move, resulting in significant performance gains. It's also faster to implement than Geom.Transform.ignoreParent
from v1.3.0 if you have several children.Geom.Intersect.rayToCircle()
intersection check. This completes the geometry intersections. (#170)Geom.Ray
now inherits from Geom.Line
. This gives it a more robust feature set. (#170)Kiwi.Geom.Matrix.equals()
method added.state
property to Component
.Kiwi.Plugins
is now a TypeScript module, allowing TypeScript developers to make plugins natively. (#208)File
param timeout
added; file timeouts now default to null. This allows the user to set loading tolerances. By default, files will attempt to load forever. This can prevent crashes on slow connections.State.destroy
now explicitly destroys members; destruction of tracking list is more robust. This overcomes some issues which might occur when switching states.GameObjects.Tilemap.getOverlappingTiles()
.glMatrix
library removed. This was used for a single call during WebGL rendering. Our own matrix code seems to perform just as well. In addition, glMatrix will load itself into a different namespace if certain other frameworks are in use, which results in a crash. Rather than fork or work around glMatrix, we decided to remove it entirely, reducing the size of KiwiJS. If you need glMatrix functionality, you may obtain the stand-alone library from http://glmatrix.net/. Thanks to the team at Cerebral Fix for bringing this to our attention! (#136)Stage.rgbColor
now correctly interprets all values in range 0-255. (#198)Camera.transformPoint
, Camera.transformPointToScreen
, Box._rotateRect
, and Box._rotateHitbox
now copy concatenated matrices, rather than operating directly on the matrix. (#201)Sound.AudioManager._unlockedSource
now passes a required parameter under iOS Safari. (#203)Geom.Transform.anchorPointY
now updates correctly. (#216)Kiwi.Files.File
now supports proper parsing of Data files.version
property from bower.json
(contributed by Kevin Kirsche).Kiwi.Input.Keyboard
_keyPressed
and _keyReleased
methodsMore details can be found on the Kiwi.JS repo under the 1.4.0 milestone
View the changelog for a list of changes from previous versions.
Kiwi uses a custom built WebGL rendering system for targeting modern mobile and desktop browsers as well as mobile apps through CocoonJS.
Not only is Kiwi lightning quick but it is also extendible, meaning that fellow contributors can easily write their own powerful rendering Plugins and Add-ons using WebGL Shaders. For instance our WebGL Particle Plugin creates stunning special FX using this system.
Of course, you can render to canvas too, which means older browsers, and mobile browsers, don't miss out.
Kiwi.js is closely aligned with Ludei's CocoonJS. You can use Cocoon to wrap up your game and play it on iOS or Android devices.
A state management system lets you easily move between and manage game states. Each state has an optional preloader phase, a create phase, an update loop, and a destroy phase. Each of the phases are highly configurable.
It's easy to load in images, sound and data. You can decide when you want it to load (e.g. in a single payload at the beginning, or on a per state basis). When your assets are loaded they're super easy to access from data libraries.
Gameobjects are objects that get rendered in your game. Whether they're frame-based sprites, webGL particles, static images or text fields, they all can be moved in the game world and placed in the scene graph.
Each gameobject is an "Entity" and can have "components" attached to it. Components are small pieces of code that do something useful. For instance the arcade physics system is implemented as a component. If you want your game object to use physics, simply attach a physics component to it. Some of the standard gameobjects have components such as animation already attached. You can also write your own components.
The scene graph represents all of the gameobjects that visible in your gameworld. You can group objects, and place groups within groups. You can animate and move your objects and groups and they'll behave in a consistent manner depending on how they are nested.
Sprites have an animation component that enables frame by animation from spritesheets and texture atlases. You can easily define frame sequences and frame lengths, play, pause, loop and reverse animations. There is also a built in tweening system.
Kiwi.js supports input for mouse, keyboard and of course touch. Mouse and touch events are easily handled by Kiwi.js pointer objects, so in most cases you don't have to worry about where the input is coming from.
Your game world is viewed through a controllable camera, which you can move and spin.
Kiwi.js has support for tilemaps, including multiple tile layers. The Tiled map data format is supported, including isometric tiles. You can programatically generate tile maps, and once a tile map is created you can easily manipulate the data to change the tilemap dynamically.
Kiwi.js supports the WebAudio api, and falls back to using <audio>
tag when it is not available. Audio sprites are also supported, unless of course your device happens to be some weird futuristic ghetto blaster.
As fellow game developers we know what it is like to be hungry, shivering on the corner holding a can of change in one hand and a damp "will code for cash" cardboard sign in the other.
Because of this, creating an In-App Purchasing Plugin to allow you to monetize your games was a top priority and is available now.
CocoonJS users can easily add a virtual currency to consumable goods via the AppStore.
As part of our dedication to open source principles, the plugin system lets developers extend many aspects of Kiwi.js. The rules around creating them are unobtrusive, making plugins easy to create and attach. Plugins will soon be able to be sold in the upcoming Kiwi.js marketplace.
Kiwi.js is part of a larger ecosystem of products which will enable you to create games and game content using specialised tools such as the Gamefroot cloud based game building solution. Because you can never get enough power
There are several ways to get started, starting from scratch is the generally accepted way to go about this, but if you want to get up and running even faster, Kiwi.js "Blueprint" games will help get your game building experience off to a flying start.
Choose from any of the following:
There will be an ever increasing library of free and premium blueprints to get you started.
The easiest way to start with a blank game is to take a copy of the /gameTemplate
folder. This contains a recommended folder structure and all default files already in place.
You will need to use a web server to open the index file. We suggest XAMPP, WAMP or MAMP.
A more advanced, but still simple, way to create a blank game is to use the Kiwi.js Yeoman Generator. This will create build files and other goodies for you as well.
We have a throng of examples. So many, in fact, that one kiwi got tired carrying them all. As generous souls, we put them in their own repo. Check out the examples repo and look in tutorials/core
.
Also, don't forget to check out the examples site where we demo all the library features and the cool plugins available to you.
Note: If you just want to use the framework, the kiwi.js and kiwi.min.js files are located in the /build
folder, and the docs in the /docs
folder, and there is a template game in the /templateGame
folder. You probably don't need to worry about the rest of the repo!
If you use the Bower package manager you can install kiwi.js with
bower install kiwijs
If you use the Yeoman scaffolding system you can install a blank kiwi.js game with
yo kiwigame
It's best to look at our Yeoman Game Generator repo for full details.
This requires installing node.js, and the grunt CLI package. There are a few thing you can do with grunt, including linting and compiling the typescript, uglifying the result and compiling the docs.
To build, lint and uglify use the default
grunt
To do all of the above plus compile the docs
grunt full
To just build the docs
grunt docs
The csproj and grunt compilation methods both output a single kiwi.js file in /build
Grunt will also create a min.js version and also output a kiwi.d.ts definition file in /build
as well
There are csproj files for the main project.
We advise that you build using Grunt, as this will correctly concatenate certain additional files.
You want Plugins? We got Plugins!.
The concept of Plugins, and how they might apply to game creation, is something we're very interested in. Years of working in the open source space and hacking open source tools has provided us with the qualifications necessary to create a system that works for you.
We built Kiwi.js from the ground up as a plugable system. You can add multiple plugins to your game, or write plugins yourself. Soon, you'll even be able to sell your own plugins in the Kiwi.js marketplace.
Kiwi.js is built in such a way that your plugins can do very simple or very powerful things. For example:
To learn about building Plugins view the tutorials on kiwijs.org. You can also get started with Plugins using the Kiwi.js Yeoman Plugin Generator.
Gamefroot is the worlds most powerful and easy to use browser-based game editor.
We've partnered with Gamefroot and we're pleased to let you know that Kiwi.js integration is in development and coming your way soon.
Stay tuned for more updates and more tools!
Here are some of the features planned for future releases.
We'd love for you to get involved and help make Kiwi.js the best damn game framework in the world! If you'd like to contribute please get in touch, fork/clone the repo and have a dig around.
If you discover a bug and find yourself wanting to jump in and help make the world of HTML5 gaming a better, less buggy, place, please add said bug to our issues tracker with as much information as possible, especially source code demonstrating the issue.
https://github.com/gamelab/kiwi.js/issues/new
A massive shoutout to our contributors on Github!
Kiwi.js also uses code from a number of open source projects. Effort has been made to clearly identify authors in the code comments. If you notice and missing or incorrect attribution please let us know.
license.txt
for details)