Game Generator

Generates game's title, genre and plot synopsis.

by Nikita Sadkov

HTML

<h4><p id="output">hello</p></h4>

<button id="anothergame" class="myButton">THIS GAME SUCKS!!!</button>

CSS

/* insane button CSS from http://www.bestcssbuttongenerator.com/ */ 
.myButton {
	-moz-box-shadow: 0px 1px 0px 0px #f0f7fa;
	-webkit-box-shadow: 0px 1px 0px 0px #f0f7fa;
	box-shadow: 0px 1px 0px 0px #f0f7fa;
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#33bdef', endColorstr='#019ad2',GradientType=0);
	background-color:#33bdef;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:Arial;
	font-size:15px;
	font-weight:bold;
	padding:6px 24px;
	text-decoration:none;
	text-shadow:0px -1px 0px #5b6178;
}
.myButton:hover {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #019ad2), color-stop(1, #33bdef));
	background:-moz-linear-gradient(top, #019ad2 5%, #33bdef 100%);
	background:-webkit-linear-gradient(top, #019ad2 5%, #33bdef 100%);
	background:-o-linear-gradient(top, #019ad2 5%, #33bdef 100%);
	background:-ms-linear-gradient(top, #019ad2 5%, #33bdef 100%);
	background:linear-gradient(to bottom, #019ad2 5%, #33bdef 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#019ad2', endColorstr='#33bdef',GradientType=0);
	background-color:#019ad2;
}
.myButton:active {
	position:relative;
	top:1px;
}

JavaScript

var theButton = document.getElementById("anothergame");
theButton.onclick = anothergame;

var tNoun = ["Quest for", "Tale of", "Saga of", "Dream of", "Story of", "Nightmare of", "Adventures for"];
var tGoal = ["Good","Evil","Loot", "Glory", "Conquest", "Self-improvement"];
var tAdj = ["", "Forgotten", "Illusionary", "Amazing", "Epic", "Glorious", "Greatest", "Perilous", "Final", "Foolish", "Longest", "Mysterious", "Rediculous", "Fantastic", "Terrible","Endless"];

var tChar = ["King","Mage","Paladin","Bard","Ninja","Samurai"];
var tCharS = tChar.slice();
var tCharAdj = ["","Mighty","Noble"];

var tMap = [];
tMap.tNoun = tNoun;
tMap.tGoal = tGoal;
tMap.tAdj = tAdj;
tMap.tChar = tChar;
tMap.tCharS = tCharS;
tMap.tCharAdj = tCharAdj;

var gType = ["action adventure", "FPS", "RPG", "RTS", "TBS", "TCG", "rhythm game","flight-sim", "puzzle", "tower defence", "dating simuator"];
var gAdj = ["","economic","philosophical", "sandbox", "roguelite", "fast-paced","minimalistic","emergent"];

var pChar = ["a mercenary", "an adventurer","a peasant", "a former soldier", "a vampire", "a felon","a japanese schoolgirl", "a mentally handicapped person", "an ordinary office worker", "a scientist", "a detective", "a caveman", "a tribesman", "a pirate"];
var pMotive = ["has new employer, which","to complete his revenge","to save his village","seeks fame and therefore","has to pass a trial, and","has to survive in the apocaliptic event, and","in search of hedonistic pleasures","to return to his home world", "to lift the curse","in pursuit of greater good","without any clear motivation","out of shear madness","to solve the mystery","to restory his memory"];
var pGoal = ["retrieve an ancient artifact","visit some far away location","defeat N rats in a cellar","obtain N items of stale dog feces", "defeat an invincible villain", "solve a puzzle", "build an economic empire", "write a book", "prove that P=NP", "wander aimlessly"];


for(i=0; i < tCharS.length; i++) {
  tCharS[i] = tCharS[i] +...