-
Notifications
You must be signed in to change notification settings - Fork 59
Created Drag Mode (previously god mode) #1145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to have a button-shaped indicator that says "drag mode" it would make sense to have it be a button to deactivate drag mode (or look less like a button). It also is covered by the fps indicator, the bottom left might be a better place for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice if whichever element you're dragging stayed fixed to the mouse cursor, since right now it drifts the farther you drag it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran into this, not 100% sure if this is intended or not. Happens on trackpad.
Screen.Recording.2025-06-20.at.15.00.22.mov
@BrandonPacewic I partially fixed the issue here, where now game pieces are actually draggable but they jitter a lot when dragged. I believe that this bug is beyond the scope of my PR but feel free to take a look and see if this jitter might be caused by an oversight in my code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still doesn't look like the robot is fixed to the cursor, since it's possible to move the cursor off of the robot while in drag mode.
Screen.Recording.2025-06-20.at.5.39.16.PM.mov
I also don't think this was part of the task, but in previous versions you were able to use the scroll wheel to move whatever you're holding towards and away from the camera which is nice for accurately placing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code here is quite interesting, seems to work well. Nice job
I also believe that @PepperLola's problems have been properly addressed.
Requested changes implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snazzy
Added a drag mode system that allows users to move and manipulate all dynamic objects including robots and game pieces. The system intercepts mouse interactions and moves bodies via force-based dragging. The system automatically detects draggable objects and excludes static bodies and field structures, with special handling for complex objects like robots by temporarily disabling their physics during drag operations. The drag also includes velocity damping, distance-based speed control, and mass-proportional force application. A visual drag mode indicator appears when drag mode is active and camera controls are automatically disabled during drag operations. The functionality is accessible through the debug panel with toggle controls and toast notifications for mode status changes. These changes collectively represent the deprecation of "God Mode" and replaces it with "Drag Mode".
(Difficult to demonstrate actual behavior through screenshots)