Space Invaders

Space Invaders

So I've recently compiled a bunch of my libraries together into a collection I call ion-cloud available on npm. In order to best test these, I've recreated my own adaptation of Space Invaders available free to play here on my website by clicking the link above or here and open source at https://github.com/NathanielInman/space-invaders

Read More

TMUX windows vs iTerm2 tabs

TMUX windows vs iTerm2 tabs

Working in the terminal entirely is an incredibly efficient workflow when done appropriately. Periodically I stop what I'm doing and think...

Can I work more efficiently?

There are most generally multiple projects worked on at a time, multiple tasks simultaneously running for those projects, some of which are commonly moved between to edit things. I've had conversations with a coworker recently about tmux sessions vs tmux windows and we came to a conclusion.

Tmux windows are workspaces, sessions are for projects.

With this distinction, we use those workspaces or windows as tabs like we would traditional virtual desktops or virtual

Read More

Coterie

Coterie

Aug 3, 2016 Update: Coterie is now playable on mobile or touch devices as well.

Play Coterie

Growing up I deeply enjoyed two specific cards games: Triple Triad in Final Fantasy VIII and Tetra Master in Final Fantasy IX. Having some extra time this past week I developed a simple card game variant called Coterie. What started as an excuse to get more familiar with flexbox in css ended up actually being fun to play!

This two player game starts with each player having a different colored set of 8 cards. Each card will have random points distributed around its

Read More

Cleaner complex IF Statements

Cleaner complex IF Statements

So you have this long if statement that's relatively simple in design but ugly to the eyes and somewhat hard to read.

if(x1>=img.left&&x1<=img.left+img.current.width&&  
   y1>=img.top&&y1<=img.top+img.current.height&&
   x2>=img.left&&x2<=img.left+img.current.width&&
   y2>=img.top&&y2<=img.top+img.current.height){
  img.scaling = Math.pow(x1-x2,2)+Math.pow(y1-y2,2);
} //end if

What can we do to make it

Read More

Pigeon Hole Stepping

Pigeon Hole Stepping

For 7DRL this year I developed a new map generation algorithm called Pigeon Hole Stepping.

Fill the map with walls

This map generation algorithm relies on negative building techniques. This concept will make more sense as the later steps are explained.

Dig Hallways

Essentially, we can assume that hallways that are parallel to each other are at least the length of a single room and up to two rooms apart in distance. Because of this assumption, we can make a random walker that will move around with this restriction in mind until map is filled completely.

Allocate Rooms

Assuming the

Read More