Forum Topic: [as3] Hittestobjest On Any Object?

(76 views • 3 replies)

This topic is 1 page long.

<< < > >>
None

Wolfears2

Reply To Post Reply & Quote

Posted at: 7/24/09 09:14 AM

Wolfears2 EVIL LEVEL 08

Sign-Up: 10/20/07

Posts: 862

I have all my other code ready, but I read somewhere that you can use hitTestObject to collide with any object with just one piece of code? By that, I mean something like:

function CheckHit(){
if(ball.hitTestObject()==true;){
//stuff
}
}

Yes, I have already made my checkHit function, that's not the error. Any help?

Click my sig for a hilarious thread.

BBS Signature

None

AnalogStick

Reply To Post Reply & Quote

Posted at: 7/24/09 10:12 AM

AnalogStick LIGHT LEVEL 07

Sign-Up: 10/13/06

Posts: 947

At 7/24/09 09:14 AM, Wolfears2 wrote: I have all my other code ready, but I read somewhere that you can use hitTestObject to collide with any object with just one piece of code? By that, I mean something like:

function CheckHit(){
if(ball.hitTestObject()==true;){
//stuff
}
}

Yes, I have already made my checkHit function, that's not the error. Any help?

I don't really see a question there but hitTestObject checks well hitests with objects. So it would be if(ball.hitTestObject(someobject)==true) It can only check between 2 items.


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 7/24/09 10:54 AM

UnknownFury EVIL LEVEL 26

Sign-Up: 08/10/05

Posts: 6,027

Push everything on the stage into an array and loop through the array testing each one individually.

Portfolio(Under construction): UnknownFury.com |
Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com
Follow me on twitter!


None

Wolfears2

Reply To Post Reply & Quote

Posted at: 7/24/09 10:54 AM

Wolfears2 EVIL LEVEL 08

Sign-Up: 10/20/07

Posts: 862

I'm trying to use that one hitTestObject to collide with all my other objects. So, Instead of making another check for every item, just on piece of code that covers all the items.

Click my sig for a hilarious thread.

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 05:30 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!