I decided to try a different approach... compare an old Hype.js to a new Hype javascript file. By finding the new additions, it probably leads to the physics code.
Md = '%c [Matter] ',
That definitely wasn't there. I was wondering of these are new...
Xa = ' translateX(',
Ya = ' translateY(',
Za = ' translateZ(',
...but they were there before. Both files have that code. Although, the variables are different in the new one...
xd = ' translateX(',
yd = ' translateY(',
zd = ' translateZ(',
I think that's what the problem is with Hype. I can slide an element from a dynamic starting point, but the end point is not dynamic. Otherwise, I could just add controls with different timelines. (In other words, I can move an element to a location, from a previous location, but I can't move an element by a specific amount... such as X = X+1)
Also, I'm not sure how a "Z" translate would work, so maybe I'm thinking of something else. Would "Z" be zoom/scaling? I'm not sure, as new scaling terms were added...
vd = ' scaleX(',
wd = ' scaleY(',
This is right next to the translation related variables. I suspect the scale variables are related to responsive theming, as the box itself can increase and decrease in area.
Here's another interesting one...
eb = 'concat',
A criminal feline made it into the code? What does this mean? Apparently, it has something to do with arrays... Array.prototype.concat() - JavaScript | MDN
I'm not sure what the benefit of that might be. Speculation â maybe it's a way to take existing HTML data for an element and give it physics properties? I don't know for sure. I might be seeing what I want to see. The next one though, that seems closer to physics...
nb = 'speed',
The word "speed" does not appear in the older Hype JavaScript. The comparison is from more than a year ago, so I might be missing some features that were launched before Hype 3 / Pro. Although, I'm not sure what else "speed" could be related to than physics. Velocity is speed with a direction. That would be a prime addition for the physics api. If Speed and direction (Basically the X & Y speed values) can be changed dynamically, then that's the beginning of building a control system, adding artificial intelligence and other critical parts of game creation.
I'm not sure if "force" is the Matter.js or Hype way of managing velocity. I didn't see the word "force" in either Hype.js document. But while on the subject of popular words from Science Fiction movies, "Matrix" was in the newer Hype JavaScript.
Oe = '.Matrix(M11=',`
This seems to be part of de-minifying the JavaScript. I'm not sure what the variables are, and they do seem to change between major Hype versions, I'm thinking the variables are the same between projects. Here's an example...
mj = 'World',
That was mentioned earlier in this thread. It's a new one, as it's not mentioned in the older JavaScript file. It seems probable that "World" is Physics related.
This next one could be huge...
il = 'collisionActive',
jl = 'collisionEnd',
kl = 'collisionStart',
Once the controls are working, collision detection is important. That's how the main character can stop moving when it bumps into walls, take damage when hit by projectiles or gain bonuses when collecting power-ups.
If Tumult is not sure what to add to the Physics API, being able to move elements dynamically... or being able to do something when collisions occur (like run JavaScript or play timelines) seems like pretty basic stuff.
It still seems that it is possible for this stuff to be accomplished with JavaScript. Although "dramatic hacking" does seem correct. I know the existence of these variables, but I can't do anything with them yet. Even the most basic of using "mj" to display the word "World" in "Hello World" is out of reach right now.
The future looks bright though, as I saw this...
ql = 'controller',
rl = 'controls',
Perhaps Tumult is already playing with advanced game development. Those two variables are new.
I think opening up the API is more work for Tumult, but it makes the software more useful. Here's another example.
ul = 'deviceorientation',
That seems like it could be incredibly useful for mobile development. Also, here's another new variable...
Wa = 'timestamp',
If that means UNIX Timestamp, That's an excellent one for game development. If these values are already in the code, why not let developers access them? If that does happen, it would be nice if Javascript minification/shorthand never changed â like "T" for timestamp.
Anyway, the two JavaScript files were too big and too different for a precise comparison. (I used TextWranger and it listed lots of differences.) This is a bit of progress. Here's what was learned...
- Using developer software, such as Firefox Developer Edition, or the Inspect in Safari, can easily de-minify JavaScript code.
- Tumult might already be experimenting with advanced physics settings and/or game development features, as some interesting phrases are already in the code.
- This isn't just beneficial for game development. Apparently, handy code snippets exist in the code that could be beneficial to developers in general, such as timestamp and device orientation.