Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-15-2005, 07:05 PM   #1
Merrie
Registered User
 
Merrie's Avatar
 
Join Date: Nov 2005
Location: PA
Posts: 2
Send a message via Yahoo to Merrie
Default Counter 'Lives' & Mouse Click

Hello everyone, I am pleased to be part of the ActionScript forum. I have a couple of questions and thank you ahead of time for your assistance.

I use Selteco Flash Designer 5 (As I cannot afford to purchase Flash 8 or MX2004) and it seemed an easier way to break into flash. Back to my question.

Im creating a fairly simple adventure text game, basically is is a presentation where you have some choices that will lead you in different directions in the adventure.

Now what I would like to do is add an action script counter for '3 lives' if the player chooses to 'fight' a monster the results will be random, either a hit (which subtracts 1 life) or the monster is hit (which subtracts 1 of it's life)

So the choice would be: Do you wish to fight? (button click - goes to fight frame) .. random event occurs for hit .. 1 life is removed, monster or character.

Then the choice would be: Do you wish to fight again? (goes to another fight frame as above) .. Or withdraw (goes to a withdraw frame)

So Im looking for help with the 'counter'
And with the random 'hit' event.

Merrie is offline   Reply With Quote
Old 11-15-2005, 07:36 PM   #2
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

For counter you just do something like this:
var lives = 3;

then for the hit event, you do:

ActionScript Code:
// hit half the time var hit:Boolean = Math.random() > .5; if(hit) { lives--; }
Paerez is offline   Reply With Quote
Old 11-15-2005, 10:04 PM   #3
Merrie
Registered User
 
Merrie's Avatar
 
Join Date: Nov 2005
Location: PA
Posts: 2
Send a message via Yahoo to Merrie
Default

Thank you for the answer, much appreciated, I'll let you know how it went.
Merrie 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
how can i get an object to move with a mouse click?? Bob_McFarren ActionScript 2.0 3 10-13-2005 02:49 PM
Centering of Movie Clip on Mouse Click RedWombat Components 4 08-08-2005 08:29 PM
hitTest on mouse click not _root.beast_mc? gabrielknight ActionScript 2.0 4 01-28-2005 04:37 PM
How to click a button by using a key but mouse click flashwolf ActionScript 2.0 10 05-21-2004 08:28 AM
I need to make an symbol appear when i click my mouse CiBxS ActionScript 1.0 (and below) 2 12-23-2000 03:09 PM


All times are GMT. The time now is 05:33 AM.

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