HOME | DD

Published: 2005-02-13 07:18:41 +0000 UTC; Views: 1586; Favourites: 27; Downloads: 262
Redirect to original
Description
Tutorial on collision detection.Also shows you how to make a jigsaw puzzle and other cool things.
Dificulty level gets higher as the tutorial progresses.
PS: I apologise for typos and long winded explinations lol
Related content
Comments: 19
carmiecarmela [2008-08-24 04:29:16 +0000 UTC]
NIce tutorial, can you teach us how to do that collison detection but with a character moving instead of the mouse draggin it? THank you
👍: 0 ⏩: 0
Limette-X [2007-02-12 13:34:03 +0000 UTC]
Thank you so much! I am a flash newbie and I tried out so many puzzle tuts I found on the internet and I never achieved a result, but this was really good and easy to understand And now I don't have to despair of jigsaw puzzles anymore
👍: 0 ⏩: 0
little-teenager-sam [2006-08-27 20:39:50 +0000 UTC]
grat tut. i've been looking for this for a long time... but i've got a problem (who doesnt). instead of making the obj. move with mouse i used the script to move on keypress. this part works but then you said that we decide what to do when obj. hits the wall or somethin we want. here's the problem. i want that my character hits the wall so it can't pass it. i added some script on my own but it isn't working, i got 2 errors (im not really surprised, cause i did it without sript assist). here's the script:
onClipEvent (load) {
_quality = "high";
moveSpeed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT, true)) {
this._x += moveSpeed;
_root.dude.gotoAndStop(2);
} else if (Key.isDown(Key.UP, true)) {
this._y -= moveSpeed;
_root.dude.gotoAndStop(4);
} else if (Key.isDown(Key.DOWN, true)) {
this._y += moveSpeed;
_root.dude.gotoAndStop(5);
} else if (Key.isDown(Key.LEFT, true)) {
this._x -= moveSpeed;
_root.dude.gotoAndStop(3);
} else {
_root.dude.gotoAndStop(1);
}}
if (this.hitTest(_root.hitbox)) {onClipEvent {setProperty(_root.this._x += movespeed=0);
}
}
}
yeah it's long... i tried to figure what the mistake is out myself but i spent hours workin on this and i couldnt find it . can you help please??
👍: 0 ⏩: 1
little-teenager-sam In reply to little-teenager-sam [2006-08-27 21:03:34 +0000 UTC]
my phatethic scripting and animating skillz make me wanna delete flash
👍: 0 ⏩: 0
mr-JB [2005-12-03 18:57:56 +0000 UTC]
I thinck your code is wrong....
You have to put:
on (press){
startDrag("");
}
on (release){
stopDrag();
not:
on (press) {
startDrag("", true);
}
👍: 0 ⏩: 3
Kamryn In reply to mr-JB [2006-07-12 20:53:50 +0000 UTC]
had the same problem, so i changed the beginning of the code to this:
on (press) {
startDrag(this);
}
works now! ^_^
👍: 0 ⏩: 0
SoxyFoxer In reply to mr-JB [2005-12-03 21:09:50 +0000 UTC]
It could be! but I dont know... I think its true by default. So leaving true out is the same as saying ture. but if its not then nice catch.
👍: 0 ⏩: 0
dacezo [2005-04-29 15:12:18 +0000 UTC]
it really helped me to create a game!!!!!!!!!!!!!!!! but i dunno why wen i realease with my mouse it doesn't stop the dragging!!!! [link]
I hope its just in my computer and not in everyone else's
👍: 0 ⏩: 2
Kamryn In reply to dacezo [2006-07-12 20:54:44 +0000 UTC]
had the same problem, so i changed the beginning of the code to this:
on (press) {
startDrag(this);
}
works now! ^_^
👍: 0 ⏩: 0
SoxyFoxer In reply to dacezo [2005-04-30 01:21:28 +0000 UTC]
Yeah that IS odd, I checked it out, and it doesn't seem to be working like mine do. Are you absoulutely sure you added the
on (release) {
stopDrag();
}
Part of the code in? and not something llike
on (click) {.... or something?
other than that, I'm glad my tutorial was helpful
👍: 0 ⏩: 0
craftwercz [2005-03-11 06:03:52 +0000 UTC]
Cheers for the lesson, have just recently started fiddling with flash and though I figured out the basics of layering and frames...I hadn't a clue how to use the actions panel and all flash examples I've downloaded only allow me to play them, never see the code to figure out how the damn things work. Guess it's much like java script infact it may even be java script LOL, what do I know I'm mostly old skool still!!
👍: 0 ⏩: 1
SoxyFoxer In reply to craftwercz [2005-03-12 03:14:06 +0000 UTC]
yeah, it is alot like java, but its totally object oriented which kind of confuses me sometimes, since it means you have to go search for specific peices of code in different objects. I'm allways glad to hear that I was of some type of help.
👍: 0 ⏩: 0
thomasleak [2005-02-14 01:32:36 +0000 UTC]
i thought it was very good, i dont know if i will use it anytime soon, because i am new with flash, but it was definitely easy to understand, but i didnt quite grasp the jigsaw puzzle, i didnt think i would, but i wanted to try it..it is excellent.!
👍: 0 ⏩: 1
SoxyFoxer In reply to thomasleak [2005-02-14 02:55:01 +0000 UTC]
Hey thanks for the comment, I was afraid that nobody would understand me becasue I tend to have a hard time explaining things. Good luck with your flash work.
👍: 0 ⏩: 1