What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Im wondering if this code will work:
var myCoins:Array = new Array();//create Array that I am adding a MC called coin to in another layer
var i:Number = 0;
if(myCoins[i].hitTest(ball.square))//When the certain coin on the stage hits the ball
myCoins[i]._visible = 0;//use visible to test if the collision works
}while(i<(myCoins.length-2));//I think this is right, I want to just run the loop from 0 to the number of coins out on the stage
if(i == (myCoins.length-1))//When the loops gets out I want to run it again
i = 0;
You’re code needs some refinements/optimizations but the practice of storing MovieClip references in an array is pretty standard and expected for more intricate applications. So yes, you’re on the right track. I haven’t checked if there are errors in the code though.
ok so now I figured that part out, but I have one other thing going on. When I collect the coins( there are 5 for level 1), I am doing level++; and sending the var level to the setCoins function where I use a loop to place my coins on the screen. But whats happening is, the code sets the coins out on the stage but for some reason my code for collision detection only checks for 5 of the coins, when, if I am in level 2, there are really 10 coins on the stage. Ill upload the swf and give you the code:
checkCoins = function()
if(numCoins == 0)
totalCoins = (level*5);
numCoins = totalCoins;
coin = attachMovie("coin","newcoin"+j,this.getNextHighestDepth());
coin._x = (random(475)+20);
coin._y = (random(475)+20);
}while(j < totalCoins);
This is only a fraction of my code, but this is where I think the error is. Thx alot: down below is the link to the swf.