Friday, May 28, 2010

How to Play Bubble Popper.

Monday, May 24, 2010

Um Nick in place of the current code regarding the multiple players etc try this instead. I have no idea if its going to work or not. Ill be in the games lab today if you want me to give you my copy.

function codeStuff():void {
ExternalInterface.addCallback("bubblepop",bubblepop);
}

var objs:Array;
var pt:Point = new Point();

function bubblepop (posx:int,posy:int, player:int):void {
pt.x = posx; pt.y = posy;
objs = stage.getObjectsUnderPoint(pt).reverse();
for each (var obj:Object in objs) {
if (obj is InteractiveObject && obj.mouseEnabled) {
pt = obj.globalToLocal(pt);
obj.dispatchEvent(new MouseEvent(MouseEvent.CLICK,true,false,pt.x,pt.y));
break;
}
}
if(player == 0) {
thisBall.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall2.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall3.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall4.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall5.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall6.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
}

if(player == 1) {
thisBall.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall2.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall3.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall4.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall5.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall6.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
}
}

P.S. if we cant get it to work my simple idea would be two have two different coloured objects (eg red and blue) and player 1 must hit red and player 2 must hit blue because all this code is confusing :P

Thursday, May 20, 2010

Hey Guys,

I am putting the website together for our exertion game and i will also try redesign our bubble pop identity and give it a different look and maybe even redesign the poster if i have time.

So for the website i was wondering if you guys wanted to have the url www.bubblepop.com.au?
I am a hosting reseller so i can host it for free but we have to buy the domain name. so if you guys are happy, do you want to all put in $7 for a domain name which will run for 2 years.
If you can all let me know by the weekend that would be great. Thanks, Sev

Monday, May 17, 2010

Where I'm at

Ok so I've worked on as much of the game as possible, implementing a few of the ideas.

Here is my current version of it (ignore the bad graphics etc)


For the multiplayer mode I am hoping that the other program can tell the flash program which player number has clicked. Heres a snippet of that area of the code:


var PlayerNumber:Mouse = new Mouse();
if(PlayerNumber == 1) {
thisBall.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall2.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall3.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall4.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall5.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
thisBall6.addEventListener(MouseEvent.CLICK, thisBallClickHandler);
}

function thisBallClickHandler(event:MouseEvent):void {

hits++;
updateStats();

thisBall.hit=1;
thisBall2.hit=1;
thisBall3.hit=1;
thisBall4.hit=1;
thisBall5.hit=1;
thisBall6.hit=1;

}

var PlayerNumber:Mouse = new Mouse();
if(PlayerNumber == 2) {
thisBall.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall2.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall3.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall4.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall5.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
thisBall6.addEventListener(MouseEvent.CLICK, thisBallClickHandler2);
}

function thisBallClickHandler2(event:MouseEvent):void {

hits2++;
updateStats2();

thisBall.hit=1;
thisBall2.hit=1;
thisBall3.hit=1;
thisBall4.hit=1;
thisBall5.hit=1;
thisBall6.hit=1;

}


I'm hoping that instead of using the Mouse function it will import the other programs code etc. But really that part isn't something I'm familiar with. Check out the .fla file and play around with the code if you like
Also the .swf file may be a bit too large to run freely on Nick's laptop so we may need to find something better

Saturday, May 8, 2010

Multiplayer Detection

I have been looking into setting up software that allows individual players to be differentiated from each other. This second part of this post is mostly aimed at Daniel, because he has been doing the flash code. It consists of two parts:

Modified Mitt

The mitts will have a timing circuit mounted on them. When the player taps a bubble, the mitt IR LED will be on for a specific amount of time. The time will be different for each mitt, allowing individual mitts to be differentiated. Because the Wiimote IR camera refreshes at 100HZ, one mitt will be on for about 4/100th of a second, while the second will be on for about 15/100th of a second. This allows the software to know which mitt each IR spot is. It may even be possible to add a third or fourth mitt if we test it out the pulse lengths first.

Modified Software

The Wiimote Whiteboard software we were using was set into mouse cursor mode for our original game. This meant that only one bubble could be popped at a time, and that it wasn't possible to differentiate between players. Thus a mouse click will not function properly to pop a bubble with multiple players. The Wiimote software is written in C#, and I have looked at the source code. I can modify the software to track multiple IR spots. The issue is that the flash program will have to have a more complicated interface with the tracking software for it to work. In order for all the game calculations and logic to occur in the flash application, I think the best way for the C# software to talk to the flash program is for the C# software to just pass the player number and pixel location (in X,Y format, likely at 1024 x 768 resolution) of a mitten press to the flash app, with everything else being done in the flash app.

Here are some examples of adding .swf programs into .net framework applications, C# specifically.


Wednesday, May 5, 2010

Updates!

Well we've all been busy with other assignments lately but I made a few simple updates to the current version of the bubble popper and have a whole load more that I would like to add.

Currently I've added a simple 60 second count-down timer so that when the time runs out for the end of the round it goes back to the loading screen (for now).

Before I make any major updates I'd really like to get the multi-player scoring system working as I think the competitiveness between players really brought out the fun in the game. The only idea I can think of but haven't researched yet is to use coloured mitts with a webcam detecting the colour, but I'm not sure how to check which colour clicked on a bubble so I need some help there.

Other ideas I would like to implement once that is all finished are:

A choice of playing styles, such as Challenge Mode, Cooperative Mode and Time Trial Mode
Challenge Mode would be simply to pop more bubbles/other objects than your opponent
Cooperative Mode would be working as a team to hit a certain amount of bubbles per level before you run out of time.
Time Trial Mode would be to see how many bubbles you could pop in a set amount of time

Multiple levels with different objects, sounds backgrounds etc

Larger playing area (bigger the better) with more objects on the screen at a time

I think I had more ideas but I've forgotten them already :P Some of the ideas we got from the feedback 2 weeks ago were also good but I forgot those as well.

What else do you guys think needs improving/changing/replacing?