[solved] GWT can't use ChainShape ????

Anything libgdx related goes here!

[solved] GWT can't use ChainShape ????

Postby Paulica » Sun Sep 14, 2014 8:05 am

I have a game with libGDX that after I build it for html i get

Image

I'm using tiled, and export it as base64 uncompressed.

Look the .tmx file
http://pastebin.com/rqPTzgn9

What can I do? How can I see the line of code where the error is?
When I do html:superDev --debug everything is ok, the build is good..

When I refresh the page i see this in console
http://pastebin.com/MtE6tV6B


chrome log:

SoundManager V2.97a.20130512 (AS3/Flash 9) + HTML5 audio + preferFlash soundmanager2-jsmin.js:32
SoundManager 2 HTML5 support: mp3 = true (preferring flash), mp4 = true (preferring flash), ogg = true, opus = true, wav = true soundmanager2-jsmin.js:32
SoundManager 2 loaded (OK) soundmanager2-jsmin.js:32
Uncaught java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError)
__gwt$exception: <skipped>: Cannot read property 'b' of undefined html-0.js:66
Last edited by Paulica on Sun Sep 14, 2014 2:38 pm, edited 2 times in total.
Hi, I'm a 17 years old game developer from Romania.

Google play developer page
Linkedin
Github
Paulica
 
Posts: 325
Joined: Tue Feb 18, 2014 5:38 pm

Re: GWT cannot read property 'b' of undefined

Postby Paulica » Sun Sep 14, 2014 12:09 pm

I found out that the problem was with chainshape
Code: Select all
 public static void loadMap(World world){

        MainClass.comunicator.log("prepared to load map");

        ChainShape chainShape = new ChainShape();
        MainClass.comunicator.log("chain shape created xD");
        float vert[]=getMapVertices();
        MainClass.comunicator.log("yaaaa");
        MainClass.comunicator.log("Vertz loaded"+ Arrays.toString(vert));
        MainClass.comunicator.log(chainShape.toString());
        chainShape.createChain(vert);
        MainClass.comunicator.log("verticesadded");
        BodyDef bodyDef=new BodyDef();
        MainClass.comunicator.log("bodydef created");
        world.createBody(bodyDef).createFixture(PhysicsUtils.createFixtureDefDRF(1f,0.1f,1f,chainShape));
        MainClass.comunicator.log("done with map load");


    }


Image
image hosting 20mb


But why i get the error at 'chainShape.createChain(vert);' ? Anroid / desktop works fine
Hi, I'm a 17 years old game developer from Romania.

Google play developer page
Linkedin
Github
Paulica
 
Posts: 325
Joined: Tue Feb 18, 2014 5:38 pm

Re: GWT can't use ChainShape ????

Postby Paulica » Sun Sep 14, 2014 1:28 pm

Made a new project and added just

Code: Select all
    @Override
    public void show() {


        try {
            World world = new World(new Vector2(0, 0), false);
            BodyDef bodyDef=new BodyDef();
            FixtureDef fixtureDef=new FixtureDef();
            CircleShape circleShape = new CircleShape();
            MainClass.comunicator.log(" zBRO");
            ChainShape chainShape = new ChainShape();
            MainClass.comunicator.log(" BRO2");
            chainShape.createChain(new float[]{0, 0, 50, 0});
            MainClass.comunicator.log(" BRO3");
        }
        catch(Exception ex){
            MainClass.comunicator.log(ex.toString());
        }
    }


Nothing more in this project.. just this.. and when it goes to ' chainShape.createChain(new float[]{0, 0, 50, 0});' it crashes, and the error is the same..
Cannot read property 'b' of undefined


What can I do?
Can you guys just test it, add the code above and see if it works for you?
Hi, I'm a 17 years old game developer from Romania.

Google play developer page
Linkedin
Github
Paulica
 
Posts: 325
Joined: Tue Feb 18, 2014 5:38 pm

Re: GWT can't use ChainShape ????

Postby Paulica » Sun Sep 14, 2014 2:38 pm

SOLVED

There was a problem with float[] on chainshape for GWT, just Vector2[] was working.
@nexsoftware said that it will be fixed on the next snaspshot / release .
Hi, I'm a 17 years old game developer from Romania.

Google play developer page
Linkedin
Github
Paulica
 
Posts: 325
Joined: Tue Feb 18, 2014 5:38 pm

Re: [solved] GWT can't use ChainShape ????

Postby StrikerFred » Mon Sep 15, 2014 10:36 am

I'm having the same problem, thanks for reporting the status, glad it will be fixed :)
StrikerFred
 
Posts: 1
Joined: Wed May 01, 2013 3:50 am


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 1 guest