Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
LSD – Line Square Dot Game (lalo.li)
239 points by franze on Aug 28, 2015 | hide | past | favorite | 70 comments


hi, OP here.

coded this game once upon a time for a viennajs (js meetup vienna) talk. added a little bit more game logic yesterday.

homegrown physics engine (buggy as you will find out) inspired to some degree on what i learned via http://annotated-code.maryrosecook.com/circles-bouncing-off-... (saw this on HN, decided that it should be a game)

issues:

* sometimes dot gets stuck on a line (strangely this happens more on mobile phones then on desktop)

* sometimes dot vanishes (i suspect a NaN error)

* on windows phone lines can not be drawn sticky (not a clue on how to debug this on a mac)

why did i do it:

* for the love of code

* i like simple games (this is another one of my games http://www.fullstackoptimization.com/bubbles/ )

pull requests / forks welcome https://github.com/franzenzenhofer/lsd


SOMEONE posted your game on http://reddit.com/r/webgames, and it's currently the top game!


Hi, great idea with the Line Square Dot, though I find it enjoyable only on a touch screen.

Your game "Bubbles" reminds me of Osmos (http://www.osmos-game.com/), has it inspired you?


Osmosis + Asteroids kinda

but basically it was explorative coding: start with a circle, OK, let's move the circle around, what's next? More circles, OK what happens if the intersect ... And so on.


It also reminds me a lot of agar.io


timeline wise bubbles was first (osmosis is the great-grandfather), but as always: ideas are in the air, forked, replicated, mutated, pivoted, and then taken multiplayer (agar.io is genius, love it)


Osmos is a really good game. Every little detail fits perfectly in the universe they have created, be it arts, music, gameplay...


Great work. Have you considered adding a score (i.e. using time to complete level and amount of ink used (e.g. length of lines, or simply number of lines), or was it a conscious decision to keep the game simple & allow players more creative freedom?


added averages at one point, didn't add much to the game, removed it (maybe i was wrong) - forks and push requests welcome


Could you tell us a bit about the physics? I'm fine with AABB collisions - but any-old-angle collisions sound hard!


don't know much about physics other than what i read in the source of http://annotated-code.maryrosecook.com/circles-bouncing-off-... and web2d source which i used to code https://github.com/franzenzenhofer/box2d-jquery - it's all just arrays of vectors.


This game is a real trip. Thanks, man.


Bubbles is bad ass as well!


It's funny how a game featuring literally a line, a square and a dot can make one core in my machine go nearly 100%. Yay webapps!

EDIT: And it does not run at 60 fps.


Any program that runs in an infinite loop will use 100% CPU.


Stutters pretty bad on my UHD screen :(


It's bad design then :)


A border around the playfield would help - I keep trying to draw lines that extend slightly outside the browser window, and inadvertently do things like grabbing a bookmark from the bookmarks bar above.


Yeah, that would help a lot. Also might be possible to see where the ball comes back in a little earlier then. Another little helper would be to draw the level-start-lines not completely up to the border. Because often you can then still route around them all to reach otherwise unsolvable levels.


Felt like I was mostly playing jezzball. Simply trap it in a box and keep narrowing it down until they touch. Fun!


My immediate reaction too, that was such an awesome game.


polygons!

edit: got to level 10 with this approach before giving up. basically, bound the ball into an area towards the goal as soon as it gets there by enclosing it in a polygon. as long as you keep getting it closer, you eventually get it into a polygon with the target - it works out. It will even pretty much guarantee the ball eventually goes through small gaps it needs to to pass through one polygon to another

Seems like a good explanation for how gases work.


Yeah I'm using the same strategy, i'd add that you just need to be careful when drawing small polygons because a glitch can cause the ball to cross the line anyways and then it's hard to get it back to where you want it... except if you use the glitches to your advantage ! :)


I have used same strategy and is sure to work on any level because eventually it'd just converge the ball towards the box.


...except for the bug where the ball gets trapped in a line and pops out of an enclosed polygon.


Or when the box is completely surrounded by lines and your only hope to win is a bug :)

I also try to make the box the area in my polygon with the lowest potential energy. It seems to (mostly) obey conservation of energy, so....


same here, still playing (in the background tab)...

reminds me of Jezzball :D


The biggest abuse in this game is that the ball can be pushed through the walls with enough lines drawn onto it


This is the best game i've ever played in my life! super addictive!


Surprisingly addictive for such a simple game. Too bad the acronym didn't spell out "cocaine" or something.

Nice work. If you wanted to spiff it up, you might change the dot to a basketball and the square to a hoop. And add some satisfying sounds. Bouncing on the rim and having the net move in a plausible way would be some work for you. :)


Forgive me but can anyone summarize how to actually play this game?


Draw lines in order to bounce a dot to square. Simple "physics" game, quite fun actually.


I had to read the source to figure out that I had to use the mouse (or touch if available) instead of the keyboard. From there, I figured it out quickly enough though. The problem is that drawing lines is tricky with a trackpad, and not a natural thing to try out.


To get to the next level draw lines to bounce the ball into the square.


Can't wait till someone makes an AI for this.


I broke it, the ball stuck on the line


Cool little game, even better that it's made without a framework. Maybe you should add a facebook opengraph image so it looks a bit more attractive when shared.


done (using a really cheap og:image image)


Level 3 and it's impossible:

https://i.imgur.com/OOu7rsn.png


There are occasional impossible scenarios, but that one is far from impossible, and you don't even have to use glitching. It's a real challenge, but you can make use of the fact that the ball bounces off the top of the screen and comes back if it goes straight up enough. In that scenario, I'd immediately draw a vertical line down the right edge of the screen (that's where the ball is about to head, then I'd get ready to draw a horizontal line across the top right as soon as the ball falls in that area. That'll trap it, causing it to eventually go down the lower right drain. While you're waiting for that, draw lines that corral it from there over to the square.

I think this is an excellent game and would probably keep playing a version that had some of the bugs worked out. The glitching through walls can be fairly infuriating if you have the ball completely enclosed and it gets its way out, plus the interactions with the edges of the screen can really screw you up (e.g. when you're drawing a line and you accidentally brush against the edge, so it drops the line immediately). I'd also get rid of the clickable stuff at the top left or reduce the play area so that stuff isn't in the way, since a couple of times I accidentally surrendered while I was trying to draw a line there.

One other improvement I could think of is doing a little forward calculation on your randomly-chosen initial state to prevent it from setting up scenarios that really are impossible or just no fun. Having the ball appear for a 10th of a second and then bounce off the top of the screen never to be seen again (because it went to the side) is no fun. Oh, and maybe stick a red dot or something at the top border of the screen when the ball is up there so you can track where it is horizontally. Oh, I'm full of suggestions.

Edit: how did the double mango pudding turn out? :)


It's technically possible to sneak it in on the right.


Its very doable, you got to glitch it (strangely, I got pretty good at glitching it through, and then I realized, my morning was gone, and I had to go work)


I'm loving the glitches; made a bit of a rail gun by putting the ball on top of two really close parallel lines!


I tried to glitch it but not in this scene, if you make the dot bounce very slowly and close to stop it'll get through the line.


For me, in level 2, the dot started near the edge and then almost instantly disappeared.


on level 17 this is easy


awesome, i only reached level 6 and i coded it ...


Are you using Windows 95?


Could be Windows XP with themes turned off. Or Windows Server. Actually, maybe if you turn off all fancy stuff on Windows 10 you can still get this?


It's 7 with the Windows Classic theme.

XP doesn't have the "tall" start button and icons-only taskbar, and 8+ doesn't have Windows Classic.


If you draw the line while intersecting the dot, the latter gets trapped on the former.


There seem to be a few more glitches. If the box the ball is trapped in gets too small it sometimes passes a box boundary. (I am using chrome.)


That's good; it means if you make a mistake you can box your way out of it.


The OP posted 45 minutes before you with a very polite and open message which describe the problem you have stated and also provided a rationale for the project AND a link to github. Why is it good form to just wade into a comment thread and give unconstructive criticism in this circumstance? Why not just quietly open a github issue?


Fair point - I was just making an observation really.


What the... Chill, I mean, the guy just pointed out a glitch with the most non-threatening neutral declarative sentence possible. Why is "good form" to post a reply like that?


A lovely little game with no instructions. Seems to be working out a bit better for you than it did for me (http://luciangames.com/oware).


big difference in presentation: on his game page I get to play immediately, on the page you linked I just get some static screen and links to buy


That's fair. It's a Unity game. I need to update that page to reflect that it's been removed from iOS (not willing to keep paying Apple), and it's free everywhere else.

I decided it was more valuable as a portfolio piece than as product with abysmal sales (couldn't afford to market it; not sure if it would have helped anyway), so I made it free.

You can play it with the Unity web plugin (I know) here: http://luciangames.itch.io/oware.

I only posted it here because it's a game with no text whatsoever, and I found that to be a really interesting design constraint. But maybe I'm the only one.


This game is addictive, would be pretty cool if you went head to head with a random person and you both were trying to get the ball into your own box. great work!


Works great on my iPhone, which is a surprise. Well done!


it's a good thing everyone will be at burning man this weekend so i can get to higher levels before they do :)


Do I need to be on LSD to enjoy this? :)


very fun game. thanks for sharing. I like when it gets caught on the line and bounces back and forth


Fun! What about a limit of N lines, e.g. oldest removed first (maybe color-coded by age?)?


I love it! Interestingly enough though, the ball goes through line intersections.


Very fun :-) thank you


really great. so simple but immediately entertaining.


Surprisingly fun :)


this game is my perdition!! hahhaha




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: