Socket
Socket
Sign inDemoInstall

github.com/ncw/johnroids

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/ncw/johnroids

JohnRoids - the conversion! note that the error checking for object table full has been taken out... make a rand_chance (x/y) function Need to figure out what happens on gameover! gamepause should be in main loop really... Try making an explode image function which makes an object per pixel in the object and gives then the right velocities to make an explosion. Could then have a fade table for each of 256 pixels. Will run out of objects pretty quickly! Perhaps only want to explode every 10th pixel in the roids or something like that. Could record the x and y of the hit and use that as the centre of the explosion. Could reduce the width and height of the sprite by removing all the black rows at the top and the bottom left and right. This would speed up the plotter and enable us to calculate the c of g so we could split the roids so that the bits always came apart from the centre. Could make the explosion always start from the bullet hit - this might be quite realistic.


Version published

Readme

Source

This is JohnRoids. A simple but addictive game whose sole purpose is to kill John.

Johnroids GIF

Play the game online.

See also Technical Writeup

I wrote this game originally in 1991 on my Acorn Archimedes to annoy John when I was bored one rainy afternoon. John came round and instead of being annoyed played the game for hours and hours - there is obviously some kind of perverse thrill in shooting oneself!

Back in 1991 digitised pictures were still something of a rarity. I made the one of John from a camcorder video and an extremely hacky black and white video digitiser which I built myself. Note there are actually two images of John - one looking happy and the other not!

The original was written entirely in ARM assembler to make it go fast enough. However I thought the program deserved not to wither away so in 2001 I ported it to C and SDL and in 2018 ported it to Go to run in the browser so many more hours can be wasted shooting at John.

When you run the game you'll notice the playing area is rather small (320x256 pixels). I'm afraid this was all that was available in 1991! I tried making the playing area bigger but the game lost some of its visceral thrill, so you are left with a small screen. If you want it bigger use the zoom function of your browser.

This is an entirely faithful conversion of the original except for the fact that I haven't put the sound back in yet. The original samples are in a very strange format I haven't managed to translate.

You can find the source code on github - report issues and send fixes there please!

The instructions are printed on the screen to start, but to summarise they are:

Z      - Rotate left
X      - Rotate right
Shift  - Fire thruster
Return - Fire gun
Space  - Start the game

If you press "Toggle Keyboard" you'll get an onscreen keyboard which works pretty well on mobile devices.

Shoot everything before it touches you. Note that you lose a point of score for every bullet you fire. Some of the roids may shoot at you - using thrust is a good idea at this point. Things get very hectic as you go through the levels.

Installation

This repository contains 3 implementation of johnroids for SDL, gopherjs and go/wasm.

If you want to try it locally then do

go get github.com/ncw/johnroids/...

And run the johnroids-sdl binary.

Note that you'll need the SDL headers and libraries installed for this to work.

You can play the gopherjs and go/wasm versions online.

To build these versions cd to johnroids-js then make build then make serve. You may have to alter the path to your go1.11 binary in the Makefile.

Enjoy

Nick Craig-Wood
nick@craig-wood.com
@njcw
2018-07-14

FAQs

Last updated on 15 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc