|
-
Client Software Programmer
hit test nig13
Alright so I tried the hit test and to organize all my folders abit to see what im doing wrong I still cant find it so try to see whats wrong heres the .fla.
also the character stuff is located in the isometric-textures-items folder and in that folder theres a folder called iso package with the main character moveiclip. Thanks in advance.
files to big add an attachment and I dont want to make everything red so here:
(deleted)
Last edited by AS3.0; 01-28-2012 at 12:25 PM.
-
Prid - Outing
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Client Software Programmer
wow man completely forgot about that. thanks
-
Client Software Programmer
for the hit test to my attached trees im trying:
on(release){
if(_root.clip.tile.tree.hitTest(this)){
this.gotoAndStop(2);
}
}
do you know whats wrong there?
-
Prid - Outing
Now I'm becoming a bit skeptic over the fact that you actually wrote the code yourself or not õ.Ô?
Each tile has gotten its own unique instance name, t_0_0, t_0_1, t_0_2, etc. and only some, marked as 1 in your map array, will go to and stop on Frame 2, where the tree is, so in this case, you have to use a for loop to check for every single tile, which is on Frame 2 (meaning that there's a tree on that tile), and use hitTest on that tree, for instance:
Actionscript Code:
on(release){ for(i=0;i<7;i++){ for(a=0;a<7;a++){ var name1 = "t_"+i+"_"+a; if (_root.game[name1].walkable) { var clip1 = _root.game.clip.back; } else { var clip1 = _root.game.clip; } if(clip1[name1]._currentframe == 2){ if(clip1[name1].tree.hitTest(this)){ gotoAndStop(2); } } } } }
This is based on one of the codes from your Full Code, because the not walkable tiles are stored one step behind the other tiles in terms of movieclip nesting, which are the ones containing the trees. Checking if the trees in only those tiles are hitting the desired target, will give you a positive response
Hope this helps
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Client Software Programmer
no its the isometric code from tonypa remember i mixed it with mine, and thanks!
some parts of this look complicated though heh still need more learning
Last edited by AS3.0; 01-28-2012 at 08:02 PM.
-
Prid - Outing
oh, I knew I had seen similar isometric coding somewhere before :P
but you managed to manipulate it and implement it into your own game, props for that
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Client Software Programmer
eh, thanks but more props to you for being my age yet having more knowledge in flash :P your a good help on this site and every time I need help you got the solutions. double props for that.
-
Prid - Outing
haha, no problem, I just had an earlier start than you, that's all
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|