Creating a temperature simulation

Hi,

I think you are misleading here but it’s normal as a beginner :wink: 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 :
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!