I'm looking for a guide on simple painting of tiles and sprites on the screen. Im hoping Kha is easier than openFL, as I've had issues with it as the guides are pretty poor and there seems to be a lot of needless complexity.
-
Painting Tiles/Sprites
I think Justin's tutorial series is the right place to get started for you: http://jamiltron.com/2015/12/KhaShmup-Tutorial-Part-1/
There are no tiles in there so far, but you can draw them the same way you draw sprites and in Kha that's actually efficient (images are auto-batched, you don't need an additional api for that like in OpenFL). -
Painting Tiles/Sprites
yeah. gotta say the jamiltron tutorial series has been great. looking forward to continuing with it.
ive worked in openfl. not a flash guy though, it was pretty simlpe. but really for pure raw power. kha is the one.
more than likely you will type more, but i feel really low level things have that, that the trade-off -
Painting Tiles/Sprites
Cant get that Kha Shmup to compile, and its way over my head. Thanks for the help anyway.
| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
The Empty.git on a new Kha install on Ubuntu 14.04 LTS fails to run natively, giving me fatal errors for Alsa/asoundlib.h saying it doesnt exist. Though seems like it does work for html5, which I believe I may have had a web-server running on Linux Mint that could have caused my issues; though I dont think I have anything running on 8080.
Looking at the error I think Linux mint may have an older or broken C++ compiler or something, so native builds dont work. In Ubuntu I guess it doesnt have Alsa libraries that it needs to run, though compiling works.
After installing Alsa using 'apt-get install libasound2-dev' it now says I dont have glx.h. Seems like glx.h is some kind of video library for openGL, I'm testing this from an Intel 3320M laptop with the open Intel drivers, so perhaps its due to that.
Okay now I installed libgl1-mesa-dev, and it seems to compile okay. I guess I just needed to work through it. Seems like it works even after I uninstall those libraries too which is good. Thanks for the help.
| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
Well I installed a clean Ubuntu on my desktop and am now getting this error, very similar to Linux Mint. I'm thinking I need to install some C++ library to fix it. When I try to install libstdc++ I jsut get a bunch of errors.
edit) Well I fixed the error below too that I had on my new install, and it fixed my Linux Mint compile as well:
** sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get dist-upgrade**
I guess you need cutting edge development packages that LTS releases dont have. This new install is saying I need alsa and libgl1-mesa-dev as well./home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)/home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64) /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.20' not found (required by /home/meowman/Desktop/kha Stuff/Empty/Kha/Kore/Tools/krafix/krafix-linux64)Assets done.
Haxe stderr: /home/meowman/Desktop/kha Stuff/Empty/Kha/Tools/haxe/std/neko/_std/sys/io/File.hx:30: characters 20-51 : linux-resources/painter-colored.frag.essl: No such file or directory
/home/meowman/Desktop/kha Stuff/Empty/Kha/Tools/haxe/std/neko/_std/sys/io/File.hx:34: characters 33-49 : Called from
/home/meowman/Desktop/kha Stuff/Empty/Kha/Sources/kha/internal/ShadersBuilder.hx:31: characters 36-96 : Called from
/home/meowman/Desktop/kha Stuff/Empty/Kha/Sources/kha/Shaders.hx:33: characters 2-7 : Called from
AbortedHaxe process exited with code 1
korefile found.
Creating Linux project files.
Done.
*| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
Yes, you need alsa and gl libraries. It's mentioned in the relevant sources but properly documenting it is a little difficult because it's different for all Linux distros. Basically you need a toolchain that contains the standard audio and graphics system libs and headers. The CXXABI error though - is your Kha up to date, especially the krafix submodule? I updated the linux binaries in there earlier this month to versions which are statically linked to the c/c++ libs, so I hoped that error should be gone everywhere.
-
Painting Tiles/Sprites
I believe my Kha was up to date on it, as I just followed the guide for creating an Empty project.
git clone --recursive https://github.com/KTXSoftware/Empty.git
The CXXABI errors went away after I updated with 'ppa:ubuntu-toolchain-r/test'.
| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
Ah, then it wasn't up to date. Cloning Empty.git checks out the revision of Kha which Empty points to. https://github.com/KTXSoftware/Kha/wiki/Getting-Started explains that a little more.
-
Painting Tiles/Sprites
Found out how to properly clone using Git, which was my issue with getting the latest Kha.
git clone --recursive URL
Seems to have fixed a lot of things. Thanks for the help.
I'm going through the tutorial and I have to say Kha really is easy, seems much saner and more complete than openFL.
| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
Thanks for the guide. I'm still going through it and am now reading about Entity framework it linked. It is a bit difficult to wrap my head around it all, and Actionscript has things like dictionaries that dont exist in Haxe. Do you know of any Entity system examples that pertain directly to Haxe?
| last edited by turnip Reputation: 1 | Posts: 11 -
Painting Tiles/Sprites
@turnip Unless dictionaries in Actionscript are something different than what I think they are Haxe has Maps which is the same thing.
There are a bunch of entity-component-systems in Haxe - probably the easiest to grok is the Ash-Haxe port of the Ash Actionscript ECS.
I haven't really come across any great tutorials for actually using an ECS, so I am thinking about using that as the basis of my next set of tutorials.
| last edited by jamiltron Reputation: 1 | Posts: 13 -
Painting Tiles/Sprites
@turnip I personally would avoid using Dynamic as much as possible, but that's up to you. What can you not get working properly?
-
Painting Tiles/Sprites
Cool, I'm not sure of tutorials on Haxe but I know these get pasted on forums once and a while, may be worth checking out: