Coding Challenge #74 - Asteroids
John Crickett
Helping you become a better software engineer by building real-world applications.
This challenge is to build your own version of the classic arcade game Asteroids. Asteroids, which was was first released in 1979, sees the player controlling a spaceship in an asteroid field. The objective of the game is to destroy the asteroids and the occasional flying saucer by shooting them.
The player dies when they collide with either an asteroid or the flying saucer, when all three lives are gone the game is over. The game gets harder over time as the number of asteroids increases. Given how limited computers were in 1979 the graphics are pretty simple, for example:
If You Enjoy Coding Challenges Here Are Two Ways You Can Help Support It
Or for those of you who want automated test, until I add them you can check out codecrafters.io and you can get 40% off as a Coding Challenges reader plus it helps support Coding Challenges.
The Challenge - Building Your Own Asteroids Game
In this coding challenge we’re going to build a clone of the video arcade game Asteroids. If you haven’t played it before, a quick Google search will provide several online options. Give it a go.
领英推荐
Step Zero
In this step, pick the programming language and development environment you’re going to use. Consider trying something different - this would be a great project to try a frontend stack if you’re a backend developer and vice versa.
If you’re from a data engineering or site-reliability engineering background you could leverage your knowledge of Python with PyGame or Go with Ebitenegine. Rustaceans can check out?are we game yet?for useful crates.
Asteroids is relatively simple and as such, it’s a great platform for learning a new technology, or programming language.
Step 1
In this step your goal is to create the game screen ready to start the game. Typically this is a simple blank black screen, with a button saying “start new game”. You might like to add the title of the game too.
Continued...
You can find the remaining steps for this challenge on the Coding Challenges Substack here.
SDE2 @Amazon | Author of 15,000+ subs Newsletter (strategizeyourcareer.com)
5 个月Besdies your work putting these challenges, I'm amazed with your creativity and how you come with ideas, John Crickett! Keep them coming!
Senior Frontend Developer | 10+ Years Experience | LATAM | Expert in React, Next.js, Vue.js, and Building UI
5 个月Building an Asteroids game sounds dope. Gives a chance to flex those coding muscles while having fun. Anyone up for it?
Top 1% @LinkedIn | Architect @ Adobe | 350k+ Followers Across Social Media | Global Speaker
5 个月John Crickett Just like leveling up in a game, each coding challenge presents new opportunities to learn, grow, and improve your skills. As you tackle more complex problems and overcome obstacles, you'll gain confidence and become a more proficient programmer.
Tech Director @ Amazon Payment Services | I help professionals lead with impact and fast-track their careers through the power of mentorship | #1 LinkedIn Arab World Creator in Management & Leadership
5 个月Another week, another great challenge! Appreciate what you share my friend to help the community uplevel.