I'm new to this forum and I feel like I'll be staying.
Don't laugh at how simple my problems are kthx.
My first problem is that I use
ActionScript Code:
if (_root.wall.hitTest(_root.Hero))
{
}
else
to check if there is NO collision.
It seems unnecessary to do this, when I should be able to do something like:
ActionScript Code:
if NOT (_root.wall.hitTest(_root.Hero))
I just want to know how to check for NO collision in a better way.
My second problem is that I don't know how to make one piece of code apply to more than one object. Let's say I want walls in many places. I should be able to make the code for the wall only once, and put it in many places, right? For some reason, the collision code only works for one of the walls I use, and I go right through the rest. I tried copy and pasting more walls, and I tried dragging more walls from the library.
And a third question(not really problem) is what is _root? I read the definition and I don't understand it. Why is it necessary to put _root.wall instead of just wall?
Any help is greatly appreciated.
EDIT: Sorry, I just noticed the newbie section. I'm going there now.