dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Damage Calculator

  1. #1
    Senior Member
    Join Date
    Nov 2005
    Posts
    192

    Damage Calculator

    I'm trying to make a damage calculator for one of my games that will tell me the damage per second, and per bullet. I'm trying to do it so that there are 3 drop downlists where you first select your gun, and then your damage upgrade. I do not even know if its possible to do it with comboboxes because i have never made a form in flash before, but here is the information for one gun

    heavy machinegun damage per bullet=20
    damagelevel 1=10% increased damage
    damgage level 2= 20% increased damage
    damage level 3= 30% increased damage

    total damage per bullet should be equal to hmgdamage*(1+damagelevel)
    each damage level is .1 so level 3 would be hmgdamage * 1.3

    the heavy machinegun fires 10 bullets per second, so the damage per second value would just be the bullet damage times 10.

    I know this sounds relatively simple, but i've never done anything like this.
    i dont know which commands i use of the combobox such as data, labelfield, value, selecteditem, or if i should even use those at all.

    i just want to know how to make a program that will have 2 drop down lists where you select from 4 guns in the first list, and the other list will have the 3 damage upgrades including no damage upgrade. a dynamic text should be able to display the total damage but i have tried 3 things so far and nothing works.

    If it is easier to do this with radio buttons or something else, you could help either way. any help would be appreciated, i dont need you to make the program, just help me understand how to do it and tell me which commands i should use.

    i am sorry if any of this unclear, and i will answer any other questions you may have.
    Last edited by Flyingcow; 01-10-2006 at 08:06 PM.

  2. #2
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    Quote Originally Posted by Flyingcow
    ...i just want to know how to make a program that will have 2 drop down lists where you select from 4 guns in the first list, and the other list will have the 3 damage upgrades including no damage upgrade. a dynamic text should be able to display the total damage but i have tried 3 things so far and nothing works.

    If it is easier to do this with radio buttons or something else, you could help either way. any help would be appreciated, i dont need you to make the program, just help me understand how to do it and tell me which commands i should use.
    although your app has to do with physics, your question really doesnt belong in this thread....
    anywhich way, there are a whole lot of tutorials out there about flash components

    but since you already posted here:
    make a combo box and use the addItem command

    the label field contains what you will see on the combo box, and the data field is an extra 'hidden' field which can store any extra info that that item possesses

    also if you right-click a command in flash and choose 'view help' you can read all about it

  3. #3
    Senior Member
    Join Date
    Nov 2005
    Posts
    192
    if my combobox instance name is damage
    and HMG is selected

    what command will return the value of HMG?

    ive tried atleast 3 that dont work. tutorials i have looked at use getValue() but flash doesnt recognize it as a command, nor does it work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center