This is a hard subject to explain, so I have included 2 ways of doing this. One is affecting the object and the other is drawn. Use the links below to learn more on each code.
image_angle Image angle is used to rotate the sprite of the object specified. The image will rotate around its specified origin(X,Y.)