5 ms·
I've just finished off (within the last hour) my version of Asteroids, which I started with enthusiasm two or three years back, then did very little after getti
by bartread 7y ago
I've just finished off (within the last hour) my version of Asteroids, which I started with enthusiasm two or three years back, then did very little after getting the basics of the game working:
https://arcade.ly/games/asteroids/ https://arcade.ly/games/asteroids/
Now I've finally added all the stuff I wanted to (black holes, satellites, power-ups) so it's time to pick up another project I started a long time ago and haven't really done much on: my very own version of Space Invaders:
https://arcade.ly/games/space-invaders/ https://arcade.ly/games/space-invaders/
(WARNING: this one is barely functional - e.g., no levels, no shield damage, no scoring, invader firing pattern is all kinds of wrong, invader movement isn't quite right, etc.)
Enjoy! (And feedback welcome!)
- tonyedgecombe 7y agoNice work.
- bartread 7y agoThanks - very kind of you!
- nostromo 7y agosuper fun!
- bartread 7y agoThanks - glad you enjoyed it!
- 55555 7y agoI can never get into games but within 2 seconds I was super into this game. I used to play asteroids as a kid, the version that came with Windows, but yours is way more intense.
- bartread 7y agoThat's great to hear - thanks. I've not played the Windows version but if this is it - https://www.youtube.com/watch?v=ym7dohuXRd8 https://www.youtube.com/watch?v=ym7dohuXRd8 - I think it's meant to be a pretty faithful port of the 1979 original.
- scott-smith_us 7y agoVery nice!
- bartread 7y agoThank you - appreciate it!
- Hashimm 7y agonice work!
- bartread 7y agoThank you! Much appreciated!
- gonational 7y agoThe Asteroids game! The graphics, music, and fluid motion are awesome. But, I cannot stand the controls. I play games like this laying down in bed at night, which automatically disqualifies this, due to its use of my phone’s orientation. Also, the modal disconnect between throttle and direction controls (one orientation and the other button press) is too much to tie to muscle memory. If you added an “old fashioned mode” with a dynamic joy stick (appears where ever I put my thumb within one bottom quarter of the screen) for direction and throttle (touch to engage and drag a small amount in any direction to turn and go that way), that’d fix the issue. NOVA 3 for iPhone got this 100% right. Then, a small section on the other bottom corner could house a few small buttons to engage hyperspace, etc. Just let the user pick right or left handed.
- bartread 7y agoThanks, that's a great suggestion. I had tried pure touch controls before but it was a complete disaster. Never even occurred to me to anchor against a dynamic touchpoint. That'a a really interesting idea. I'll have to check out how it works in NOVA 3. Tbh, I've never been satisfied by the tilt controls: they work OK if you're stood or sat still, but if you need to move at all whilst playing it can end up going sideways. I probably haven't yet put in enough effort to get them to feel right whatever the ambient orientation of the phone. I think you're right though: I need to offer an alternative control scheme that's touch only.
- gonational 7y agoHey, thanks for the reply. Awesome, I’ll be excited to give the new controls a try!
- tombh 7y agoAll my lonely days are over
- bartread 7y agoHaha, I know, right? I licensed that from PremiumBeat. In the early 2000s a friend introduced me to Cowboy Bebop, which I've been a massive fan of since (along with its excellent soundtrack), so I wanted some music with the slightly whimsical, slightly melancholy feel some of the tracks in the show had for Game Over.
- abrookewood 7y agoThey effects are quite eye catching. Can you tell us how you built them?
- bartread 7y agoThanks, and for sure. It's all Canvas 2D at the moment. There's no WebGL because when I started this project, three or four years back, it simply wasn't ubiquitous enough. Now I might be able to get away with WebGL (using something like Pixi.js) but the last couple of weeks I really just wanted to finish what I started rather than do a relatively substantial rewrite. Another quirk is that I'm not using (think Phaser.js, or whatever), because the two main motivations for starting this project were that: 1. I wanted to get better at JavaScript, which I'd always been weak at. 2. I guess 2015/16 was a time when the front-end world felt like it was really going nuts with new frameworks coming out all the time, so I wanted to become familiar with and see what I could do using only APIs built directly into the browser. Getting back to the point, in terms of effects I've implemented services to keep track of and render lists of particles and "clouds" of vapour. The latter are the translucent circles you see used to render rocket exhaust, and some of the explosion effects. In fact I just use one service for both and swap in a different renderer for particles or vapours in each service instance, since both behave substantially the same. Since we're throwing around hundreds or thousands of particles/vapours at a time, and, well, a lot of particles throughout the duration of a single game, and we want to avoid much garbage collection to keep the frame rate steady[1], I implemented an object pool so we're not constantly creating loads of garbage. Particle types are defined declaratively: colour stops (including transparency), duration, expansion rate for vapours. Instances of particles also have properties like position and velocity. Explosions are also defined declaratively with an arbitrary number of stops/events at timed intervals which define number and type of particles spawned, angular range through which they should be spawned, initial spread, velocity spread, any sound effect(s) to be played at each stop. There's a service that manages explosions that you tell call with something like: explosion.create(explosion.playerExplosion, player.position, player.velocity); This will create an explosion of type "playerExplosion" at the player's position and apply the player's velocity as a drift to all particles and vapours created. So once I've defined my explosion types it's easy to use them in a variety of different scenarios throughout the game without cluttering the logic too much. The services take care of rendering and particle management so these days I don't have to worry about it too much. Hopefully that goes some way to answering your question but if you'd like to know anything else, please shout. [1] GC screwing the frame rate is a genuine issue I ran into with this, particularly on mobile devices.
- chungus 7y agoReally like what you did with little red enemy ships starting as 1 whole and then splitting, very cool.
- bartread 7y agoThanks, appreciate it. I'd love to take credit but sadly not my idea. Very similar ships featured in Asteroids Deluxe back in the day: https://www.youtube.com/watch?v=GGODay8YUio https://www.youtube.com/watch?v=GGODay8YUio. I thought it was a great idea so decided to add them to my version just because they add a bit of variety.
- o-__-o 7y agoGonna finish up work on my 3D marble madness clone now. Thanks for the motivation!
- bartread 7y agoYes! Do it! And please send me a link when it's ready to play test.
- deleted 7y ago[deleted]