Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-21-2001, 07:53 PM   #1
heybigdonkey
Registered User
 
Join Date: Mar 2001
Posts: 9
Send a message via AIM to heybigdonkey
Default

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
heybigdonkey is offline   Reply With Quote
Old 03-21-2001, 09:01 PM   #2
Strok
Registered User
 
Join Date: Nov 2000
Location: Toronto Canada
Posts: 789
Send a message via ICQ to Strok
Default

You can use
removeMovieClip ("BadGuy");
on Collision Detection

There's a tutorial on Collision Detection


http://www.actionscripts.org/tutoria...on/index.shtml
Strok is offline   Reply With Quote
Old 03-22-2001, 01:00 AM   #3
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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


All times are GMT. The time now is 11:42 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.