# Simulator crashing/freezing on sprite creation

**URL:** <https://forum.makecode.com/t/simulator-crashing-freezing-on-sprite-creation/2003>\
**Category:** Help\
**Created:** [May 7, 2020, 11:49pm UTC](https://forum.makecode.com/t/simulator-crashing-freezing-on-sprite-creation/2003 "2020-05-07T23:49:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gnitz/32/927_2.png) [@gnitz](https://forum.makecode.com/u/gnitz)\
**Post date:** [May 7, 2020, 11:49pm UTC](https://forum.makecode.com/t/simulator-crashing-freezing-on-sprite-creation/2003/1 "2020-05-07T23:49:40Z")

</div>

Hi,

I’ve observed the simulator repeatedly crashing/freezing when the below code is executed.

```
let sprTest = sprites.create(image.create(screen.width, screen.height / 1.3), 0)

```

On testing further, I observed the same code working fine for another set of values:  
`let sprTest2 = sprites.create(image.create(screen.width / 8, screen.height / 2), 0)`  
OR  
`let sprTest2 = sprites.create(image.create(screen.width / 8, screen.height / 1.5), 0)`

I’ve since realized that this happens whenever a non-whole number is supplied as an argument to `image.create()`. I can get around the issue by using a `math.round()` wrapper for the arguments, but I guess this should be default behavior for `image.create()`?

It took me a couple of hours to figure out what was originally causing the issue, I hope this helps anyone else who runs into the issue.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [May 8, 2020, 3:10am UTC](https://forum.makecode.com/t/simulator-crashing-freezing-on-sprite-creation/2003/2 "2020-05-08T03:10:05Z")

</div>

This is a good find. We should be cleaning up the input in the create api!
