# Graphite Game 2D

Graphite Game is a game that, like Crazy Pong and Octalping, started as a PC prototype growing into an Android app in development. This was in 2012 and sadly the development has now ceased, however the project was a great learning curve project.

Fundamentally, It is basically a 2D scroller, which is a role playing game that is a sandbox.

The main feature I was enjoying to mess about with was procedurally generating the maps will go on till infinity using random seeds. I approached the problem a little like Notch from his game Minecraft, using a random string generated at the start of the map to solely dictate the outcome of the map. As the game was only 2D, I only had to create a function $f( x )$ that calculates the y, given an x say. I approached this by superimposing sinusoidal waves together using different amplitudes and phases where each wave is of the form $w( x ) = a*t(s)*sin(b*u(s)*x + c*v(s))$ where a, b and c are constants for each function and t,u,v are functions of the seed that return a float between 0 and 1. a dictating the amplitude, b dictates the phase and c is not particularly necessary but dictates the initial position. Using $f(x) = \sum^n_i=1 w_i(x)$ generates a decent random map given a nice spread of constants, for example you want to have some constants with very small phase, to give a rocky feel. Some much more relaxed larger waves to emulate hills. Overall you want a mix and it is also interesting to experiment with sin waves within sin waves, but I won’t get too much into that now.

Another part of the project that I was keen to experiment with was the ballistic mechanics, making it possible to fire bows and arrows. Nothing too complex, but something very fun to implement.

For now I don’t wish to disclose too many details, but hopefully once some more work has been done on the project I will be able to upload some screenshots.