# Method Parameters in Blocks?

**URL:** https://forum.makecode.com/t/method-parameters-in-blocks/46052
**Category:** Help
**Tags:** extension
**Created:** [September 24, 2026, 3:10am UTC](https://forum.makecode.com/t/method-parameters-in-blocks/46052 "2026-09-24T03:10:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![teal256](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@teal256](https://forum.makecode.com/u/teal256)
#### Post date: [September 24, 2026, 3:10am UTC](https://forum.makecode.com/t/method-parameters-in-blocks/46052/1 "2026-09-24T03:10:55Z")

</div>

I’m using @richard’s Improved Sprite Data extension to define methods local to sprites (A.K.A. “Sprite Functions”). These are quite limited because they do not accept parameters, meaning everything I want to pass to the function must be set in a sprite data variable (or worse, a global variable). This creates two issues:

1. All sprite function parameters are in the same namespace, causing messy code and potential name collisions

2. More function parameters requires more lines (blocks?) of code in order to call the function. For example, a function with four parameters would require five blocks: Four to set each variable, and one to call the function. Below is a real example from a project I’m working on. The “FadeToPalette” method has two parameters.

A global function would only require one block to do the same thing:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/d/9d103b0d6eb96c8256942d8ff9943629a4a6cfe0.png)

**Is there an extension or another obvious solution to this problem?**

_(I suppose I could just use JavaScript instead of blocks…)_

---

<div class="post-metadata">

### Author: ![TheEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theearth/32/34579_2.png) [@TheEarth](https://forum.makecode.com/u/TheEarth)
#### Post date: [September 24, 2026, 4:50pm UTC](https://forum.makecode.com/t/method-parameters-in-blocks/46052/2 "2026-09-24T16:50:04Z")

</div>

Nope afaik

---

<div class="post-metadata">

### Author: ![teal256](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@teal256](https://forum.makecode.com/u/teal256)
#### Post date: [September 24, 2026, 4:55pm UTC](https://forum.makecode.com/t/method-parameters-in-blocks/46052/3 "2026-09-24T16:55:31Z")

</div>

I forgot to mention, but it would also be very useful for sprite functions to be capable of returning a value.

I did some googling and I’m pretty sure sprite “functions” aren’t even functions since they can’t return values, and they’re actually “nullary procedures”
