Wednesday, March 29

Hacking Game: Part 1 - Electron Setup & Initial Code


Today I started programming the beginnings of a yet unnamed hacking game. I know there have been, and will be, many fantastic games already developed in this genre. I am not expecting this game to live up to the likes of Uplink, Hacker Evolution, or Hackmud.

The one thing that might set this one apart a little is the fact that I am streaming the development on The other small thing is that I will be posting the source code, so it is available for download and experimenting with in days of the stream.


  • Created the Main Menu
  • Started the Game Intro
  • Started the main Terminal console

Build cross platform desktop apps with JavaScript, HTML, and CSS. You can download pre compiled versions for most systems at:

Screen shots

The Links

Tuesday, March 28

NodeJS, Simple Client / Server


The minimum amount of code to have NodeJS serve a simple client and server.


This code uses NodeJS module "" which you install with the following command:
npm install

Server.js Source Code

var http = require('http')
 , fs = require('fs')

 , webpage = fs.readFileSync(__dirname + '/client.html')
 , port = 2017

// Send client.html to all requests
var server = http.createServer(
 function(req, res) {
   res.writeHead(200, {'Content-Type': 'text/html'});
   res.end( webpage );

// server listens to our app
var io = require('').listen( server );

// Send current time to all connected clients
function sendEveryone( msg ) {
 io.emit('msg', msg );

// Listen for connections
io.on('connection', function( socket ) {
    // Single Client's socket
    socket.emit('confirm', 'Server here');
    socket.on('from Client', function( msg ){
     console.log( msg );

server.listen( port );

client.html Source Code

<!doctype html>
   <script src='/'></script>

   var socket = io();

   socket.on( 'welcome' , function( msg ) {
       console.log( msg );

       // Contact Server
       socket.emit('from Client', 'Client Here');

   socket.on( 'msg' , function( msg ) {
       console.log( 'incoming:' , msg );