# 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:** 1\
**Showing post:** 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…)_

---

_[View the full topic](https://forum.makecode.com/t/method-parameters-in-blocks/46052)._
