| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jun 2002
Location: Holland
Posts: 3
|
I have made a fighter in flash that can punsh move and kick.
But now i need something to punch and kick at. maybe a second player. I have NO idea how to do this. can anybody help me??? |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
You can always create new player who can get kicked and punched...
![]() Jason |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2002
Location: Holland
Posts: 3
|
Yeah ok, but the player2 must get hit when i punch ( or kick
) and i dont know how to do that. anyone a idea?? |
|
|
|
|
|
#4 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
Hi...
Why don't you start with two blocks or something that will represent player1 and player2 and use hitTest or something to create the interaction and when you got this working, you can expand it to more complex objects??? Just my 2 cents... Jason |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jun 2002
Location: Holland
Posts: 3
|
hmmm, yeah ok but what do you mean with hitest?
|
|
|
|
|
|
#6 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
Um...
hitTest is one of the Flash's builtin function that can be used to do things like what you want to do... Detailed info from the ActionScript Dictionary... --- MovieClip.hitTest Syntax anyMovieClip.hitTest(x, y, shapeFlag); anyMovieClip.hitTest(target); Arguments x The x coordinate of the hit area on the Stage. y The y coordinate of the hit area on the Stage. The x and y coordinates are defined in the global coordinate space. target The target path of the hit area that may intersect or overlap with the instance specified by anyMovieClip. The target usually represents a button or text-entry field. shapeFlag A Boolean value specifying whether to evaluate the entire shape of the specified instance (true), or just the bounding box (false). This argument can only be specified if the hit area is identified using x and y coordinate arguments. Description Method; evaluates the instance specified by anyMovieClip to see if it overlaps or intersects with the hit area identified by the target or x and y coordinate arguments. Usage 1compares the x and y coordinates to the shape or bounding box of the specified instance, according to the shapeFlag setting. If shapeFlag is set to true, only the area actually occupied by the instance on the Stage is evaluated, and if x and y overlap at any point, a value of true is returned. This is useful for determining if the movie clip is within a specified hit, or hotspot, area. Usage 2 evaluates the bounding boxes of the target and specified instance, and returns true if they overlap or intersect at any point. Player Flash 5 or later. Example The following example uses hitTest with the x_mouse and y_mouse properties to determine whether the mouse is over the target's bounding box: if (hitTest( _root._xmouse, _root._ymouse, false)); The following example uses hitTest to determine if the movie clip ball overlaps or intersects with the movie clip square: if(_root.ball, hittest(_root.square)){ trace("ball intersects square"); } See also MovieClip.localToGlobal MovieClip.globalToLocal MovieClip.getBounds ---
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer http://CyanBlue.FlashVacuum.com http://www.FlashVacuum.com http://tutorials.FlashVacuum.com Do NOT PM, Email or Call me... Your question belongs right in this forum...
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Card Match Game, Colour Me In Pictures and Board Game | Total Frigging | ActionScript 2.0 | 4 | 02-21-2005 01:04 AM |
| [AS2] Tile game or not tile game? | krolben | Gaming and Game Development | 4 | 07-28-2004 01:41 PM |
| Flash 5 Fighting Game | dnalogic | Site Check | 14 | 12-12-2003 02:53 AM |
| Game - freelancer required | fatherb | Projects and Positions | 6 | 07-18-2003 12:47 PM |
| how to put the chosen charactor onto the Stage in a fighting game? | nychole | Gaming and Game Development | 3 | 06-13-2003 07:53 PM |