# Creating a temperature simulation

**URL:** <https://discourse.processing.org/t/creating-a-temperature-simulation/21183>\
**Category:** Coding Questions\
**Created:** [May 22, 2020, 9:46pm UTC](https://discourse.processing.org/t/creating-a-temperature-simulation/21183 "2020-05-22T21:46:44Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 23, 2020, 6:07pm UTC](https://discourse.processing.org/t/creating-a-temperature-simulation/21183/6 "2020-05-23T18:07:34Z")

</div>

Hi,

I think you are misleading here but it’s normal as a beginner 😉 so let’s recap :

- As I said, there’s is no reason to display your image 5 times at 1 pixel of difference in the y direction (0, 1, … 4). It’s going to overlap them and it’s useless. You just need to display your image once at every frame.  
Since the `image()` function take the location of the upper left corner of the image, you only need this instruction :

```auto
image(bathImg, 0, 0);

```

- I suppose that you want your image to fill entirely the window so put the resolution in `size()` equal to the resolution of your image

- Remember that the `draw()` function is executing roughly 60 times per second in order for your eyes to perceive animation. So at every frame you need to display your image (it’s going to clear the whole window considering the previous point) and then your arrow

- I see that you understood the usage of the `map()` function so you can use it to display your arrow

- Check my previous post, you can find functions to display your arrow (hint : an arrow is composed of a rectangle and a triangle for the tip)

Hope it helps!

---

_[View the full topic](https://discourse.processing.org/t/creating-a-temperature-simulation/21183)._
