title: Function Movement. Processing
body: <p>So I have a game that I am making and it involves shooting things at the player to try to get them to lose hearts. I need to write a function for Attack Right, Attack Left, Attack Down, and Attack Up. The problem is that once the function executes, and say I give it a x, a y, and a speed input, I want it to create a rectangle with the coordinates (x,y,50,10)
  After I draw the rectangle, and say the function that was called was attack right, was to update the x based on the speed. Like:</p>
  
  <p>rect(x,y,50,10)</p>
  
  <p>x=speed+x;</p>
  
  <p>For some reason when I call it though, it only executes once, when I want it to loop over and over again. When I put it in a draw loop, it just resets the function. Ideas?</p>
  
  <p>PS: If I need to make it clearer, just ask me.</p>