Skip to content

added new sample code to demonstrate mass#1472

Open
Issykelly wants to merge 2 commits intoAlmasB:devfrom
Issykelly:dev
Open

added new sample code to demonstrate mass#1472
Issykelly wants to merge 2 commits intoAlmasB:devfrom
Issykelly:dev

Conversation

@Issykelly
Copy link
Copy Markdown

@Issykelly Issykelly commented Apr 10, 2026

#1433 I've added a new sample to demonstrate how mass affects physics, as well as how to directly make changes to the mass of an object. This demo uses small balls and seesaws to showcase how objects of different masses interact with each other and their environment.

Use the "Q", "E", "O" & "P" buttons to affect the on-screen mass. Then, click the left mouse button to spawn balls with the shown mass. Use these balls to interact with the seesaws and other balls and see how they interact!

As well as this, I've added the MassData code to the module info exports.

@Issykelly
Copy link
Copy Markdown
Author

#1433

Copy link
Copy Markdown
Owner

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, it looks good. Just one comment below.

import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems your IDE is adding an extra new line for each empty line, please can you check. Standard practice is 1 empty line, like at Line 38.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the response! I've gone ahead and fixed this. I'll be mindful to ensure I don't make the same formatting error again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants