Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Solkraft Tutorial 6: Asset Directories

In this tutorial we will quickly go over the intended file structure for assets such as sounds and images.

Let’s go to the resourcefiles directory in our project folder. Here we need to create three new folders called “images”, “sounds” and “levels” like this:

SolKraftEngine\projects\yourprojectname\resourcefiles\images\
SolKraftEngine\projects\yourprojectname\resourcefiles\sounds\
SolKraftEngine\projects\yourprojectname\resourcefiles\levels\

This is because the engine will look for images in the images folder, sounds in the sounds folder and levels in the levels folder. Within these you are free to structure things as you wish, as long as you provide the path from one of these folders when you need to specify a file in the engine.

Additionally if you want to use the animation system you have to structure your animation frames like this:

SolKraftEngine\projects\yourprojectname\resourcefiles\images\…\animationname/0.png
SolKraftEngine\projects\yourprojectname\resourcefiles\images\…\animationname\1.png
SolKraftEngine\projects\yourprojectname\resourcefiles\images\…\animationname\2.png

And so on. When you load an animation in the engine, you have to specify the directory where the animation frames are located (starting from \images\) and how many frames the animation contains. Within the specified directory the engine will load as many images as specified, starting with image “0”. The file type of the images doesn’t matter but the names do. The first frame has to be named “0”, and the following frames increasing numbers with no gaps.

That is all that these short tutorials will cover, for further tips on how to use the engine we recommend looking at the code in our demo game.

Leave a comment  

name*

email*

website

Submit comment