I’m currently making a game not dissimilar to “falldown”, (if your unsure of what that is just google it) but I’m having some issues with the collision detection. I have it currently so each new segment of the level is radomly generated and moves across the screen correctly but as they are not on the stage I am unable to provide them with an instance name and as a reasult am finding it difficult To remedy the issue I have tried to create an array and creat a hit test on that but haven’t had good reasults, below is the code I am currently using (with some parts removed for the sake of legnth) and I was hoping to get some advice on a possible solution for the situation.
onClipEvent (load)
{
var levels;
levels = [];
}
onClipEvent (enterFrame)
{
grav++;
_y += grav;
while for(var i in _root.player.levels)
if(_root.player.levels*.hitTest(_root.player))
{
_y--;
grav = 0;
}