It's finally here... One day, I had an idea. I would make a realistic physics script. I worked my way up, experimenting with gravity, collision, elastic, and fluid simulations. But it wasn't enough. I wasn't pleased yet. But now... After months of work... Hundreds of code blocks... Weeks of research... After all that hard work, I finally created what I wanted. A realistic physics simulation. Physics Box. But by no means will I stop here. I can do better. Digitex Studios is still a thing, and still will be a thing for years. But I've devoted most of my time on Scratch lately to this project. So please leave a comment on what you think, and if you're feeling especially creative, go ahead and remix to change the graphics or even the code. THANKS! Digitex By the way, as of Tuesday, January 14, 2020, the entire project has 687 blocks! Welcome to Physics Box, my most complicated physics simulation yet! Please report any glitches in the comments, and also tell me about any features that you would want added. Note: this project is in BETA mode, meaning that it is constantly in development. |||||| Physics Box is a physics simulation where you can play with realistic physics of a box and a ball. Have fun! Here is what you can do: Change the gravity factor Click and drag to move the box or ball, flick and release to throw, just release to drop. You can also click D to release an object. Press [space] to freeze the box and access its menu. Press B to freeze the ball and access its menu Use the specified keys to use these five menu controls: Arrow keys - Move: moves the box around. Click [space] to confirm. You can use other menu functions after clicking space. D - Drop: releases the box. Erases motion data. C - Cancel: releases the box. Keeps motion data. R - Reset: resets the box to the center. Erases all data. T - Throw: throws the box, instructions below. When throwing the box, use the arrow keys to specify direction. Look at "ymotion" and "xmotion", which show the box's velocity. Look at "ymotionb" and "xmotionb" for the ball. With "ymotion", a positive number means up and negative means down. With "xmotion", a positive number means right and a negative number means left. ||||| Note: it may be a bit glitchy. If either of the objects disappears, gets stuck in a wall, teleports, or glitches in any other way, PLEASE WAIT FOR A FEW SECONDS! If the problem stays, click the flag again, and if that doesn't work, reload the page. ----------- Update log: v1.0.0 - finished main scripting v1.0.1 - fixed a glitch where the box was not bouncing off of the edges v1.0.2 - fixed a glitch where the box accelerated uncontrollably v1.1.0 - added colors, switched to vector graphics v1.2.0 - added swinging animation when the box is grabbed v1.2.1 - fixed a glitch where the box rapidly spun around the central point v1.2.2 - fixed a glitch where the box defied gravity (rotated upward instead of downward v1.3.0 - added menu with two controls: throw or cancel v1.3.1 - added three more menu controls: drop, move, and reset v1.3.2 - fixed a glitch where the menu was not appearing v1.3.3 - fixed a glitch where the menu did not disappear v1.3.4 - fixed a glitch where the menu was constantly at the center of the screen v1.4.0 - improved physics code v1.4.1 - fixed a glitch where the box got stuck in the walls v1.4.2 - fixed a glitch where the box disappeared v1.5.0 - added a ball v1.5.1 - fixed so many glitches with the ball that I can't even list them here v1.5.2 - fixed a glitch where the menu for the ball was not following it v1.5.3 - fixed a glitch where the menus didn't appear v1.5.4 - fixed a glitch where the box disappeared v1.6.0 - objects now bounce off each other v1.6.1 - fixed a glitch where the ball was not swinging properly ---------
Please see description for instructions (scroll down) I ran into lots of glitches, and fixed most of them, but I kept some of them because they are pretty funny. To do some of these unexpected glitches: Pick up the box, and release it at the very bottom of the screen. THIS GLITCH WILL ONLY WORK WHILE THE BOX IS SWINGING! (Glitch caused by the swinging animation interfering with the physics engine, creating an inexplicable increase in velocity) Pick up the ball, and drop it on the box. (The ball will fall through the box, the box will start to tweak out, and suddenly, the glitch happens. Glitch caused by the ball and the box occupying the same location) Another version of the glitch above: pick up the box and drop it on the ball. Doesn't always work as well, but still works. Pick up either object and flick it as quickly as you can in any direction. (Not actually a glitch, just the object is bouncing around at high speed) Open the menu of any object, and throw it upwards and rightwards at high speed. (Not actually a glitch, same thing as before) Open the menu of one object, and move it to the center. Open the throw menu, but don't do anything. Then, open the menu of the other object, and move it over top of the other. Click T, and the first object will go flying. (Same reason as dropping one object on the other. Holding down D and clicking the left arrow causes the box to fall through the border, glitch out, and then fly everywhere. (Caused by the box falling past the border.)