// Create a new pattern based on an image filevariable tPatternputpatternwithimagefromfile"images/patternframe1.png"into tPattern// Store the old image of tPatternvariable tImageputtheimageof tPattern into tImage// Set the pattern to draw the next imagesettheimageof tPattern toimagefromfile"images/patternframe2.png"