# How to code to made a random sprite appear

**URL:** https://community.thunkable.com/t/how-to-code-to-made-a-random-sprite-appear/3387808
**Category:** Canvas / Gaming
**Created:** [December 4, 2024, 1:19am UTC](https://community.thunkable.com/t/how-to-code-to-made-a-random-sprite-appear/3387808 "2024-12-04T01:19:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![202042czkkze](https://avatars.discourse-cdn.com/v4/letter/2/c4cdca/32.png) [@202042czkkze](https://community.thunkable.com/u/202042czkkze)
#### Post date: [December 4, 2024, 1:19am UTC](https://community.thunkable.com/t/how-to-code-to-made-a-random-sprite-appear/3387808/1 "2024-12-04T01:19:40Z")

</div>

How to code to made a random sprite appear

---

<div class="post-metadata">

### Author: ![4iamotakus8balp](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/4iamotakus8balp/32/190032_2.png) [@4iamotakus8balp](https://community.thunkable.com/u/4iamotakus8balp)
#### Post date: [December 5, 2024, 7:34pm UTC](https://community.thunkable.com/t/how-to-code-to-made-a-random-sprite-appear/3387808/2 "2024-12-05T19:34:15Z")

</div>

I am a complete beginner but I would try this…

-Use a Variables block & Math Block  
“set app variable “_Sprite Number_” to” random integer from 1 to _however many sprites you have_"

-Then Use Control, Variables, Math, logic & Add &Remove Blocks.  
“if app variable “_Sprite Number_” = 1  
do + create Sprite\_Type1”  
**do this step for each sprite type changing the number for each type**

 ![blocks](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bca8cf572e1441a9831f7b71a412590e188b938c.png)  
**I hope this helps!**

---

<div class="post-metadata">

### Author: ![202042czkkze](https://avatars.discourse-cdn.com/v4/letter/2/c4cdca/32.png) [@202042czkkze](https://community.thunkable.com/u/202042czkkze)
#### Post date: [December 11, 2024, 1:24am UTC](https://community.thunkable.com/t/how-to-code-to-made-a-random-sprite-appear/3387808/3 "2024-12-11T01:24:35Z")

</div>

thank you so much!
