Imperial‎ > ‎


This is where I have been posting updates for the game!

Milestone April 20th

posted Apr 20, 2015, 2:38 PM by Shah Zafrani

Changes since last week:
-Local Multiplayer
-Code optimization
-Physics Tweaks

To be implemented by next week:
-Either basic AI or Online multiplayer (using
-Gameplay tweaks and balancing
-Particles and visual enhancements

Milestone April 13

posted Apr 16, 2015, 9:42 AM by Shah Zafrani

3 things somewhat accomplished this week:
-constructor for brick-generator prefab now takes in player number instead of "x" and "y" values to determine location and rotation
-Sound works!!
-Lots of code cleanup

Playable Demo
Next Week: 
-Local Multiplayer for sure! (Expect a live demo w/ a volunteer in class!)
-fixed trig stuff for brick-generator prefabs
-physics and gameplay tweaks

Sound effect credits: 
ball-hit on brick: (Freeware)
ball-hit elsewhere: (Linkware from

MileStone April 6

posted Apr 6, 2015, 1:53 PM by Shah Zafrani   [ updated Apr 6, 2015, 2:00 PM ]

I have implemented Box2D, Brick Placement, and stage obstacles. is now offering a paid plugin for Box2D, and it runs very fast.
Below is a function that I wrote to place the bricks around the player's core, given an amount a bricks and a radius distance away from the core.
BrickGenerator.prototype.placeBricks = function(amount, radius) {
	for (this.i = 1; this.i <= amount; this.i ++) {
		var desiredRotation = -1*Math.PI/(amount*2) * this.i;
		var temp = new Brick(, this.x + Math.cos(desiredRotation)*radius, this.y + Math.sin(desiredRotation)*radius);
		temp.body.rotation = desiredRotation + (Math.PI/2);;;
		console.log(this.i + ": rotation: " + desiredRotation);
		console.log(temp.x + ", " + temp.y);


Playable Demo

3 Things for next milestone
--Local Multiplayer
--Combine BrickGen+Player, prefabs, and change parameters to take in a player instead of (x,y) position to make multiplayer implementation easier

Upcoming: based onilne multiplayer!
-I found out how to do it Here

Milestone 3

posted Feb 23, 2015, 2:28 PM by Shah Zafrani   [ updated Apr 6, 2015, 1:16 PM ]

This week I was scheduled to have:
  • Converted my code to use prefabs
  • Brick prefabs
  • Physics tweaks

Next Milestone I will have:
  • Converted to Ninja Physics
  • Brick Generator prefab, and proper brick placement
  • Fixed the domain
  • Fitting art assets
  • Sound?

Milestone 2 (late)

posted Feb 20, 2015, 9:48 AM by Shah Zafrani   [ updated Feb 23, 2015, 2:44 PM ]

This week I am posting my Milestone later than my intended timeline, as I hit a few snags on the way. I took an unexpected trip to New Orleans over the weekend, and misplaced my laptop charger before I left (still not found). I didn't fully have my desktop setup to develop on. These only affected my timeline because I had procrastinated (I am no stranger to the Deadline Shuffle).
All of these factors provided a rich experience for me, as my next viable option was to install Ubuntu on my Chromebook and setup a dev environment on it. In the process, I learned more about Linux than I have in all of my previous attempts to work with it. It's amazing what can be accomplished with a $160 device and free software. 

Three things that I planned on having this week:
  • Ball Collisions with paddle 
    • The ball collides, but it doesn't deflect off of the paddle as I would want it to.
  • Lose condition
    • When your castle/core/heart is hit, it's game over. That's how the final game is going to be.
  • Fixed Radial Input
    • It rotates around the proper axis now, and prevents the player paddle from going off screen.

Three things for my next Milestone (3 days from now)

  • Restructuring my code to use prefabs
    • My code is scattered throughout the "play" state right now, and it would do me well to create prefabs for each type of object. The Yeoman Generator has a function for this, and I will utilize it.
  • Brick collisions and disappearing on collision
    • Place the bricks that will be around the castle/core/heart, and have them disappear on hit.
  • Physics tweaks 
    • I want to have the paddle deflect the ball at the angle the surface of the paddle is facing, not as a solid rectangle.
    • I might switch to Ninja Physics if the Phaser Arcade physics can't provide what I need

Code Structuring & Tools

posted Feb 3, 2015, 3:44 PM by Shah Zafrani   [ updated Feb 3, 2015, 3:44 PM ]

When making an HTML5 Javascript game, it's really easy to have some butt-ugly code compressed into one index.html file. I've managed to get around that by splitting everything into smaller .js files while I code, and putting it all in one game.js script when it's ready for deployment. In order to achieve this, I am using Codevinsky's Yeoman Tool found Here. It uses node.js to create a skeleton game and file structure for you, and then uses grunt to put it all together.  

For a text editor, I am using Brackets. It has a great UI, and lots of useful plugins. I have WAMP Server for local hosting while I test, and I will be using Google Drive to host while I setup my full website (

That's all for now; will post another Milestone later this week.

MileStone1 (2/9/15)

posted Feb 2, 2015, 2:15 PM by Shah Zafrani   [ updated Feb 20, 2015, 9:49 AM ]

My three things to setup this week were: 
  • Hosting
  • Input
  • Game States

My three things for next week are: 
  • Bouncing fireball
  • Shield Collision
  • Core collision / lose condition

1-7 of 7