Giter VIP home page Giter VIP logo

turtleart-activity's Introduction

TurtleBlocks

Turtle Art, also known as Turtle Blocks, is an activity with a Logo-inspired graphical "turtle" that draws colorful art based on snap-together visual programming elements. Its "low floor" provides an easy entry point for beginners. It also has "high ceiling" programming, graphics, mathematics, and Computer Science features which will challenge the more adventurous student.

.. note ::

There are two inter-compatible programs: Turtle Art and Turtle Blocks. Turtle Art, which closely parallels the Java version of Turtle Art maintained by Brian Silverman, offers a small subset of the functionality of Turtle Blocks. Turtle Blocks is the version included in the Sugar distribution. Sugar users probably want to use Turtle Blocks rather than Turtle Art. (Also see Turtle Confusion, a collection of programming challenges designed by Barry Newell.)

Using Turtle Art

Start by clicking on (or dragging) blocks from the Turtle palette. Use multiple blocks to create drawings; as the turtle moves under your control, colorful lines are drawn.

You add blocks to your program by clicking on or dragging them from the palette to the main area. You can delete a block by dragging it back onto the palette. Click anywhere on a "stack" of blocks to start executing that stack or by clicking in the Rabbit (fast) or Turtle (slow) on the Main Toolbar.

Dependencies

  • Python 3,
  • PyGObject,
  • GLib,
  • GTK 3,
  • Pango,
  • Pango Cairo,
  • Telepathy GLib,
  • Sugar Toolkit,
  • GStreamer,
  • Csound,
  • WebKit,

Copied Dependencies

  • CollabWrapper,
  • sugariconify,

turtleart-activity's People

Contributors

aguirrea avatar alanjas avatar chimosky avatar clytie avatar cosimoc avatar cscott avatar cynthiasolomon avatar dimi20cen avatar dsd avatar i5o avatar icarito avatar kipply avatar kiy4h avatar korakurider avatar lfaraone avatar mslg avatar outofthecave avatar picobrian avatar pootle-sugarlabs avatar quozl avatar rafaelcor avatar rbuj avatar rgs1 avatar rhl-bthr avatar saumya-mishra9129 avatar srevinsaju avatar starnight avatar vipulgupta2048 avatar walterbender avatar zeeshank95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

turtleart-activity's Issues

Collaboration: Players are able to move other's turtles

This shouldn't happen, and it may cause a mis-synchronization on both the sharer or joiner.

image

On the image above, the right is the joiner and the left is the sharer. The sharer is the one who moved the joiner's turtle (doesn't apply to the joiner).

Help button error.

On clicking the help button the conosle shows the following error

  File "/home/guest/turtleart-activity/TurtleArt/util/helpbutton.py", line 76, in __help_button_clicked_cb
    self._palette.popup(immediate=True, state=1)
TypeError: popup() got an unexpected keyword argument 'state'

hollow line support

We have support for a "hollow line" in the JavaScript version of Turtle. It appears on the Pen Palette and implemented in the Turtle Painter code.

https://github.com/sugarlabs/musicblocks/blob/2d4f48bd62908ca16a8abe15742615270677a006/js/blocks/PenBlocks.js#L588

https://github.com/sugarlabs/musicblocks/blob/2d4f48bd62908ca16a8abe15742615270677a006/js/turtle-painter.js#L262

Screenshot from 2024-05-28 07-18-40

The block is really useful for 3-D printing, where you can directly extrude from the exported SVG using programs like TinkerCad.

Josh Burker has lots of fun lesson plans that use this feature:

See https://www.redalyc.org/pdf/547/54741184007.pdf

The goal here is to provide similar functionality to the Python code.

RuntimeError: sys.meta_path must be a list of import hooks, AttributeError: 'NoneType' object has no attribute 'SMALL_ICON_SIZE'

On Fedora 18 on an XO-4 with Sugar 0.112, the Turtle Blocks 218 logs this on stop;

Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/sugar3/logger.py", line 72, in _except_
    from IPython.ultraTB import AutoFormattedTB
RuntimeError: sys.meta_path must be a list of import hooks

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line 559, in 
ferred_height
    self._sync_image_properties()
  File "/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py", line 536, in 
e_properties
    pixel_size = style.SMALL_ICON_SIZE
AttributeError: 'NoneType' object has no attribute 'SMALL_ICON_SIZE'

No apparent impact.

No other activities log this.

A bisection shows regression introduced by e3f8fa9 GTK3 and GST1.0 port.

v218 touch unresponsive and step mode hangs

On upgrade from v215 to v218, two problems observed by a teacher;

  • it is more difficult to use touch to deploy a block to the canvas,
  • step mode stops, and log contains errors.
Traceback (most recent call last):
  File "/home/olpc/Activities/TurtleBlocks.activity/TurtleArt/talogo.py", line 627, in doevalstep
    self.step.next()
  File "/home/olpc/Activities/TurtleBlocks.activity/TurtleArt/talogo.py", line 596, in _evalsym
    result = self.cfun.fcn(self, *self.arglist)
  File "/home/olpc/Activities/TurtleBlocks.activity/TurtleArt/taprimitive.py", line 325, in __call__
    new_prim.call_afterwards(*new_args, **new_kwargs)
  File "/home/olpc/Activities/TurtleBlocks.activity/TurtleArt/tabasics.py", line 1311, in after_move
    self.tw.coord_scale)
  File "/home/olpc/Activities/TurtleBlocks.activity/TurtleArt/talogo.py", line 1097, in update_label_value
    for block in self.value_blocks_to_update[name]:
AttributeError: LogoCode instance has no attribute 'value_blocks_to_update'

org.laptop.TurtleArtActivity-2.log

Traceback when testing collaboration

I'm not sure what I triggered to have this error pop, but it's clear that it's trying to compare a string to an integer:

Traceback (most recent call last):
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/tacollaboration.py", line 133, in _message_cb
    self._processing_methods[action](msg.get('event'))
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/tacollaboration.py", line 151, in _turtle_request
    if payload > 0:
TypeError: '>' not supported between instances of 'str' and 'int'

Pi GPIO support

Let Raspberry Pi users read/write to GPIO. Not sure about the best approach (extension?).

Two po/*.pot files

There are two POT files in the repository.

Perhaps there should be one? I'm not sure; I know it is a complex activity with respect to the extras repository. No impact in my debian packaging or running the activity.

Fails to Start

Activity fails to start and this is seen in the logs.
GLib-GIO-ERROR **: 06:16:20.565: Settings schema 'org.laptop.TurtleArtActivity' does not contain a key named 'plugins-list'.

Port from GConf to Gio.Settings

References include tautils.py, tawindow.py, turtleblocks.py, TurtleArtActivity.py, buddy.py, neighborhood.py, and xocolor.py

Missing pt_BR locale

./osbuild build crashed on building this activity.

[osbuild /]$ build turtleart
* Building turtleart

Command failed: python2.7 /home/broot/sugar-build/turtleart/setup.py install --prefix /home/broot/sugar-build/build/out/install

/home/broot/sugar-build/turtleart/po/pt_BR.po:845: end-of-line within string
msgfmt: found 1 fatal error
ERROR - msgfmt failed with return code 1.
Traceback (most recent call last):
  File "/home/broot/sugar-build/turtleart/setup.py", line 32, in <module>
    bundlebuilder.start()
  File "/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/sugar/activity/bundlebuilder.py", line 403, in start
    globals()['cmd_' + args[0]](config, args[1:])
  File "/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/sugar/activity/bundlebuilder.py", line 326, in cmd_install
    installer.install(suboptions.prefix)
  File "/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/sugar/activity/bundlebuilder.py", line 238, in install
    self.builder.build()
  File "/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/sugar/activity/bundlebuilder.py", line 105, in build
    self.build_locale()
  File "/home/broot/sugar-build/build/out/install/lib/python2.7/site-packages/sugar/activity/bundlebuilder.py", line 137, in build_locale
    cat = gettext.GNUTranslations(open(mo_file, 'r'))
IOError: [Errno 2] No such file or directory: '/home/broot/sugar-build/turtleart/locale/pt_BR/LC_MESSAGES/org.laptop.TurtleArtActivity.mo'

The media palette is broken

https://user-images.githubusercontent.com/481418/118795052-30d05000-b868-11eb-819e-0895c2752e7b.png

Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 1241, in _buttonpress_cb
    self.button_press(
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 1311, in button_press
    elif self._check_for_anything_else(spr, x, y):
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 1624, in _check_for_anything_else
    self._select_category(spr)
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 1794, in _select_category
    self.show_palette(i)
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 987, in show_palette
    self.show_toolbar_palette(n)
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 1097, in show_toolbar_palette
    self.palette_views[n].create(regenerate=regenerate, show=show)
  File "/app/lib/python3.8/site-packages/TurtleArt/tapaletteview.py", line 64, in create
    self._create_proto_blocks()
  File "/app/lib/python3.8/site-packages/TurtleArt/tapaletteview.py", line 198, in _create_proto_blocks
    self._proto_skin(name + 'small', self.blocks[-1].spr)
  File "/app/lib/python3.8/site-packages/TurtleArt/tapaletteview.py", line 211, in _proto_skin
    x, y = self._turtle_window.calc_image_offset(name, spr)
  File "/app/lib/python3.8/site-packages/TurtleArt/tawindow.py", line 4863, in calc_image_offset
    iw = self.media_shapes[name].get_width()
KeyError: 'camera1small'

as reported on flathub/org.laptop.TurtleArtActivity#5 (comment) , managed to reproduce myself.

One thing to note is it seems that clicking it the first time produces the error but going to another tab and then back to it works fine.

rename repo

Once the GTK3 branch is merged, we should rename this repo to activity-turtleart and remove the deprecated activity-turtleart-gtk3 repo

-o command line option doesn't work

It's supposed to output .png of canvas.

I've gone back in git history and found it was working in v92 but no longer in v100.

Only a blank canvas is produced in current master branch.

file selectors not working properly

The GTK file selectors (when running from cmd line outside of Sugar) seem to behaving properly from th UX POV, but they return empty filenames.

For example, the Save and Save As selectors don't work. The Export As Image selector also fails.

flake8 opportunities

About 8463 flake8 errors are generated by;

python2 -m flake8 $(find . -name '*.py') | wc --lines

Work can be broken down into main program, plugins, and others.

Change python2 to python3 once the activity has been ported.

Fullscreen doesn't fill screen, math prime factors circles are drawn as lines

Reproducer: load example samples/math-prime-factors.ta, and run. The thumbnail for the example looks like this;

math-prime-factors

Expected result: display uses full screen, filled coloured circles are drawn.

Observed result: display does not use full screen, circles are drawn as lines. Like this;

tba-2

Downgrading to 215 fixes both.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.