5 ms·
Show HN: Listen To The Ocean – JavaScript game w. AI-generated sprites
- Aeolun 4y agoWhat is with these people literally shooting trash into to water?
- neontomo 4y agoHaha, well, this started as a project for my class about sustainability, so the game is meant to show how much the ocean is in danger, which is does by literally making it impossible to "win" by simply picking up trash. That's why some of the trash is impossibly fast.
- Aeolun 4y agoI’d imagine it’s equally poignant when you realize there’s literally no end to the trash, regardless of how much you pick up ;) It’s certainly true the rocket trash successfully kills my fishes though.
- itake 4y agoThe game gets really easy when you make the width of the screen as small as it can go.
- onion2k 4y agoWhat we can learn from this is that if we build a dam across the Pacific with a single opening 1 plastic bottle wide, we can easily fix the problem of ocean plastics. I will not be taking questions at this time.
- neontomo 4y agoYou're on to something...
- neontomo 4y agoIf only reality was this simple.
- mikojan 4y agoPerformance is disastrous on my machine. Janks more often than not. Looks like most time is spent computing styles and parsing CSS.
- dagurp 4y agoSame here. It doesn't use any GPU. The creator should check out this video https://www.youtube.com/watch?v=bEoLCZzWZX8& https://www.youtube.com/watch?v=bEoLCZzWZX8&
- asddubs 4y agohaven't watched the video but it seems to me that in this case the solution would be as simple as using canvas + requestAnimationFrame instead of the DOM
- neontomo 4y agoThat's a great solution. I've been trying to wrap my head around canvas manipulation but it just gives me a headache and I prefer making quick prototypes. I need to learn it one of these days.
- dagurp 4y agoThat certainly would improve it but as the video points out, it can be simply about choosing the right CSS properties to update in each animation step. You can see in the examples[0] that instead of changing the "left: x" value you can use "transform: translateX(val)" for a huge performance boost. 0. https://lonekorean.github.io/animation-workshop/ https://lonekorean.github.io/animation-workshop/
- cableshaft 4y agoNeeds more of an arc to the game and end more quickly naturally. Like more trash at a time as you go on, or don't ever make it so it goes down to only a single fish. I got to 49/50 and just had to keep the trash can hovering over the fish, and I eventually stopped collecting on purpose after my score got above 1000. Also might be better if some of the trash specifically targets fish instead of just dropping randomly. Like you determine the trajectory of the trash and fish and spawn it so it will hit it normally. Didn't seem to do that at all once I got down to only a few fish left, things just got way easier for me because there was less targets to protect. Clever idea though, and the mechanics are nice and smooth.
- neontomo 4y agoThanks buddy, glad you like it. Some real MVP suggestions here, I like the trajectory idea the most. Might be a weekend project... Yes I did notice that the last fish is very easy to protect, then again, it becomes that much more of an important mission to save the last fish in existence. I guess in a sense, it's a feature not a bug.
- 29athrowaway 4y agoI prefer Xbill
- neontomo 4y agoThat's a new one for me, thanks!
- ge96 4y agoThat's brutal, trash touches fish, they die
- neontomo 4y agoRIP
- nashashmi 4y agoNeeds to start slowly and work its way up. gets janky when lots of fish are in the water.
- neontomo 4y agoThanks, good idea!
- kaetemi 4y ago2fps on my phone.
- neontomo 4y agoSo you're saying there's a chance?