Here’s one of my new watchfaces. If you knew me, you’d know the salt-water aquarium had to become a reality eventually. 14 fish in the tank - some clowns, triggers, koran angels, and yellow tangs. Probably a huge CPU hog but fun to make regardless LOL.
Al,
DWFSS is my move engine. I used this minute cycle (0-360) to set when to start the cross. For example:
So some fish start before 60: #DWFSS#<60.
Some start after 60: DWFSS>60
One starts at 210: DWFSS>210
One starts after 180: DWFSS>180. and so on…
There are 360 units in #DWFSS# and there are 320 pixels across the watchface… Close enough, I didn’t bother to scale #DWFSS# units to watchface size.
The formulas for the fish moves are obviously in the X position field of each fish. If you let the fish move at the rate of #DWFSS# it is basically taking an entire minute to cross the screen which is way too slow. So you have to multiply to go faster. #DWFSS# * 9 is fast. #DWFSS# * 4 is kinda slow. #DWFSS# * 6 is a good pace, but I wanted some fish to go fast and others slower so I mixed up these multiplying values.
Formulas look like this:
$#DWFSS#>210?((#DWFSS#-210)*6):400$
which says: when DWFSS gets to 210 start moving from zero left side (subtract 210 first), then move at DWFSS * 6 speed. When the fish is not supposed to move yet, then just push the fish way off-screen (x = 400).
Move right-to-left is similar:
$#DWFSS#>145?(360-(#DWFSS#-145)*6):400$
Same thing but subtract everything from 360 so X gets smaller instead of bigger. This fish crosses after 145 units of DWFSS.
Each fish only has a one-condition formula. The same fish (ie: orange clownfishes) are the same image added multiple times. I used PhotoShop to cut fish out of photos and to flip them left and right as separate images. I’m sure there’s multiple ways to do this but this worked for me.
I’m going to try your code for my 2d animation illusion.Right now it just goes backwards and forwards, but your code should help a constant stream forward. Thanks!
Fun stuff, guys!!!
Keep in mind that you can enable your watch faces for inspection if you’d like other people to see how they’re made! You can then share the faces with the “inspect” at the end for everybody to see:
So I made a train scene with a train moving from left to right. Currently it takes the train +/- 45 seconds to reappear. How do I make it appear every 10 seconds?
hey Zibom,
That water effect is very cool. Is that two layers? I’ve been thinking of some kaleidoscope ideas and this technique would be perfect with 2 or three layers. Awesome.
Hey Zibom - TRAIN CODE:
So every 10 seconds means 6 times per minute, yes? Since you are using DWFSS, you want to cross to start going at 0, 60, 120, 180, 240, and 300 of DWFSS. The cheater answer is to just load your train.png 6 times (lol) and rename them train 1, train 2, train 3… etc.
Then each train copy gets it’s own simple formula - no brain melting on some giant nested conditional statement.
You’ll have to test if *6 is fast enough. For faster, just use larger number like *9 in each formula. Right? so the first train has to get across and out of the way before the second train starts crossing, etc.
Al,
(so much to learn…)
I learned everything I know right here in the community. There’s tons and tons of cool stuff and people building crazy things. Just stay involved and help with posts and other’s questions when you can.
You may also want to keep a little separate txt file “diary”. When you come across a cool post that has some awesome formula for example, add it to your diary. You may not need it today, but when you do you may struggle to find that one post again. Just build up your own custom library of cool math work.
Yes, two layers, first layer opacity reduced to 50% and spinning clockwise, the bottom layer spinning counterclockwise. I’ve unlocked it so you can take a look.