What Goes In Must Come Out by SimplePotential
My Compo entry for LD47, "What Goes In Must Come Out".
Not a lot of time to dedicate to this so I stripped down to using HTML and JS Only this time around, no Unity. Used Bfxr for the sound effects.
I took a lot of inspiration from old DOS style games such as Snake.
Controls: At the title screen, Pressing S, Space, or Enter will start the game.
P will toggle Pause
M will toggle Mute
Use Arrow Keys or WASD to move; Game will actually start once you start moving
You are the White box.
Note that you can pass through the wall to the other side of the screen
Refresh the page to start a new game
While I consider myself well versed in HTML and JS, I was completely new to using the Canvas for anything other than Graph style work but found it remarkably easy to build on. If I was doing it over I'd change a lot of code, such as how I'm building the title screen.
I opted for nothing other that drawing shapes and text on the canvas in order to stay in my time restraints and in the Compo. I rather like the old school look though. It'd be pretty easy to switch to actual icons too though.
A note about balance... I play tested as much as I could but it is still pretty random. Try it again a couple times if you die right away. You should be able to get a score of at least 1000 points I think. I average between 3,000 and 10,000 points.
My play testers went from saying it was too hard to now being too easy. Let me know what you think, I wouldn't mind fleshing this out a bit more, cleaning up the code and using as a tutorial on my site.

UPDATED ON 10/19/2020:
Working more on this last few days but nothing new ready to deploy. Added a bonus item that will show when there is X amount of poo on screen with a spawn chance that increased for every X poo. This helps a bit with garbage clean up if you manage to get high scores and helps with lag. However lag is still an issues I'm tracking down. I know it is happening as the arrays get larger. I can see it in the delta times going from about 10-15ms toward start of game up to 30ms or so the longer you play.
UPDATED ON 10/14/2020:
I've been working a bit on a post jam version. Which is always something I say I'll do but never quite get around to it. Change log below but most significant is I've narrowed down the lag I think and have take steps to mitigate it. More work to do still but far more playable at higher levels.
Post Jam Version: https://simplepotential.com/projects/LD47v2/game.htm
- Changed keyup Event Listener to a switch statement rather than multiple listeners
- No longer using keyCode on the KeyboardEvent object
- Using “code” as keyCode has been deprecated
- Adjusted appropriate code to check based on string matches rather than numeric codes
- Removed “S” as the way to start the game
- It is now Space or Enter.
- “P” can also be used to Start the game
- The same keys all now pause the game as well.
- Pooing can now occur when you are >= 50% belly.
- Speeds up game play
- Keeps it more interesting
- Currently a 5% chance to poo when above 50% belly
- At 100% belly, you poo all excess % just as you would have before
- Corrected bug with Player movement cost
- I was adding/subtracting based on players Belly fullness but never using the value from that calculation so your energy cost was always flat.
- Removed play speed increase based on score.
- Thought this might be the source of lag but I’ve managed to reproduce the lag I think so still investigating
- Game is fast paced enough without increasing the actual play speed though
- Corrected all spellings of Collision
- Added more commenting
- Food is now removed from game play if it gets poo on it.
- I mean, who wants to eat food with poo on it right?
- Mouse cursor now hidden from the game play area
- Pressing F2 will now start a new game without having to refresh the page
- Max food that can spawn at any time is now 30
- This balances the game a bit
- Also helps a bit with the lag since there is less things to collision detect
- Turned player moving sound into a loop rather than play/stop each tick.
- This has helped a lot with lag
- Removing all sound gets rid of all lag but I’d prefer another solution and I’m still investigating.
Ratings
| Overall | 585th | 2.689⭐ | 47🧑⚖️ |
| Fun | 541th | 2.667⭐ | 47🧑⚖️ |
| Innovation | 570th | 2.556⭐ | 47🧑⚖️ |
| Theme | 609th | 2.261⭐ | 46🧑⚖️ |
| Graphics | 604th | 1.966⭐ | 46🧑⚖️ |
| Audio | 470th | 2.378⭐ | 43🧑⚖️ |
| Humor | 368th | 2.264⭐ | 38🧑⚖️ |
| Mood | 568th | 2.145⭐ | 40🧑⚖️ |
| Given | 49🗳️ | 59🗨️ |
Very cool, I was trying to avoid the walls for the entire run, so was really surprised when I hit the wall and passed right through :)
I love the sounds, and they give a good bit of feedback when you hit a block that's good/bad (I think the brown box was bad?)


@apbakeware - Thanks! Color blindness was my main concern with play ability, I thought about adding a letter to the middle of the squares to help differentiate them but ultimately it was causing my some positioning issues so I abandoned it. I think I could set it up with an icon mode, might do that in the future then the player would could use their preference.

To solve the difficulty problem, I think, you just need to make the start easier, and the rest harder. You could probably spawn a couple food before the start of the game, so the player had a chance to get to one of them before dying. In the mid-game (what I call a stage before poo overflow) you could limit the amount of food being able to spawn(not sure how hard it is in js, never used it).
The rest of the game is pretty simple, and not too bad for a quick jam.
I think the problem is that you don't ever have to poo. Just wait until you are under 50% before picking up the purple and just randomly eat greens until you can get to a purple with under 50% food. Maybe you could add some objects to dodge or have the game change in some way as you progress?
Nicely done coding everything from scratch!
@milk - Thanks so much!
Good job making 3 colours of squares fun. Also, it's cool that you tried something new.
@barrier - Heard that from one other in the comments. Any chance you can provide the browser you used and some high level PC specs? I haven't been able to replicate but both my machines are gaming rigs.
@burnedkirby - Thanks!
@judgezedd - Thanks, exactly what I was going for and it was a good place to try out a new technology (new to me anyway).
@cogcomp - Lol, thanks. My brother said something similar and apparently wasted too much time on it
fun game, with just a few coloured squares, nicely done!
I noticed some purple cubes covered by brown poo squares, but other than that everything seemed to work well.
As for graphics, well... they're cubes, and in colour tones on a black background that don't really come across as a balanced colour palette. I'm glad you had the audio that was there, and it definitely suits the retro look of the game, but there's clear room for improvement there as well.
That said, a solid idea executed well enough. Good job!
Would have been more enjoyable without the slowdown, however the basic idea is good and could be expanded upon. My best score was 12245. Oh, and I couldn't restart once I lost so I had to refresh the window everytime. Brave of you not to use one of the common game engines. :) Overall, well done!
@notime4games - Thank you as well! Pretty sure I figured out the lag issue I just gotta take time to rewrite it :) As for the restarting of the game, I have that in the post jam version but didn't get it into the original unfortunately. Not sure on the collision issue, I haven't experienced it. My guess is I have something messed up in the collision function maybe a float is getting parse as int and rounding off the position. I'll look into it.