Opened 8 years ago

Closed 4 years ago

#1615 closed enhancement (fixed)

Add a button in Physics Activity to clear off the whole screen at once

Reported by: mchua Owned by: garycmartin
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Physics Version: 0.84.x
Severity: Unspecified Keywords:
Cc: eben, bernie Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

(Dictated by Audrey Kim, age 6)

Is there a button to clear off the whole screen? It'd be good if we wouldn't have to click around [to erase things] so much.

Her older cousin Mel says: We're using Physics version 3 on an XO running the 0.84.2 Sugar build. I'd be willing to sit down with the Physics maintainer on IRC and make the change, because Physics seems to be a hit with the first-graders at Cambridge Friends School and I'd like to be able to tweak it in realtime and then submit those tweaks upstream.

Change History (4)

comment:1 in reply to: ↑ description Changed 8 years ago by garycmartin

  • Cc eben added

Replying to mchua:

(Dictated by Audrey Kim, age 6)

Is there a button to clear off the whole screen? It'd be good if we wouldn't have to click around [to erase things] so much.

Her older cousin Mel says: We're using Physics version 3 on an XO running the 0.84.2 Sugar build. I'd be willing to sit down with the Physics maintainer on IRC and make the change, because Physics seems to be a hit with the first-graders at Cambridge Friends School and I'd like to be able to tweak it in realtime and then submit those tweaks upstream.

Thanks for the feedback!

One quick hint is that the Erase tool works with both single clicks and if you draw with it, like a line of death, you can quickly scribble many objects away. A Single click erase all button has come up once before, but I have worries that without a full undo system, and with Sugar's Journal auto state saving design, folks will frequently destroy previous efforts, and/or fail to keep records of new efforts.

It feels like a general Sugar UI design issue that frequently comes up for all activities; the 'start new activity from home', 'do stuff', 'stop', 'start new activity from home', 'do stuff', 'stop'... workflow does not seem to be obvious/fast enough for most needs. The obvious solution (that badly breaks the Sugar activity design metaphor), is for all activities to implement a "New Activity" primary toolbar button. It would keep the current activity state to Journal so no work is lost, and then create a new blank activity that you would carry on working in (i.e. the application would not quit, just revert to a clean first launch state).

comment:2 Changed 8 years ago by mkim

I was informed about the change my sister Audrey came up with for the activity by Mel and I'd like to also help out in some way or another. I'm pretty much a newbie, so I don't know how much help I'd be [plus I'm still in school so time is a bit limited] but maybe it's a good time to learn?

comment:3 Changed 8 years ago by garycmartin

  • Cc bernie added
  • Distribution/OS changed from OLPC to Unspecified

Possible patch from Bernie posted to the mail-list (thanks). I'm still concerned that without first adding an undo mechanism (or real Journal versioning), this feature will result in loss of work with no way of recovery:

--- Physics.activity/tools.py.orig	2009-12-18 22:43:20.779933607 -0500
+++ Physics.activity/tools.py	2009-12-18 22:41:50.680806893 -0500
@@ -458,6 +458,23 @@
                    else:
                        self.game.world.world.DestroyBody(tokill[0])

+            # Destroy everything!
+            elif pygame.mouse.get_pressed()[2]:
+
+                # Build a Python list of all bodies from the linked list returned by box2D
+                body = self.game.world.world.GetBodyList()
+                shapes = []
+                while body:
+                    shapes.append(body)
+                    body = body.GetNext()
+
+                # Destroy everything! Muhahahah!
+                for body in shapes:
+                    self.game.world.world.DestroyBody(body)
+
+                # Oops! Restore the ground which we eagerly destroyed :-)
+                self.game.world.add.ground()
+
            elif event.type == MOUSEBUTTONUP and event.button == 1:
                self.cancel()
    def draw(self):

comment:4 Changed 4 years ago by walter

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.