7 ms·
HTML5 game written in 0 lines of JS
- ThePinion 13y agoThis is brilliant. It makes me really stop and think about how far we've come from the days where HTML4 and CSS2 were everyone's limit.
- lmm 13y agoMost things can be done in html4/css2 (though browsers don't usually support all of css2). Most of the platform for these things was there five years ago, it's just taken us this long to build up the tooling and infrastructure around it.
- AndrewBissell 13y agoLove the tongue-in-cheek title.
- Aslaville 13y agoYeah..while this is also becoming some kind of annoying cliche
- nnnnni 13y agoIt's a satirical response to the annoying "___ in ___ lines of JS!" trend.
- golergka 13y agoWell, the original author created it as an ironic answer to the "30 lines of javascript" topics.
- d23 13y agoAnd this one is actually technically interesting.
- munimkazia 13y agoI actually expected it to be a joke. Was very impressed when the I saw the link.
- golergka 13y agoIt's still a joke though.
- munimkazia 13y agoOh yes, it is hardly a game, but I am still impressed with what they managed to do without any JS.
- jawr 13y agoAwesome. I would have been tempted to call it HTML5 game written in 30 lines of JS and then had some defunct JS code..
- deletes 13y agoMoving the ship with scroll wheel is a feature is suppose.
- tfb 13y agoThis is pretty cool. Although, I'm having trouble clicking on the bonuses and don't see my score. I must be overlooking something and cba to decipher how this works at this hour. Edit: Managed to make it the whole way through by leaving the ship in the bottom left. And then when the bonuses kept flying by uncontested because the game was "over", I was able to click on them after a few tries. The issue must have been that the cursor wasn't where I thought it was. Still very cool!
- danielweber 13y agoMe, my window was too short
- cauliturtle 13y agoWOW!!
- Aardwolf 13y agoWould have funnier if it was in Dart :)
- golergka 13y agoObligatory information: I'm not the original author. It was posted on russian HN/Reddit clone Habrahabr: http://habrahabr.ru/post/203048/ http://habrahabr.ru/post/203048/ Habrahabr featured translations of "30 LOC of javascript" topics from HN, some people continued it for a bit, and this one was created as an ironic answer to that.
- recon517 13y agoIt cannot be a HN clone, as HH appeared in 2006 and HN in 2007.
- golergka 13y agoThanks for the correction! But while I'm technically wrong, I hope it still describes the idea to those unfamiliar with it.
- iends 13y agoSadly I do not speak Russian. I often wonder what great things I miss out only only speaking English.
- talmand 13y agoTechnically, as long as we have multiple languages with different people knowing different languages then this is a problem for everyone. There might be Russians out there wondering about the interesting things they are missing out on because they don't know English. I for one want to watch TV programming from around the world just to experience the differences in culture and what they find humorous, sad, exciting, and so on. Sub-titles just don't always translate emotions very well.
- kazagistar 13y agoSubtitles seem fine to me: they contain the content, and the emotion in the voices crosses linguistic boundaries.
- 13y ago
- jheriko 13y agothat is pretty genius... even if its a rubbish game :)
- deleted 13y ago[deleted]
- jpincheira 13y agoHaha, it's funnily amazing!
- rplnt 13y agoI'd bet that Doom, a much better game, was written in 0 lines of JS as well (in the same sense). I fail to see how is this trend of "doing something the horrible way" interesting. Just because it's unconventional?
- golergka 13y agoIt's an ironic reply to this trend. Which also shows a pretty interesting usage of css, which has obvious educational value.
- CmonDev 13y agoThe trend is to show that real stuff CAN be done rather than actually DOing the real stuff.
- w-m 13y agoI don't see something 'done the horrible way', I see someone having fun using a technology in a creative way, maybe in a way it's not really meant to be used. It's not a bad space shooter, it's an invitation to be curious. This is exactly what I would expect at a site that calls itself hacker news.
- jzzskijj 13y agoI fail to see how is this trend of "doing something the horrible way" interesting. If people in the history of computing had stayed conventional and avoided doing something the horrible way, demoscene probably wouldn't been born at all. Breaking the boundaries and pushing to the limits was the point. Of course the young programmers of 1980's could have just waited doing nothing for 1990's to come with more powerful personal computers :)
- knappador 13y agoGoing on record in support of this statement. Very, very, very tired of seeing this stuff. Please quit giving Upworthy titles to techniques or tools I will never, ever want to use any part of in practice. When I make something for fun or to try something novel, I still use the best techniques I find suitable for the problem. If it's really a pedagogical tool, it would have comments, built up examples, and conclusions about the paradigm in light of what was learned in the implementation. This is utter nonsense that reminds me of doing random things in middle school when it was quite plausible that any information was valuable information in light of a relative lack of experience to draw upon.
- idProQuo 13y agoOff topic, but I had to make an Android game for my Junior year final project, and I think I used that exact same space ship sprite (it was an Asteroids clone with motion controls).
- gprasanth 13y agoHack: Right Click and just move your cursor on the context menu. Now the enemies can't see you + you get to teleport where ever you want! :D
- minikomi 13y agoAlso check out CSS panic https://developer.mozilla.org/en-US/demos/detail/css-panic/launch https://developer.mozilla.org/en-US/demos/detail/css-panic/l...
- mbrubeck 13y agoThere are several more "0 lines of JS" demos on devmo from the July 2012 "No JavaScript" challenge: https://developer.mozilla.org/en-US/demos/devderby/2012/july https://developer.mozilla.org/en-US/demos/devderby/2012/july One of them is similar in concept to the space game linked here: https://developer.mozilla.org/en-US/demos/detail/onspacestart-css https://developer.mozilla.org/en-US/demos/detail/onspacestar...
- ramayac 13y agoReally nice!, this should be the original article hehe, thanks for sharing!
- emirozer 13y agohacker news post quality down by %5 by this post , special thanks to the people upped this to number 1
- wilhil 13y agoTechnically, there is one line! :P
- vinitool76 13y agoTime waste.. Wonder why these kind of things come on top of HN. What does this project teaches us? Nothing..
- frankblizzard 13y agoangry much?
- vinitool76 13y agoAngry over what? Some crap. Little disappointed on the content quality of HN nowadays , rather than seeing stories of inspiring people solving some real problem and doing some real shit. All i see now is anything goes up at #1.
- nullcode000 13y agoIt's called experimenting. We use it to evolve.
- vinitool76 13y agoHow much did you evolved today? Got much better already.
- nullcode000 13y agoEnough not to engage in this conversation with you but not enough to not reply. Btw, for someone complaining about losing time, you seem to have a lot of it. ;)
- vinitool76 13y agoIt's Friday! I had to reply. Indeed a time waste, thanks for the reminder. ;)
- nashashmi 13y ago? Of how little javascript you need to get a whole bunch of things done. In this game, you could efficiently generate several different objects of various animations doing different sorts of stuff simply by putting in the least of javascript. It is less resource intensive and more natural to the browser because it leverages things it expects. Several years ago, this game would be very resource heavy and use lots of JS, but as more common uses of JS are merged into CSS, JS is less and less relied on.
- jayflux 13y agoIf you leave your ship in the far bottom right corner, you will never get killed
- kumarharsh 13y agoThis is the ONLY useful comment in this whole thread. Thanks :P
- uzyn 13y agoIn fact you can leave the ship anywhere in the game window. As long as you are not moving it, the collision detection does not work. (Anyone knows why?)
- chrismorgan 13y agoAssigning a tabindex of -1 to the bonus inputs would stop people like me from getting all ten bonuses by repeating {tab, space}.
- nashashmi 13y agoI saw the code and a whole lot of -webkit- flags so I tried it in firefox, and it still worked.
- fakeanon 13y ago"This Site Totally Doesn't Work Without JavaScript. Like, at all. Sorry. If you enable it and reload this page you'll be good to go. Need to know how? Go here." Okay, that's funny. When Javascript is on: Ah, Nice little game. Interested how it needs a .js file with just a comment. Can we improve this to remove it? Edit: oh, so maybe the overall website need JS, not the game(?).
- golergka 13y agoSimple version on the author's website http://nojsgame.majorov.su/ http://nojsgame.majorov.su/
- fakeanon 13y agoCool, thank!
- bargl 13y agoI'm pretty sure it is codepen.io that needs javascript to run the other guys website within their own.
- fakeanon 13y agoI guess, thanks. golergka linked to authors site which doesn't: http://nojsgame.majorov.su/ http://nojsgame.majorov.su/
- msl09 13y agoAwesome, the bonus is the this is perhaps the lightest JS game that I have seen in a while.
- adam12 13y ago0 lines of JS and 500+ lines of CSS
- krapp 13y agothere's no such thing as a free lunch...
- blt 13y agocollision detection is based on full bounding boxes. this is especially annoying on the big ships.
- lhgaghl 13y agoThis really illustrates the true power of the web. No construct has a stable definition. If we can't or don't want to use JS to write algorithms, just add new features to CSS until it has the ability. Nobody needs a reliable format to write static documents. We need to keep extending amending extending amending extending amending (while trying to be backwards compatible)!
- deleted 13y ago[deleted]
- nollidge 13y agoWhat am I supposed to be seeing here? Chrome 31, Windows 7 x64. Maybe my proxy server is screwing something up, because I mouse over the blue area, and then the scroll bar goes wonky for a bit, and then it turns red and says "game over". EDIT: yep, definitely proxy, seems all the stuff from http://nojsgame.majorov.su/ http://nojsgame.majorov.su/ is blocked.
- networked 13y agoNice. There are also "games" [1] made with just GLSL shaders in WebGL. There are several of those on Shadertoy but I particularly like https://www.shadertoy.com/view/MsX3Rf https://www.shadertoy.com/view/MsX3Rf. [1] Edit: "Games" in scare quotes because the lose state doesn't (can't) persist in a way that requires player action.
- racl101 13y agoCan you call it a game when it doesn't even work? This looks half baked. Maybe you need that JavaScript after all.
- Pete_D 13y agoI'm impressed this is possible in pure CSS. What implications does this have for security/privacy? Should I be blocking CSS in addition to JS now just in case?
- pearjuice 13y agoTechnically this is still HTML4.
- DonPellegrino 13y agoI find it amusing that the content is served from a .su (Soviet Union) domain.
- taopao 13y agoIf I was a mod, I would relabel these submissions to "extend your e-penis in 0 lines of JS."
- ffrryuu 13y agoYou might be an authoritarian if...
- ibrahima 13y agoHow does one do logic and store state in HTML/CSS? DOM elements for state I guess, but logic?
- BorisMelnik 13y agoif you stay completly on the left side you will avoid all objects
- choarham 13y agoThis is fucked up :)
- Myztiq 13y agoThis reminds me of a game I built a long time ago: http://www.ryan-kahn.com/static/onlyCSS/ http://www.ryan-kahn.com/static/onlyCSS/ I ended up building a generator for the CSS+HTML and at the time I had a PHP script (2+ years ago, I would use Node now) that could allow me to pick the number of lanes, the difficulty etc. Now it's just a single snapshot. I built it in about a week. There is a new bug apparently where the cursor is not changing as expected in chrome.