-
anssshu
I have written an entiy component based game engine with kha and nape physics library and want to write some game for the Raspberry Pi .
Demos are working in other environments(Linux) but not on the Pi .Is there a way to make it work .
Other options I have is to use Love2d or godot2.1.4 game engine .But I wanted to do it with kha . I really love kha because of its portability and multiple backends in
-
anssshu
@Robert Will it be possible to run Kode Studio on Raspberry Pi (arm based cpus) for kha development .
If yes then how to do it. -
anssshu
i compiled for raspberry pi with kodestudio and the project was generated successfully and inside build/pi-build/Release directory makefile was generated. when i tried to build the executable from the makefile with make command i am getting the following error
In file included from ../../../../Public/Kha/Kore/Sources/Kore/System.h:4:0,
from ../../../../Public/Kha/Kore/Backends/Graphics4/OpenGL/Sources/Kore/OpenGL.cpp:13:
../../../../Public/Kha/Kore/Sources/Kore/Window.h:3:29: fatal error: Kore/WindowData.h: No such file or directory
#include <Kore/WindowData.h>
^
compilation terminated.
makefile:26: recipe for target 'opengl.o' failed
make: *** [opengl.o] Error 1Thank U in advance
-
anssshu
Thank u robert for you reply when i am using kode studio its working fine but when i am downloading kha from github and trying to compile with node path to kha /make to compile i am getting error .
As kodestudio is not working on raspberry pi i am unable to port my work to raspberry pi
-
anssshu
i installed node ,haxe and kha16.1.2 via haxe lib
created an empty folder and cd into the folder and created a kha project with the following command
node /home/pi/haxelib/kha/16,1,2/make --init
when i compied the project with the folowing code
node /home/pi/haxelib/kha/16,1,2/make
i am getting the following error ,thank u in advance please helpnode /home/pi/haxelib/kha/16,1,2/make.js
Creating Kha project.
/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:44
if (result.stdout.toString() !== '') {
^TypeError: Cannot read property 'toString' of null
at compileShader2 (/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:44:21)
at compileShader (/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:132:4)
at exportKhaProject (/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:380:3)
at exportProject (/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:451:3)
at Object.exports.run (/home/pi/haxelib/kha/16,1,2/Tools/khamake/main.js:539:2)
at Object.<anonymous> (/home/pi/haxelib/kha/16,1,2/Tools/khamake/khamake.js:376:23)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12) -
anssshu
@robert
In Mac gamepad is working for Godot engine ,but why not for kha.Please tell me about how to recompile kha kore or krom so that gamepad will work -
-
anssshu
@robert
I wrote a complete sprite class which takes an image asset and convert into
a sprite which can be positioned ,rotated ,scale and its anchor position can be changed -
anssshu
@greger-olsson
Thank u Greger ,
I am also new to Kha,I tried it in Linux also but still having the same problem.let me check those codes you mentioned ,if I have some luck. -
anssshu
//import libraries
import kha.graphics2.Graphics;
import kha.math.FastMatrix3;
import kha.Image;class Sprite{
public var img:Image;
public var ax = 0.5; //anchor x
public var ay = 0.5; //anchor y
public var r = 0.0; //rotation in rad
public var x = 0.0; //x pos
public var y = 0.0; //y pos
public var w = 100.0; //width
public var h = 100.0; //height
public var sx = 1.0; //scale
public var sy = 1.0 ; //scalepublic function new(image:Image){ this.img = image; this.w = this.img.width; this.h = this.img.height; } public function update(){ //this.r+=1.0; } public function render(graphics:Graphics){ graphics.pushTransformation(FastMatrix3.translation(this.x,this.y)); graphics.rotate(this.degTorad(this.r),this.x,this.y); //graphics.fillRect(-this.ax*this.w,-this.ay*this.h,this.w,this.h); graphics.drawScaledImage(this.img,-this.ax*this.w,-this.ay*this.h,this.w*this.sx,this.h*this.sy); graphics.popTransformation(); } private function degTorad(deg:Float){ return deg*(Math.PI/180.0); }
}