ActionScript 2.0 :: Adjusting Friction Higher When Object Slow Down

Jul 31, 2005

I wrote this 9ball game a while back (never really finished it), and was showing it to a friend today. When a pool ball is rolling fast, less of it's mass should be touching the felt, therefore, less friction. As it slows down, there should be more contact with the felt, and therefore, more friction. Any realistic algorithm to use to adjust the friction higher as the balls slow down? [URL]

View 11 Replies


Similar Posts:


ActionScript 2.0 :: CS3 Sliding - When Running And Not Holding Keys Down Then The Friction Should Slow Me Down

Nov 12, 2009

when I'm running and not holding my keys down then the friction should slow me down. That works but the speed never stops at zero. I can't see him moving but I've put a text that draws his speed, because if the speed isn't zero and I'm not pressing any button then he will slide and that doesn't work look here: [URL]
The code in the player I use is:

[Code]....

View 1 Replies

ActionScript 2.0 :: Friction Equations - Tweaking The Friction Constasnt?

Nov 10, 2007

I have a billiard ball system, whic detects collisions between balls and modifies their x and y velocities accordingly.I have included a friction variable and I have a very basic system for applying the force of friction for each iteration of movement:

private static var FRICTION:Number = 0.94;
public function move() : Void[code]....

This works to a reasonable level of satisfaction, but it doesn't quite feel right. The balls seem to take just a little too long to stop when they've slowed down to a very small velocity. I've tried tweaking the friction constasnt, but I still can't get sometthing that feels exactly right.

View 3 Replies

ActionScript 3.0 :: Wrote Equation - Get Slow In Running When Function Reach Higher Degree?

Aug 23, 2010

I wrote it through the equation (n, k) = n!/(k!(n-k)!).But I found it will loose precision quickly after 12th row.So I change the way. I tried to use the properties of triangle(each row is the sum of previous row)Than I get slow in running when function reach higher degree.
I just keep changing a little and a little... try to make it run faster.

Quote:Function binCoef(70) :

1,70,2415,54740,916895,12103014,131115985,11987747 [code]..

View 0 Replies

ActionScript 2.0 :: Setting The Depth Of A Nested Object Higher Than That Of A Non-nested Object?

Jun 24, 2005

As the title says, i would like to have an object which is nested beneath another objects depth set higher than that of one the is NOT nested. Is this possible if so how, may be real easy and im just over-looking it but

View 1 Replies

ActionScript 3.0 :: Math Friction Over Time

Aug 19, 2010

I'm used to applying basic friction like this:[code]The problem is I don't know how to convert this to be described over time, so that can reduce the value based on the amount of time that has passed.Say I want to reduce the value to compensate for 1 second passing, or 500ms? How does that work in to the equation?

View 9 Replies

ActionScript 3.0 :: Loader Object Very Very Slow?

Mar 3, 2009

I've been using the following image class (feel free to use it ) for quite some time now... but recently it's been working very very slowif i do a var test:Afbeelding=new Afbeelding("test.png");and test.png=4 Kb in size, then it takes up to 2-3 seconds before it appears on my screen, also it takes that long before i can get the size or so... so var test:Afbeelding=new Afbeelding("test.png");trace(test.width);on't work..I don't think i changed anything to my class... but if somethings missing or if somebody knows where the problem is.o fixit

class Afbeelding:
package
{

[code].....

View 6 Replies

Slow Down An Object That Have Rotating CW 1 Time?

Aug 16, 2010

Without adjusting the fps how would I slow down an object that I have rotating CW 1 time?

View 4 Replies

ActionScript 3.0 :: Alternate Keys To Speed Up - Friction

Apr 23, 2009

I'm attempting to make a racing game. I want to make it so the user has press two other keys alternately in order to speed up. While the user is not pressing those keys the player should slow down gradually. I'd also like to add friction. Right now, I have code for basic movement:

[Code]...

View 1 Replies

ActionScript 3.0 :: Friction Increase As Distance Decreases?

May 10, 2010

I for the life of me can't figure out this simple equation that I want for a camera-following function.As distance decreases, friction increases.Friction being a number between 0 and 1, where friction = 1 is no friction.

View 2 Replies

ActionScript 3.0 :: Slow Down And Stop Spinning Object At Random Angle?

Mar 1, 2009

trying to implement a "wheel of fortune"-like activity in AS3.Here is what I have so far: [URL]The script for this spinning mc is super simple:

Code:

var speed:int = 10;
NoPolicy.addEventListener(Event.ENTER_FRAME, wheelRoll);
function wheelRoll(event:Event):void

[code]....

What I would like to do is have the rotation run for, say, 2 seconds and then slow down and stop at a random angle.

View 1 Replies

ActionScript 2.0 :: Friction Swinging - Stars Hanging By Strings From The Top Of Flash Document

Dec 19, 2005

I have an idea for something at work. I want to have stars hanging by strings from the top of my flash document. if the user mouses over these stars I want the star to lightly swing in the direction the mouse went over at. Almost as if you had a cardboard star hanging from the ceiling and you tapped it with your hand. I know this probably includes friction but my tests don't seem to work out the way I want. Does anyone know how to achieve this?

View 8 Replies

Use 40 FPS Or Higher?

Nov 14, 2009

I dont understand why a simple vector mc TWEEN ANIMATION isnt smooth.Here is an example. I use 30 FPS and I dont want to use 40 FPS or higher.

View 1 Replies

Php :: Overwrite Entry Only If New One Is Higher?

Jun 6, 2011

I have table named "highscore" like this:

nameQL scoreQL
piotr 50

And flash game with NAME and SCORE exported to PHP with this names.How to make this in PHP file:

IF (NAME exists in database (nameQL)AND SCORE> this.name.scoreQL){Raplace scoreQL with SCORE WHERE nameQL=NAME}

IF (NAME doesn't exists){Create new row with NAME and SCORE)

View 1 Replies

ActionScript 3.0 :: Add A Child Of Index 2 Or Higher?

Mar 3, 2010

I'm working on a project conversion from AS2 to AS3.
 
In AS2, I used a mainMenu file and loaded a Navigation file at _level 999 (very top). Then I loaded and unloaded different modules on _level 5.I also loaded and unloaded an external Glossary file on _level 95.Now in AS3 I am using AddChildAt(1) for the Naviation file and AddChildAt(.1) and removeChildAt(.1) for the module files. The Glossary file only seems to work at Child Index 1, so I'm guessing it pushes the Navigation file to a higher index. Is there a reference that explains the Index properties of the Child and why sometimes I get an error when I try to add a Child of Index 2 or higher?

View 3 Replies

Actionscript 3 :: MovieClip Higher Than Set Mask?

Apr 9, 2011

I have a movieclip with a prefilled content (some simple vector graphic in a movieclip), with the height of 40. I then apply a mask to it, with the height of 30. Now i would think that the MovieClip is 30 pixel high, but it turns out to be 40 pixel high. Is there some property im not setting or does the movieclip always assume the height of ALL the content within it? or what?

Actually in another clip, too, I have predefined 2 vector graphics (in two seperate movieclips), where the highest one is applied as a mask to the second graphic. The movieclip again assumes the height of the highest element. That might be logical, as it is the mask, BUT! when i then resize my mask (programatically) the height of the movieclip remains the same.Is there some way to recalculate the height of a movie clip? Or am I missing something?

View 1 Replies

ActionScript 2.0 :: Volumen To Be Higher Than 0 When The Swf Is Loaded?

Oct 21, 2005

I would like the volumen to be higher than 0 when the swf is loaded, so that music can be heard without the need of dragging the volume...I've tried to set the dragger in the middle of the slider but still the actual sound is 0 at start.

The code is as follows:
this.ratio = 0;
dragger.onPress = function() {

[code]....

View 4 Replies

ActionScript 2.0 :: Which Movieclip Is At A Higher Level

Dec 23, 2006

If I have 2 movieclips, how can I know through actionscript which one is at a higher level?

View 2 Replies

Flex :: Check If An Integer Is Going Higher Or Lower In AS3

Apr 29, 2010

I'm trying to make a script that listens to a variable (int or Number) and then does certain functions whether the variable is going higher or lower. So for example if the number gets higher, it runs one function. If it gets lower, it runs another.

View 3 Replies

Actionscript 3 :: Function Won't Accept Any Number Higher Than 4?

Nov 16, 2010

you know any reason why a function won't accept any number higher than 4? This is all I'm doing. Works for 0-4, but once I hit 5 or higher, I get "A term is undefined and has no properties." But if I just put the number 5 in there, it all works just fine, so it's not an issue with the xml.. for some reason the function just won't accept anything higher than 4. weirding me out..... I can't see an explanation for it.

[Code].....

View 1 Replies

Flex :: Bitmapdata - Save Image With Higher Dpi?

Jun 14, 2011

In Flex, I am using graphics.codec.JPEGEncoder to save image files that are edited inside application (normal manipulations like brightness etc.) I am able to save files perfectly. What I want to know is that is there any way I can save the image with a better dpi? Say, for instance the image that is loaded and manipulated was originally of 72dpi, now can I save it with a dpi of 150 or 300 ? If so, how to do it.

Doesn't have to be using the JPEGEncoder, if there's any way to do it at all, like using any library etc, I am okay with it.

Note: If it matters, I am using Bitmapdata to store the image and manipulations and saving the image with JPEGEncoder by supplying it's data as bytearray like below.

var imageBytes:ByteArray = encoder.encode(myBitmapData);

View 1 Replies

Actionscript 3 :: SWF Has Higher Framerate Than Specified In Compiler Arguments

Sep 14, 2011

I compile a SWF with ANT using FDT. In the compiler arguments I am setting default-frame-rate to 30. When I run the SWF, the stage.framerate property is 30 (which is correct), but as the Stats util from mrdoob shows, the SWF runs way faster up to 52 fps.So it seems the compiler argument default-frame-rate is applied, still the events are fired at a higher rate.[code]

View 1 Replies

ActionScript 2.0 :: Check If A Number If Higher, Or Closer To A Value?

Mar 25, 2010

Is there anyway of using AS to check if a number is either higher than a certain value, or closer to a certain value. The purpose, if the number in the text box is either higher than the other text box, or closer to say, 500, than the other one, then, it displays something in a dynamic text box.

View 3 Replies

ActionScript 3.0 :: Display JPEGs With Higher Bit Depths?

Aug 23, 2010

I'm working on a medical imaging application and was wondering if there is a way to display 12-bit per pixel JPEGs in flash/as3? I'm assuming I'll have to convert the image into a more flash friendly format, but was hoping to avoid that as keeping the original quality of the image is vital.

View 3 Replies

ActionScript 2.0 :: Only Make The Higher Or Lower Numbers Available?

Jan 18, 2011

ok qiuck 1 how do make the random number generator start making as exaplme random numbers between 2 and 4. so it would select2,3,4 but o1 hope that makes sense

onEnterFrame = function(){
maths = Math.floor(Math.random() * 4);
trace(maths);

[code]....

View 1 Replies

ActionScript 2.0 :: Load Each New Movie Into A Higher Level Than The Last?

Jan 5, 2006

I'm designing a site at the moment & I've run into a minor snag. I am loading about five external swf's, for each page of the site, from the main 'home' page. you can view it here Trouble with levels. I can load the movies fine, but what I want is to load each new movie into a higher level than the last, as each movie appears with a mask (for an example have a look at the site I've done then click on the 'Contact Us' button - that is what I want to do on all of the pages...) all of the swf's are loaded into level one with the exception of the 'Contact Us' page. (By the way, there is no 'News' page yet)

The very simple code I used to load the movies is:

Code:
on (release) {
loadMovieNum("contact.swf", 2);
}

View 1 Replies

ActionScript 2.0 :: Detect If One Movieclip Has Moved Higher Than The Other

May 6, 2009

Am just a begineer with Actionscript but am picking up quite quickly. I been racking my brains and can't seem to find a solution. Basiaclly I've got 5 movieclips on the stage which are draggable. How can i get a message to appear in a text box if the first movieclip is moved higher than the second movie clip?

View 4 Replies

ActionScript 3.0 :: Bitmap Has Higher Index Than Sprite?

Nov 10, 2009

I've just switched over to AS3, and I'm completely stumped with something.

I'm working on a project where I keep adding children to a MC already on the screen. There are two types of these children: Sprites that I use to draw lines using moveTo, lineTo, ect. Then there's sprites that have children inside of THEM that are bitmaps.

For some strange reason, the Sprites with the bitmaps on them always have a higher depth/index (AS3 terminology is still weird for me) than the normal Sprites.

Here's a diagram of my MC/children/children layers:

---------------=> (Sprites that draw lines)
(MC on Stage) =>
---------------=> (Sprites that hold bitmaps) => (Bitmap)

View 6 Replies

ActionScript 3.0 :: Displaying JPEGs With Higher Bit Depths?

Aug 23, 2010

I'm working on a medical imaging application and was wondering if there is a way to display 12-bit per pixel JPEGs in flash/as3? I'm assuming I'll have to convert the image into a more flash friendly format, but was hoping to avoid that as keeping the original quality of the image is vital.

View 1 Replies

ActionScript 3.0 :: GotoAndPlay Frame On Higher Level?

Sep 18, 2010

I've got a button that, when clicked, needs to play a frame. Normally I'd just use the gotoAndPlay feature, but the frame I want to play is on a higher level than the button. That is to say that the button is inside of a few movie clips but the frame I want to point to is just in the main scene, not inside of movie clips

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved