| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
|
if i were making a game where i used something with the instance name "laser" to shoot something with the instance name "bg" and i wanted it to take three hits from the laser to remove the movieclip of the BadGuy what would the code look like.
Heybigdonkey |
|
|
|
|
|
#2 |
|
Registered User
|
You can use
removeMovieClip ("BadGuy"); on Collision Detection There's a tutorial on Collision Detection http://www.actionscripts.org/tutoria...on/index.shtml |
|
|
|
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
That tutorial's Flash 4 based. In Flash 5 we have the .hitTest element.
so something like this if ( _root.a.hitTest(b) ) { hits = hits ++; } if ( hits >= 3 ) { // remove movie clip code here } a.hitTest(b); checks if clips 'a' and 'b' are touching. Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Card Game (turn-based) - Lobby Room and Game Room, maintain state | cururu | ActionScript 2.0 | 3 | 05-20-2006 03:06 AM |
| "defender" type game .. laser not firing | spyd3r | ActionScript 2.0 | 1 | 03-22-2005 02:11 AM |
| laser game | heybigdonkey | Gaming and Game Development | 1 | 03-21-2001 05:37 PM |