New updates! First official update of the year!
Added some new functions to the Map static object.
Map.getAngle(pA, pB) returns the angle in radians between pA and pB on the map.
Map.getDirByAngle(pD, pAngle) returns the direction after turning pD by the radian angle pAngle.
Util.toDegrees(pRad) returns the degrees of the radians pRad.
Util.toRadians(pDeg) returns the radians of the degrees pDeg.
You can now use diob.setTransition(pO, pS, pT) to slowly transition diob properties from one value to another over time, where pO is an object containing the property names and values, pS is the number of steps to do the transition in, and pT is the amount of milliseconds between each step. Current properties that work with the function are 'alpha', 'xIconOffset', and 'yIconOffset' with many more to come in the future. Example usage below.
Mob
onNew()
this.setTransition({'alpha': 0, 'xIconOffset': 32}, 5, 100)
The above code would change the mob's alpha from 1 to 0 (fading it out) and move it's icon offset to the right by 32 pixels in five steps, with each step occuring every 100 milliseconds (1/10th of a second). So the entire thing would happen in half a second
You may now include CSS directly into the project instead of importing from outside or loading the styles during runtime. Any code between #BEGIN WEBSTYLE and #END WEBSTYLE will be treated as style code. For example.
#BEGIN WEBSTYLE
body {
color: #000;
}
#END WEBSTYLE
The above code would add the code into a style tag in the header and the body of the HTML will have a color of black.
I worked on a lot of other various things here and there. Some performance improvements, general bug fixes, and so on. I will keep trucking along until things are finished! Stay tuned for more updates.
Added some new functions to the Map static object.
Map.getAngle(pA, pB) returns the angle in radians between pA and pB on the map.
Map.getDirByAngle(pD, pAngle) returns the direction after turning pD by the radian angle pAngle.
Util.toDegrees(pRad) returns the degrees of the radians pRad.
Util.toRadians(pDeg) returns the radians of the degrees pDeg.
You can now use diob.setTransition(pO, pS, pT) to slowly transition diob properties from one value to another over time, where pO is an object containing the property names and values, pS is the number of steps to do the transition in, and pT is the amount of milliseconds between each step. Current properties that work with the function are 'alpha', 'xIconOffset', and 'yIconOffset' with many more to come in the future. Example usage below.
Mob onNew() this.setTransition({'alpha': 0, 'xIconOffset': 32}, 5, 100)
The above code would change the mob's alpha from 1 to 0 (fading it out) and move it's icon offset to the right by 32 pixels in five steps, with each step occuring every 100 milliseconds (1/10th of a second). So the entire thing would happen in half a second
You may now include CSS directly into the project instead of importing from outside or loading the styles during runtime. Any code between #BEGIN WEBSTYLE and #END WEBSTYLE will be treated as style code. For example.
#BEGIN WEBSTYLE body { color: #000; } #END WEBSTYLE
The above code would add the code into a style tag in the header and the body of the HTML will have a color of black.
I worked on a lot of other various things here and there. Some performance improvements, general bug fixes, and so on. I will keep trucking along until things are finished! Stay tuned for more updates.