well a hitTest can do alot, and since I have no idea what you are trying to do with your hitTest I just put in an author's note (what the // does is remove that line from the code) and wrote reactions meaning what you want it to do
(sorry if that sentence ran on/is confusing)
so when two objects hit you could change their x and y values or delete the movie clip (this only works if it has a depth)
I hope that answers your question
if you would actually like a tutorial made by me, then i could do that
it would make this much easier to understand
and it seems that you are trying to take a giant leap in learning actionscript by skipping the basics
ok, so you would use a // thing if your writing a note about the script?
and i want it so that it would make the character your controling stop, like a wall. I set it so that the _x value would go at the push of LEFT at 8 pixles per press, so i need it to go _x =8; instead of _x-=8; got it?
well heres the code i use for the buttons (i put this on the movieclip you control);
onClipEvent(enterFrame) {
if(Key.isDown(Key.LEFT)) {
this._x-=8;
}
}
and i tourterial would be nice
yes
and im gonna make one change to your script to make it so that you even CAN make it stop
onClipEvent(load) {
speed =8;
}
onClipEvent(enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
}
if (this.hitTest(object._x, object._y, true)) {
speed = 0;
}
}
I believe that is what you want.
what it does is defines your speed variable at the beginning as 8
then if it hits the object, the speed will equal 0 and the object wont be able to move anymore
most internet tutorials do the actual code attatched to the movie clip. I don't. I keep everything on the timeline in the frames. Makes it much easier to organize. I'll make a bunch of little tutorials saying how to do stuff like that
ive been using a code like that, and its hard because that spot would be jamed with a whole bunch of walls, or will that be just for one spot? like a terain? something like this:
...||
___||__||__
and nomatter what spot it is, it will still stop?
would that code work so that you can just use it for ground floors? so you dont have to put a diffrent code for every spot?
ill try again, like this:
....__|....|___
__|...........|...
and you wouldnt have to put a seprate code for each | and each _?
Hello Everyone.
My name is Mike.
I am Lazy.
I get bored easily.
After going 2 months without *real* computer access, I no longer care about sites such as this.
Though I shall be submitting some of the things that I make in my spare time and for classes.
I'll post a few journals.
You know. All that Jazz.
Maybe get a few people who regularly check my page.
Maybe a few page views.
That'd be cool.
But I'm not going to strive for any of that.
Have a good day.