TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Play Solhopper – A Minimalist Game In ~500 Lines of HTML/CSS/JS

5 pointsby hi11 months ago
Hi HN!<p>I&#x27;m excited to share SOLHOPPER, a minimalist game I&#x27;m building in just ~500 lines of HTML&#x2F;CSS&#x2F;JS. Here&#x27;s a breakdown of the development process and some fun quirks of the game:<p>Challenges and Fun Facts:<p>- World Building &amp; Math: Crafting the initial world and refining the game mechanics to keep it simple and compact was the toughest part. The back story is that you play as a Solhopper captain traveling away from earth at 10% the speed of light to capture solar flairs which unlock endowments (bottom left) to develop that star system. These endowments were setup by benefactors centuries ago! I was playing around with Compound Interest and Galactic Timescales.<p>- HTML: Remembering how to implement the initial popup screen with plain CSS was a bit of a refresher. The HTML is only 20 lines of code.<p>- CSS: Styling without frameworks was a refreshing and enjoyable experience! I was able to design with around 100 lines of CSS. How refreshing is that!<p>- JS: This is my first game in a while, and I aimed to use plain JS. The entire game runs on 398 lines of code, and I think there&#x27;s still room for optimization.<p>- Deployment: I&#x27;m using the free tier of Netlify to host the game.<p>- Bugs: My favorite bug so far is when you leave the tab and come back a few minutes later, all the stars appear at once in a donut shape. It&#x27;s oddly satisfying, so I&#x27;m keeping it in for now.<p>- Grid: I almost forgot the grid! pressing the G key enables both square grid and then concentric circle grid. I had so much fun designing the circle grid and think it helps with high scores as the gameplay get&#x27;s harder!<p>- Game Stats:<p>- Top Right: Current orbit (based on Earth years, starting from 1665 AD)<p>- Bottom Right: Current radius of the &quot;civilsphere&quot; (a concept from the book the game is based on)<p>- Top Left: Ultimate high score<p>- Bottom Left: Current value of each star system endowment<p>- Top Center: Total stars captured by you, the Solhopper captain<p>- Origins: The game evolved from a sci-fi book I&#x27;m writing, which combines the concepts of compound interest and galactic time scales. The book is about 60 pages long and still in editing. You can find it hidden in the code (it&#x27;s a bit rough and unedited).<p>- High Score: It would be fun to use the comments as a leaderboard! My highest score so far is 157 stars captured, with a total endowment value of $Infinity.<p>Check out SOLHOPPER and let me know what you think! Any feedback or high scores would be greatly appreciated.<p>Play SOLHOPPER here: <a href="https:&#x2F;&#x2F;www.solhopper.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.solhopper.com&#x2F;</a>

1 comment

midzer11 months ago
Thanks for sharing this. Works for me pretty good :)<p>Good to see not including any 3rd party assets!
评论 #40811935 未加载