News for hackers. Stuff that matters.
Re:Show HN: A Tribute to “Asteroids” by santialbo on Thursday August 14, 2014 @12:39PM (#8178297)
I did a similar thing some time ago adding rigid body collisions on the asteroids, which makes the game way harder.

https://github.com/santialbo/Asteroids

play here: https://rawgit.com/santialbo/Asteroids/master/default.htm

Re:Show HN: A Tribute to “Asteroids” by JeffL on Thursday August 14, 2014 @12:47PM (#8178337)
That's a really cool version, but you need to give some invincibility when you respawn, otherwise one death can be equivalent to 2-3 if there happen to be asteroids in the middle area at the time.
Re:Show HN: A Tribute to “Asteroids” by mturmon on Thursday August 14, 2014 @01:04PM (#8178424)
It was fun to look at your source code. About 600 lines.

I really liked the arcade version of asteroids, so me and a friend wrote a version in PDP assembler for a class project. I wish I still had the source code, but let's just say it was not as compact (e.g., we had to do the video driver, random number generation, trig, etc.), and took a couple of weeks.

Although the basic OO design is the same, which is cool.

Re:Show HN: A Tribute to “Asteroids” by hamora on Thursday August 14, 2014 @04:13PM (#8179605)
Asteroid collisions completely change the game! You also nailed that vintage look! Nice stuff! I'm diving into your source code for polygons in detail!
Re:Show HN: A Tribute to “Asteroids” by hamora on Thursday August 14, 2014 @09:50AM (#8177434)
Something I made with pure JS and the HTML5 Canvas. Play it, have fun, and if you have any thoughts on the quality of the source code, please let me know!
Re:Show HN: A Tribute to “Asteroids” by hardmath123 on Thursday August 14, 2014 @02:08PM (#8178834)
On my browser (Safari), pressing arrow keys scrolls, making the game really hard to play. You should be able to `event.preventDefault()` or something to prevent scrolling.
Re:Show HN: A Tribute to “Asteroids” by hamora on Thursday August 14, 2014 @04:07PM (#8179570)
Ah yes, the scroll is annoying! I think I tried some sort of preventDefault thing, but definitely need to get that working. Thanks!
Re:Show HN: A Tribute to “Asteroids” by nootropicdesign on Thursday August 14, 2014 @02:38PM (#8179045)
I implemented Asteroids on Arduino. It was very challenging to work within 2K of SRAM, especially when 1.5K was used by the video buffer. https://www.youtube.com/watch?v=w03dO0Hd660
Re:Show HN: A Tribute to “Asteroids” by Patrick_Devine on Thursday August 14, 2014 @11:50AM (#8178019)
I like it. It harkens back to the original vector art version from '79, although you really should make the asteroids look more asteroid-y. If you make them circular it's still quite easy to do your collision detection and they'll look a lot better.
Re:Show HN: A Tribute to “Asteroids” by hamora on Thursday August 14, 2014 @04:08PM (#8179579)
My collision code is overly simplistic, and so I went with squares to give the asteroids some jagged edges. I should totally try out circles to see if they look better, though. Thanks!
Re:Show HN: A Tribute to “Asteroids” by johnnyg on Thursday August 14, 2014 @03:29PM (#8179370)
At first, I blasted everything in sight.

Then I noticed that if it wasn't going to hit me on the pass and wasn't the smallest size, that was bad.

I started waiting on the first big with a direct line, taking that guy down to basic and repeating.

Zen Astroids. :)

Re:Show HN: A Tribute to “Asteroids” by blt on Thursday August 14, 2014 @01:44PM (#8178641)
Been a while since I played Asteroids... is this any different from the original, other than the asteroid shapes?

Very clean code btw.

Re:Show HN: A Tribute to “Asteroids” by hamora on Thursday August 14, 2014 @04:09PM (#8179584)
Thanks for the comment. It's ideally supposed to be the same as the original. If it is not, it's because I haven't implemented some features yet (spaceships, slowing down eventually if you don't thrust, ...).
Re:Show HN: A Tribute to “Asteroids” by spainispain on Thursday August 14, 2014 @10:56AM (#8177779)
Re:Show HN: A Tribute to “Asteroids” by mturmon on Thursday August 14, 2014 @12:52PM (#8178358)
You have posted an unrelated link. Please don't do this, it does not move the conversation forward.
Re:Show HN: A Tribute to “Asteroids” by spainispain on Thursday August 14, 2014 @02:20PM (#8178905)
I'd like to introduce you a friend of mine called "humor sense"

:-P