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 06-09-2002, 06:18 PM   #1
msentinelb
Registered User
 
Join Date: Jun 2002
Location: Holland
Posts: 3
Default Fighting game

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???
msentinelb is offline   Reply With Quote
Old 06-09-2002, 06:34 PM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

You can always create new player who can get kicked and punched...

Jason
CyanBlue is offline   Reply With Quote
Old 06-09-2002, 06:37 PM   #3
msentinelb
Registered User
 
Join Date: Jun 2002
Location: Holland
Posts: 3
Default

Yeah ok, but the player2 must get hit when i punch ( or kick ) and i dont know how to do that. anyone a idea??
msentinelb is offline   Reply With Quote
Old 06-09-2002, 10:29 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

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
CyanBlue is offline   Reply With Quote
Old 06-10-2002, 12:32 PM   #5
msentinelb
Registered User
 
Join Date: Jun 2002
Location: Holland
Posts: 3
Default

hmmm, yeah ok but what do you mean with hitest?
msentinelb is offline   Reply With Quote
Old 06-10-2002, 10:49 PM   #6
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

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...
CyanBlue 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 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


All times are GMT. The time now is 02:57 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.