# Help with Turtle Extension block definition

**URL:** <https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335>\
**Category:** Arcade\
**Created:** [February 24, 2021, 4:15pm UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335 "2021-02-24T16:15:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr-Coxall](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mr-coxall/32/513_2.png) [@Mr-Coxall](https://forum.makecode.com/u/Mr-Coxall)\
**Post date:** [February 24, 2021, 4:15pm UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/1 "2021-02-24T16:15:53Z")

</div>

I am redoing the Turtle Extension from here: [https://github.com/microsoft/pxt-screen-turtle](https://github.com/microsoft/pxt-screen-turtle)  
I had some specific needs for multiple “turtles”, cartesian coordinate system and limited number of blocks.  
Overall I have it working.  
The issue is in creating the turtle.  
You need to drag out the block and then insert a sprite into it.  
Like this:

 ![Screen Shot 2021-02-24 at 10.04.26 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/aa80d1fde923a8dc723a43d2e4a2a726eea43a79.png)  
 ![Screen Shot 2021-02-24 at 10.04.35 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d7b20bb8ce4f7ae6d42f84affe606e071a89a22c.png)

For ease of use what I would like is to have the “sprite of kind player” block already embedded in the original block, so that there is one less step and less confusion with the students.  
Problem is I can not figure out a way to create a block like that.

Anyone have a suggestion?  
My Turtle extension is available here: [https://github.com/mr-coxall/turtle-logo/](https://github.com/mr-coxall/turtle-logo/)  
Thanks

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [February 24, 2021, 7:30pm UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/2 "2021-02-24T19:30:40Z")

</div>

if you do:

```auto
//% blockId=turtleFromSprite block="turtle of $sprite"
//% sprite.shadow=spritescreate

```

you’ll get

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b9e95c2a9db7dfd9d040257b0353d058bb78f552.png)

---

<div class="post-metadata">

**Author:** ![Mr-Coxall](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mr-coxall/32/513_2.png) [@Mr-Coxall](https://forum.makecode.com/u/Mr-Coxall)\
**Post date:** [February 24, 2021, 9:52pm UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/3 "2021-02-24T21:52:11Z")

</div>

Thanks so much that worked perfectly.

Any chance you might know how to place a user defined image inside the block?  
I would love for it to have the turtle pre-loaded as well.  
 ![Screen Shot 2021-02-24 at 4.42.06 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f64d8d92d7d7856a7eacb4c60d90b4a7b920141a.png)

Thanks

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [February 24, 2021, 9:57pm UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/4 "2021-02-24T21:57:35Z")

</div>

Not supported at this time but I like the idea 🙂 Could probably do pretty reasonably with default values for named assets as default values for images, but this is a little more complex as the image is nested within the spritecreate block / it would be setting the default deeper into the block

---

<div class="post-metadata">

**Author:** ![Mr-Coxall](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mr-coxall/32/513_2.png) [@Mr-Coxall](https://forum.makecode.com/u/Mr-Coxall)\
**Post date:** [February 25, 2021, 3:37am UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/5 "2021-02-25T03:37:15Z")

</div>

I just want to confirm that you think it might be possible to do with a default value to the image and then assign it to the sprite?

I did find this about “[Hidden Blocks](https://forum.makecode.com/t/how-to-make-an-extension/4225/13)”. I could get hidden blocks working, but once I tried it with Sprites, I couls not get it working.

Thanks

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [February 25, 2021, 7:04am UTC](https://forum.makecode.com/t/help-with-turtle-extension-block-definition/6335/6 "2021-02-25T07:04:18Z")

</div>

It is currently not possible, but might be something we could think about adding support for in the future.
