Go Back   kirupaForum > Flash > Flash IDE

Reply
 
Thread Tools Display Modes
Old 03-19-2010, 04:08 PM   #1
Commadorecrunch
Registered User
movieclip hitTests on particular layers of a movieclip?

Is this possible? I'm working on a game project for school and I'd like to cut down the amount of library items I'm going to have to make for each level (I have a clip for unwalkable areas, places where shots can impact and so on.) Is there a way I can just draw one movieclip per level and cut up its parts into different layers, then call hittests on just specific layers instead of the whole movieclip?

Many thanks,
Al
Commadorecrunch is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?

Old 03-21-2010, 06:48 AM   #2
ilike2
Registered User
 
ilike2's Avatar
You can try using nested movie clips which are movie clips inside movie clips. For each level you can have different movie clips nested within each other.

Will this work for you?

__________________
ilike2flash
www.ilike2flash.com
ilike2 is offline   Reply With Quote
Old 03-21-2010, 11:04 AM   #3
Zelthor
Registered User
Location Groningen, Netherlands

Posts 19
Target vs. CurrentTarget

Take a look at this tutorial:
http://www.wastedpotential.com/?p=10

I think this is pretty much what you're looking for!
Zelthor is offline   Reply With Quote
Old 03-21-2010, 11:39 AM   #4
Commadorecrunch
Registered User
Quote:
Originally Posted by ilike2 View Post
You can try using nested movie clips which are movie clips inside movie clips. For each level you can have different movie clips nested within each other.

Will this work for you?
Well this is what I'm doing now, but to do this I need multiple clips in my library for each level and I'm not a fan of that... I would prefer the ability to layout my entire level in one movieclip, and then slice it apart into the specific sections which I want to have different properties.

This is what I think what I'm asking would look like in code (I haven't found it anywhere thus far) :

if (Engine.Environment.layer2.hitTestPoint(bullet.x, bullet.y)) {
removeSelf();
}
Commadorecrunch is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:50 AM.

SHARE:

SUPPORTERS:

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com