Presenting Spacewar!

This week, I present: Space Fight! It is inspired by the first widely-distributed video game, Spacewar!, written all the way back in 1962.

Space Fight! is a PvP game, so you’ll want to play with a friend. Avoid the central gravity well while firing torpedoes at your opponent. Shots that land on a ship score points, and falling into the gravity well gives points to your opponent. The game ends if the two ships collide or if the game timer expires.

If you want a solo game, check out my post from a few weeks back for my rendition of one of Spacewar!'s spiritual successors, Asteroids.

Have fun! Happy Friday!

Play the game here:

Use the following URL to import the code into MakeCode Arcade: https://github.com/robo-technical-group/spacefight

For compatibility with the MakeCode Arcade gallery


See all of my MakeCode Arcade games and extensions here!

5 Likes

This game is now featured on the arcade.makecode.com homepage, in the Community carousel! (It was just added, so you might have to refresh / open a new private browser window to skip the cache)

1 Like

Thanks much, @jwunderl! Joey was a great help, as he offered some excellent suggestions to improve the gameplay (since the community version did not need to stick to being a “clone”). He earned a well-deserved mention in the credits as a collaborator, and he has given me an excellent thought experiment that I’ll document another time.

You may notice some strangeness to the TypeScript code, and those of you who work with this platform can probably figure out why: The game will load in your editor in JavaScript mode, but it was actually designed in Blocks. This is no longer an issue with the way that community games are published in the gallery.

If you’d like to see SpaceFight! with its original, Blocks mode, head this way:

Note: This is an older version of the game and is left here strictly to maintain the historical record.

2 Likes

This is an example of a problem which I have run into before. The “For compatibility …” link, when I click on that and switch to JS tab, I can copy all the code text and then paste that text onto a blank Arcade environment but get 13 errors, with no changes made to the text code. Will there be a way, when activating an Arcade game, to know in advance if errors like this will appear before we attempt to copy and paste the JS text onto a blank Arcade page? Thx.

Hi, Frank.

This will happen whenever a game uses an extension, which most of my games do. Is there any particular reason you’re copying-and-pasting the code to another project? You already have your own copy of the code in Arcade when you open it in the editor, and you can use the built-in tools to duplicate a project (including any extensions used).

Yes, @AlexK, there is a reason for copying a complex Arcade game and pasting the JS text of it into a previous Arcade environment. With the combination of Arcade games and electronics driving robots with Meowbit we have found that starting with your game and attempting to add Robotbit extension or I/O bit extension from Kittenbot sometimes (often) breaks the system and we get “Extension Error” message so no compilation and hence no download. But, if we start with a "known to work " program with the extensions already installed for motors, pins and edge connector and “light” then we can add other program code (copy and paste JS text) for some other game and then modify that game code in our new program and be fairly well assured that the code will compile. I have not done a video to show this as yet. It may not be true in future months/years, but up to this point, I am describing our work-around for a known hurdle in Arcade with several motor-neopixel-I/O pins extensions . So, if there was only one or two extensions used in your games then maybe I could pick them up off github and install them before moving forward? Just a thought.

Interesting, Frank. I don’t own any KittenBot hardware, so I can only speculate as to why you are running into the problems that you are experiencing. I have some guesses, but I’d have to dig into their code to try to figure it out.

If you wish to add the appropriate extensions to your “master” project, then you can head over to my MakeCode Arcade page (link is in the footer of the main post) to find the extensions that I have created. Most of my games use the Info Screens extension; you can pick-and-choose from the other extensions. Space Fight, for example, also uses the Image Transformation extension.