Please Explain This Code

For developers using the Construct 2 Javascript SDK

Post » Sat Apr 18, 2015 7:51 pm

I don't know what this even means?! @Ashley @rexrainbow do you know? Where i can learn to program like that? Source: Construct2 Physics Plugin
Image
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,446

Post » Sat Apr 18, 2015 8:19 pm

Code in javascript & use google closure compiler service : http://closure-compiler.appspot.com/home
B
32
S
10
G
3
Posts: 310
Reputation: 6,081

Post » Mon Apr 20, 2015 11:15 am

You're looking at the asm.js compiled version of the Box2d physics engine, which was machine-compiled from the source C++ code, so it's not going to make much sense.
Scirra Founder
B
400
S
237
G
89
Posts: 24,550
Reputation: 195,537

Post » Tue Apr 21, 2015 5:06 pm

Ashley wrote:You're looking at the asm.js compiled version of the Box2d physics engine, which was machine-compiled from the source C++ code, so it's not going to make much sense.


Oh , then this was written in C++ and then compiled to JavaScript? If so can I do that in Java too?
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,446

Post » Thu May 28, 2015 6:09 pm

@Naji - unless you already have some files in java and want them in javascript... I would recommend just writing the scripts you need in javascript. Emscripten doesn't work perfectly and tracking down bugs is a pain. Also, you have to spend alot of time familiarizing yourself to the way the results are outputed. Also, I have no clue if it works on java to javascript.

TLDR - it probably isn't worth your time, unless you have a file that = box2d in complexity and need a performance boost.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163

Post » Thu May 28, 2015 6:13 pm

@Naji - Also, unbeknownst to most here is that the file you are looking at is broken in a small but huge way, thanks to emscripten. The construct 2 implementation of box2d is far from feature complete and so avoids the bugs...
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest