Friday, April 17, 2009

The Final Result of "Hand it"

Our Team PDF: Click Here

We did not deviate too much from our original idea of "Hand it". It still turned out to be a rhythm game based on space. The User has to collect matter from the universe which is metaphorized by the "hands" triggering notes over portals and in the end result that matter is summed up and translated into images. These images depict what kind of universe the user has created. The basic concept is utilizing the four corners of the screen to hit notes and collect matter to build up a universe.



Instead of using gloves to detect colour for this project, we ended up using toilet cleaners because the colours they emanated were much more solid than that of gloves. These toilet cleaners would be used to hit the notes on the screen by moving them around towards the portals. Many different patterns could be used to hit the notes which allows for a lot of variability (and exercise).

I would say the hardest part of this project was the initial connection of MAX/MSP to Flash. We had to use a java based server to open a gateway in order for data to flow in from MAX to Flash. This also presented some other problems with our Flash. We had to re-code our entire script from AS3 to AS2 in order for the connection to work properly because it apparently only supported AS2. Furthermore, the communication of MAX/MSP to Flash created memory issues also. The information from max would exponentially grow on the Flash side and the information would not clean itself up, even the data that has already been passed. We had to rid of some storage functions to allow for more efficient memory uses in our main program, else, the game would crash in early stages of game play. The programming itself was tedious because for every note that is created on the screen, a new function had to be called, so it expanded our code to lengths of hundreds of lines just for that.

This is our Video Blog to explain the main components of our game. It includes an interview with a very prestigious game designer, Cody Church, who gave us very enlightening feedback to better our game:

Click Here for Video





Code from Flash:


For score detection:

stageMC.onEnterFrame = function() {

//TOPLEFT SCORE CHECK
if ((HANDL._x > 60 && HANDL._x <> 50 && HANDL._y <> 60 && HANDR._x <> 50 && HANDR._y < 130)) {
hitS.gotoAndStop(2);
if (s1._x > 60 && s1._x<140) {

pointS += 1;
ScoreS.text = pointS;
}

if (s2._x > 60 && s2._x<140) {

pointS += 1;
ScoreS.text = pointS;
}
} else {
hitS.gotoAndStop(1);
}
//TOPRIGHT SCORECHECK
if ((HANDL._x > 500 && HANDL._x <> 50 && HANDL._y <> 500 && HANDR._x <> 50 && HANDR._y < 130)) {
hitP.gotoAndStop(2);
if (s3._x > 500 && s3._x < 580) {

pointP += 1;
ScoreP.text = pointP;
}

if (s4._x > 500 && s4._x < 580) {

pointP += 1;
ScoreP.text = pointP;
}
} else {
hitP.gotoAndStop(1);
}

//BOTTOMLEFT SCORECHECK
if ((HANDL._x > 60 && HANDL._x <> 350 && HANDL._y <> 60 && HANDR._x <> 350 && HANDR._y < 430)) {
hitM.gotoAndStop(2);
if (s5._x > 60 && s5._x<140) {

pointM += 1;
ScoreM.text = pointM;
}

if (s6._x > 60 && s6._x<140) {

pointM += 1;
ScoreM.text = pointM;
}
} else {
hitM.gotoAndStop(1);
}

//BOTTOMRIGHT SCORECHECK
if ((HANDL._x > 500 && HANDL._x <> 350 && HANDL._y <> 500 && HANDR._x <> 350 && HANDR._y < 430)) {
hitO.gotoAndStop(2);
if (s7._x > 500 && s7._x < 580) {

pointO += 1;
ScoreO.text = pointO;
}

if (s8._x > 500 && s8._x < 580) {

pointO += 1;
ScoreO.text = pointO;
}
} else {
hitO.gotoAndStop(1);

}

};


CODE for Shooting STUFF to the corners


//FUNCTION TO SHOOT THE STARS to the CORNERS.
function topLeft1() {
var Tx1:Tween = new Tween(s1, "_x", None.easeIn, Stage.width/2, 0, 2, true);
var Ty1:Tween = new Tween(s1, "_y", None.easeIn, Stage.height/2, 0, 2, true);
}

function topLeft2() {
var Tx1:Tween = new Tween(s2, "_x", None.easeIn, Stage.width/2, 0, 2, true);
var Ty1:Tween = new Tween(s2, "_y", None.easeIn, Stage.height/2, 0, 2, true);
}

function topRight1() {
var Tx1:Tween = new Tween(s3, "_x", None.easeIn, Stage.width/2, 640, 2, true);
var Ty1:Tween = new Tween(s3, "_y", None.easeIn, Stage.height/2, 0, 2, true);
}

function topRight2() {
var Tx1:Tween = new Tween(s4, "_x", None.easeIn, Stage.width/2, 640, 2, true);
var Ty1:Tween = new Tween(s4, "_y", None.easeIn, Stage.height/2, 0, 2, true);
}

function bottomLeft1() {
var Tx1:Tween = new Tween(s5, "_x", None.easeIn, Stage.width/2, 0, 2, true);
var Ty1:Tween = new Tween(s5, "_y", None.easeIn, Stage.height/2, 480, 2, true);
}

function bottomLeft2() {
var Tx1:Tween = new Tween(s6, "_x", None.easeIn, Stage.width/2, 0, 2, true);
var Ty1:Tween = new Tween(s6, "_y", None.easeIn, Stage.height/2, 480, 2, true);
}

function bottomRight1() {
var Tx1:Tween = new Tween(s7, "_x", None.easeIn, Stage.width/2, 640, 2, true);
var Ty1:Tween = new Tween(s7, "_y", None.easeIn, Stage.height/2, 480, 2, true);
}

function bottomRight2() {
var Tx1:Tween = new Tween(s8, "_x", None.easeIn, Stage.width/2, 640, 2, true);
var Ty1:Tween = new Tween(s8, "_y", None.easeIn, Stage.height/2, 480, 2, true);
}

topRight2();
bottomRight1();
bottomLeft2();

//FUNCTIONS THAT MOVE THE HANDS


moveLEFT(10,10);
moveRIGHT(501,100);

//HANDL.startDrag();
//TEST PURPOSE
stageMC.onKeyDown = function() {
//topLeft1();
//var Tx1:Tween = new Tween(s7, "_x", None.easeNone, 0, 190, 3, true);

};

No comments:

Post a Comment