tilde-os

tilde-os.yorniq.xyz

28,389 views
14 followers
3,123 updates
0 tips
uhm how did you develop your aquarium page? I like it
2 likes
tilde-os's avatar tilde-os 2 weeks ago

hiya! Javascript has a function named setInterval (https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval) which lets you set a function to be called at some arbitrary regular time increment! I then used that to make a tick loop to move things around every couple milliseconds!

1 like
devhank's avatar devhank 2 weeks ago

oh yea Ik you'd use setInterval to write JS timer function, I mean how did you write for the dropping food anywhere on the page so one of your fishes flips itself and goes eat it part?

1 like
tilde-os's avatar tilde-os 2 days ago

hiii sorry i missed your reply! So the way i handled it was like this: fish idle by randomly picking a point on the screen, and a duration to get there, then lerping to reach it. When you click on the screen, it registers the location that you clicked on (like the screen x and y), and constructs a Food object which is then put into an array

tilde-os's avatar tilde-os 2 days ago

When a fish goes to pick its new random point, if there is food in the array, then it pops the food off of the array, and sets *that* as its next point instead! Once it reaches the position, it deletes the food and goes back to idling!

tilde-os updated their site.
6 months ago
1 like
tilde-os updated their site.
6 months ago
1 like
hi y'all! been a while :P Finally actually added something to the site again!
2 likes
found you >:)
1 like
tilde-os updated their site.
1 year ago
1 like
tilde-os updated their site.
1 year ago
1 like
tilde-os updated their site.
1 year ago
1 like

Website Stats

Last updated 4 days ago
CreatedJul 4, 2023
Site Traffic Stats

Tags

art programming pixel trans