StartX = Math.floor(random(dimX))*gap + origin GridRate = 300 //speed (pixels per second) Gap = 20 // distance between cells (pixels) Origin = //upper left hand corner of grid Each time a layer reaches a grid intersection, we want it pause there for a pre-determined length of time. Furthermore, we want this motion to be directed along a grid. Then we want to generate a smooth random motion that only occurs in the x or y direction. At the beginning, we want each layer to position itself randomly at a grid intersection (which means we can develop our expression for one layer and then duplicate the layer a bunch of times and have the duplicates randomly populate the grid). First we need to lay out the requirements for this little project. Now let's really jump into the deep end of the pool and look at a much more complex example. FlickerDur = random(flickerDurMin,flickerDurMax)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |