A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: A few basic Q's if any persons can answer?

  1. #1
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874

    A few basic Q's if any persons can answer?

    Im making a new game and its a lot more advanced than my last game so there are a few things im not shore of or cant get working.

    A FPS monitor. On some games they have a little box with the FPS in it. How's this done.

    Im looking for a shooring turorial that is based around
    Math.cos(_rotation*Math.PI/180)
    Math.sin(_rotation*Math.PI/180)
    Know of any?

    You can test what i have done here http://www.freewebs.com/aarons_web/test1.swf
    PS: This is only my second game.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Gloo pot
    A FPS monitor. On some games they have a little box with the FPS in it. How's this done.
    I think this will explain fps meter well, plus you can download the source fla too:
    http://moock.org/webdesign/flash/act...ter/index.html

  3. #3
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Hey tony do you know how to make a percentage start at 100% and go down instead of up.
    Current Amount / Maximum Amount * 100
    2.5 / 10 *100 = 25%

    What i cant figured out its how to make it start at 100% and work down. Making it equale 75%
    Any idea'

    Thanks for that site
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  4. #4
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    dang.
    100 - (2.5/10*100) = 75

    although i hope this is some kind of a trick question.

  5. #5
    Senior Member
    Join Date
    Apr 2005
    Posts
    467
    Why do you need that for Gloo?
    Bytes loading or something?

    Why not using the simple method to increase your percentage and substract it from 100?

    result = 100 - (increasing percentage)
    Hope nobody knows I am still on Flash 5
    ______________________________________
    All artists are prepared to suffer for their work
    but why are so few prepared to learn to draw?(Banksy)

  6. #6
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    I need it for the gravity. I want to be able to set the gravity to anything.
    So if your speed is 0 gravity is 100% and if you speed is 100% graity is 0%
    I think the equation i ATM is
    Gravity = (SPEED)/(TOPSPEED)*(100);
    But with this if the top speed is like 5 the max gravity is only 0.2 or somthing.
    I just want to be able to set gravity and it scale from 100% to 0%

    I just wanted the equation beause i wanted to monitor the gravity while i continue with the engine. Just in case things start falling apart.

    PS: Thanks for the answer
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  7. #7
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Sorry about all the maths questions,

    I have a speed varable but i want the gravity to be affected by the speed.
    max speed = 200
    current speed = (whatever)
    max gravity = 6
    current gravity is = (If current speed is = 100, i want CUrrent gravity to = 50% (3))

    I have been trying to get this to work all day.
    Any surgestions
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  8. #8
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    gravity = (SPEED / TOPSPEED * Maxgav);
    or the long way:

    g = (s / ts * 100) * (mg / 100);

    nGFX

  9. #9
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Thanks, but i realised what i said. What i am trying to do is
    Max gravity = (10)
    topspeed = 100
    If speed = 0
    gravity = 100% (10)
    if speed = 25
    gravity = 25% (2.5)
    if speed = 100
    gravity = 0% (0)
    I tryed you code but gravity only kick in if you start to move. I want the oposite you what your code was. To have Max gravity applied while not moveing and none if at top speed

    I hope you understand.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  10. #10
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    g = (100 - (s / ts * 100)) * (mg / 100)

    nGFX

  11. #11
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Your a champ thanks mate.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  12. #12
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Here is the lastest update to what i am creating.
    www.freewebs.com/aarons_web
    Im am fair proud considering this is my second game/project in flash.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

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