Tris is side scrolling run forever game where you control a "Tri" in a retro styled cave world composed of simple blocks. You can stretch your "Tri" to make it thin and fast or push it in to slow it down. You have to dynamically change your speed to help dodge the incoming blocks while gaining points the longer you survive.

Tris Features:

  • Randomly generated world. Tris' world is made up of hundreds of blocks randomly stacked together. Because of this system, every play session is a new experience!
  • Control your speed and shape. Going slow has disadvantages of being wide while being thin has disadvantages of going too fast.
  • Charge Up. Holding the left mouse charges your Tri's energy. Once you activate it, you gain health back, go invincible for a few seconds and get a burst of speed.

I worked on the front end and the random world generation for the game, you can check out my process for creating the generator below!

Play the game!

Check out the game at newgrounds!


  • Scripting (World, Front End)
  • Front End Design
  • Visual Style Design

The Team

Creating the Generator

The world generation was a fun and challenging task to do. It was something that started out simple and I kept on adding features on top of its core.

Starting out

I first started by creating a way to carve out a random path in the blocks. The way I achieved this was to generate one column in an array. Then I stored that column's information in a second array, or the "Reference Array". Finally, the first array regenerates a new column that references the open spots in the Reference Array, and so on.

I made the system sizeable too, you could adjust the amount of blocks in a column, size of blocks, number of columns to spawn or the space between the blocks. You can see this stage in the first image.

Getting Further

The first test still needed a lot of work, it would be impossible for the player to move though that path with those blocks sticking out. I also wanted to control the difficulty of the path so I would have to implement a difficulty system that controls the spawning system. I made the generator require a specific amount of open blocks touching each other in the one column before it would generate the next. This made it much less random, but now the player would actually be able to move in it.

I then made the difficulty function choose the amount of open blocks (path width), the steepness of the change to the next path size, and the roughness of the path. You can see in the image, I set the first section's width to a medium size, the second section to a large size with a smooth transition, then the third section to small size with a steep transition.

Making it Move

The current generator only made static blocks, so I had to take what I had and make it move. I made all the blocks spawn into a block container and moved the container, which in turn moves the blocks. One trouble I faced was when to spawn a block at the right time to keep the blocks in a grid. This was solved with a calculation that moved the block spawn point forward or backward based on the speed. I created the Islands by doing a "second generation" of the path except it would re-add blocks that are far enough away from the "wall blocks".

Finishing Up

I then made the difficulty function randomly set the stages as the blocks were generating, instead of me manually imputing the data that affects difficulty. The difficulty generator also creates a number to tell the system how hard that stage was. You can see in the game, I was able to color code the difficulty with red, green or blue using that difficulty rating number.