Shake a image from code
BlitzMax Forums/BlitzMax Programming/Shake a image from code
| ||
How could one do that? I'm thinking of some trigonometry stuff. I use sin and cos for a lot of nice visual effects but still...? Do you guys have a cool ideea? |
| ||
You could use Rnd() to offset the images current location by a small amountconst RANGE#=2.0 Global ox#,oy# Global imgX#=320 , imgY#=240 Repeat ox=Rnd(-RANGE,RANGE) ; oy=Rnd(-RANGE,RANGE) DrawImage myimage,imgX+ox,imgY+oy Until KeyHit(KEY_ESCAPE) |