Ultra-Custom Rendering: Render Blocks as Turtles

129 views
Skip to first unread message

Beka Westberg

unread,
Apr 22, 2019, 8:09:53 PM4/22/19
to Blockly
Hello,

How possible would it be to render blocks as turtles (or tortoises if you prefer)? I think it would be super fun to create a LOGO esc turtle drawer where you program it with turtles.

Some details:
* There may need to be custom renderers on a per-block-type basis. For example, a turlte that puts the pen up and down should be holding a pen, while other turtles should not.
* I imagine this would cause some problems with the connection logic (though I know nothing about the connection logic). I'm thinking that the connection point would be head to tail.
* I haven't decided whether the turtles should be a top view or a side view. Side view looks better for pen-holding turtles, but top view looks better for rotating turtles.

IMG_20190422_170611.jpg


Any recommendations are welcome! Whether they be about how to achieve this, or comments about how to make a good turtle-based language. Thank you for your time!
Beka

P.S. Yes this is a stupid idea lol.

Coda Highland

unread,
Apr 23, 2019, 7:43:33 AM4/23/19
to blo...@googlegroups.com
Top view always, no doubt about it. It lets you put symbols on the shell.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rachel Fenichel

unread,
Apr 23, 2019, 2:06:09 PM4/23/19
to Blockly
Okay but what would you say if I told you it's turtles all the way down?

(This is from Vi Hart et al’s future programming research: http://elevr.com/portfolio/future-programming-interfaces/ Thanks to Eric R for the link.)

Also I'm pretty sure that if you wanted each turtle to just be a static size, shape, etc. you could do that by replacing Blockly.BlockSvg.render with a function that checks the type of the block and then sets the block's path/paths to a static SVG image of a turtle per block type, which would let you create/edit your turtle images in a real editor.

As long as you don't need to assemble the turtles from parts, it would be fine.  You would also want to remove any blocks that your renderer can't handle.

I don't know what you'd do about numbers/inputs, but I think you could just put the connection in the middle of the block and then make the number block rendering customized to look nicer.

You would have to figure out where the connections go, as you mentioned, but that's handled in render so you could get two turtles with one stone there.

TLDR this is significantly easier than trying to change block rendering in a way that consistently handles different types of inputs, branching, etc.  You could probably make a fun bugtastic version of it relatively quickly.  I have no comment on how you would generalize it or remove bugs, though.

Beka Westberg

unread,
Apr 23, 2019, 3:26:35 PM4/23/19
to Blockly
Thank you so much for the info!

That blog post you linked is so full of crazy and wonderful ideas, every time I look at it I'm like wow that would be so cool! and then I'm like wait but how would you even? hehehe

I'm glad to hear it shouldn't be too too tricky (as long as I don't go too crazy) I'll see if I can get a simple version of this working, if I get anywhere I'll be sure to post updates!

Thank you again for the info! Any further recommendations/comments are welcome,
Beka

Oh and Coda I think you're right! Top-down will probably end up being better, even if those side-view turtles look totally adorable.

Coda Highland

unread,
Apr 23, 2019, 6:09:46 PM4/23/19
to blo...@googlegroups.com
<3 Vi Hart. She's really got a way of weaving narrative into education. Perfect person for something like this.

/s/ Adam

--
Reply all
Reply to author
Forward
0 new messages