Skip to content

JSON Object Specification

sdunham edited this page Dec 9, 2012 · 3 revisions

There are some repeated data structures in the object. They are defined here:

position: -- position of bottom of turret
	x: float -- x location relative to center as (0,0)
	y: float -- y location relative to center as (0,0)
	z: float -- z location relative to center as (0,0)
rotation:
	x: float -- rotation in degrees
	y: float -- rotation in degrees
	z: float -- rotation in degrees

And here's the full object. Anything in brackets should be a randomly generated unique ID--probably a hash.

gameState.json

engine:
	gameRunning: boolean -- is the game running?
	lastUpdated: integer -- time this client last updated
	timeElapsed: integer -- time the game has been running
	turrets:
		[key]: string -- unique identifier for turret
			owner: string -- deviceID of turret owner
			position:
			rotation:
        turretBullets:
		[key]: string -- unique identifier for bullet
			position:
			rotation:
	fireballs:
		[key]: string -- unique identifier for fireball
			position:
			rotation:
	minions:
		[key]: string -- unique identifier for minion
			position:
			rotation:
	batteries:
		[key]:
			position:
	player:
		energy: integer -- current energy of protagonist
		score: integer -- current score of protagonist
		position:
		rotation: 
	eyeballs:
		[deviceID]:
			position:
			rotation:
	platforms:
		rows: integer -- number of platforms
		columns: integer -- number of platforms
		deletedTiles: [[2,3],[1,4],[4,3]] -- ONLY APPEND, DO NOT DELETE


phones:
	[deviceId]: string, MUST BE unique id for device
		score: integer -- phone score -- DON'T EDIT THIS! USE THE SCORE API!
		lastUpdated: integer -- time this client last updated
		requests:
			minions:
				[id]: string -- unique id of request
					timeCreated: integer -- time request was made
					position:
					rotation:
			fireballs:
				[id]: string -- unique id of request
					timeCreated: integer -- time request was made
					position:
					rotation:
			objectPlacement:
				[id]:
					timeCreated: integer -- time request was made
					type: string -- acceptable so far are "turret"
					position: -- position thing should be created
					rotation:
		position:
		rotation:


web:
	twitter:
		activeEffect: string -- vote has concluded, do this thing
					  potential values: "none", "robotBuff", "eyeballBuff"
		activeVote: null if there's no vote going
			startTime: integer -- timestamp current vote started
			hashtags: ['#vichargame #robot", "#vichargame #eye"]
			votes:
				eye: integer -- number of people that tweeted for the eyes
				robot: integer -- number of people that tweeted for the robot

Clone this wiki locally