How to generate sinusoidal images that shift over time
Your code will produce a constant pattern along $x$ direction, so shifting this constant pattern along $x$ direction won't change anything.

To shift along $y$ direction you could replace $sin(2wy)$ by $sin(2wy + ct)$, and you have to choose $c$ depending on the amount of shift that you want.

Also you could create an initial image (for $t=1$) with an exactly integer number of periods, if at each time step your image shifted by integer number of pixels use circshift function to shift it by the amount that you want. If it doesn't shift by an integer number of pixels, you  have to take the FFT of the image and change the phase linearly. in this case you have to change the phase by $c\times W_x$ where $c$ is the ammount of shift in the $x$ direction and the $W_x$ is the spatial frequency in the $x$ direction.