I've been trying to figure out an easier way to code this for a simple RPG I have been working on, it works perfectly if the item that is unable to pass through is added individually. When I've tried to work with arrays, it throws off a bunch of evil errors. Granted I am new to AS3 but I have tried to find a solution to this, with no luck.
if(heroMC.hitTestObject(block1)) { hitObj = true; heroMC.x = gX; heroMC.y = gY; } else if(heroMC.hitTestObject(bridgeBlock2)) { hitObj = true; heroMC.x = gX; heroMC.y = gY; } if(heroMC.hitTestObject(bridgeBlock3)) { hitObj = true; heroMC.x = gX; heroMC.y = gY; } else { hitObj = false; gX = heroMC.x; gY = heroMC.y; } I then add every individual entry, to my list. If heroMC does intersect the object, then it changes the value of hitObj to true. If nothing is colliding, the hitObj will return as false. What solutions could I use to make this easier and cleaner.
Thanks in advance guys.