I have been working on a JavaScript library called phsim that allows one to make 2d simulations of objects and make them do all sorts of interesting things. I have released the first alpha version (v0.1.0-alpha) of the phsim library and an editor that helps someone make these simulations.
Note that these are both in the alpha stage of development. This means that they might have bugs, so be careful when using these! If you see a bug for the GitHub library, please make a bug report. Likewise, if you see a bug in the PhSim editor, please email me or contact me on social media.
There is a GitHub repository for PhSim. Currently, there is virtually nothing in it yet. However, as of when this post was created, there is content in the 0.1.0-alpha branch. When version 0.1.0-alpha is completed, it shall be merged with the master branch.
PhSim is a JavaScript library that I am creating. I wanted to remake some of the games I created on Sploder.com using Matter.js. However, I created some code that I decided to use to create a new JavaScript library that runs on top of Matter.js because there are features that were not included in Matter.js that I wanted. The library was inspired partially by things such as Scratch and Sploder’s Physics creator. As mentioned before, it is built on top of the JavaScipt library Matter.js and it allows one to create a 2-dimensional simulation with ease. The simulation could be created out of a JSON object, which in turn can be edited with another creation of mine: the PhSim editor.
This code produces the following world of objects:
Features
First, there are four basic shapes: irregular polygons, circles, rectangles, and regular polygons. Moreover, these form the main objects of a PhSim simulation. In addition, these shapes can have solid color backgrounds, sprites, or even a gradient.
Each body can have one or more widgets, which extend the functionality of an object. Some of these widgets are things that allow someone to make an object
Superlayers contain layers and have several properties that define a world. One of these properties is diagonal, constant gravity. However, there are also graphical features, such as background color. Superlayers can also act as levels for a game.
Furthermore, Superlayers can have a Newtonian gravity simulator enabled, which makes the objects attract each other. In addition to this, one can have no gravity at all.
In addition to simulating Newtonian gravity, one can turn a superlayer into a level. Therefore, one can make a game out of a PhSim simulation.
PhSim editor
The PhSim editor will be a GUI that allows one to create PhSim worlds with little or no programming knowledge.
I created the following screenshot on September 9, 2020 (it is not finished and that is why it looks weird in many ways):
The Object Editor allows users to edit objects, as the name suggests. This allows one to add widgets to an object and modify it in many other ways. The Object Editor can add velocities, forces, rotations, text, and many other things to an object. Here are some screenshots of the Object Editor:
I have created a new page on my website. It is a list of JavaScript random snippets I made. Here is the link: https://mjduniverse.com/js-snippets/
As of January 10, 2020, I have very little content on the page. In fact, most of the code snippets as of now are boring. However, the page will be updated more and more.
First, I have merged the Alphazoidverse website with the Mjduniverse.com main site; because there seems to be no need for a separate website for the Alphazoidverse. Second, I have turned the Alphazoidverse Factbook into a wiki, thus reviving Alphazoidversepedia. However, I have locked the wiki. Thus, it will act as the official source of information regarding the Alphazoidverse. Third, I have got rid of a few minor issues regarding the themes’ CSS.