Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-15-2008, 10:13 PM   #1
Pedal-kid
Registered User
 
Join Date: Jun 2008
Posts: 26
Red face Game control help

I am going to make a stickman fighting game, and I have got to controls.
When I hold down "enter" at the same time the stickman named "dude" is touching the stickman named "bluedude", I won't bluedude to lose 10HP
bluedudes HP var is "bluehp" what did I do wrong here?:

ActionScript Code:
onEnterFrame=function() { if (dude.hitTest(bluedude)==true)&&{if (Key.isDown(Key.ENTER)) { bluehp-=10; }   } }
Pedal-kid is offline   Reply With Quote
Old 07-16-2008, 06:26 PM   #2
Noct
Toys in the Attic...
 
Noct's Avatar
 
Join Date: Oct 2006
Location: NY
Posts: 3,017
Default

You have some syntax errors in there for one thing, give this a shot:
ActionScript Code:
var bluehp:Number = 100; dude.onEnterFrame = function() {     if ((this.hitTest(bluedude)) && (Key.isDown(Key.ENTER))) {         bluehp -= 10;         trace("bluehp = "+bluehp);     } };
__________________
http://rwithers.com
Noct 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
[AS2] Help with a Find/Click game RH*Megan*CP Gaming and Game Development 0 10-26-2007 03:15 AM
WASD game hegerp Gaming and Game Development 0 10-17-2007 09:34 AM
AS3 Game Dev Kit newblack General Chat 3 06-03-2007 01:30 AM
[AS2] Depth control for game characters Human Gaming and Game Development 3 11-20-2006 09:43 PM
Augh. Too many ways to skin a cat. (game design q's) beau Gaming and Game Development 0 01-14-2005 07:08 PM


All times are GMT. The time now is 12:40 PM.

///
Follow actionscriptorg on Twitter

 


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