tilde-os

tilde-os.neocities.org

34,253 views
21 followers
3,445 updates
0 tips
uhm how did you develop your aquarium page? I like it
2 likes
tilde-os's avatar tilde-os 4 months 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 4 months 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 3 months 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

1 like
tilde-os's avatar tilde-os 3 months 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!

1 like
devhank's avatar devhank 3 months ago

oh i get it tysm

2 likes
tilde-os updated their site.
10 months ago
1 like
tilde-os updated their site.
10 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 1 week ago
CreatedJul 4, 2023

Tags

art programming blog trans experimental