where to find a good throwing script? Not the kind with the lame ball that drops the the floor, I mean the kind where you can throw something and it bounces of walls and spins like a airhockey puck?
I worked on a new Flash project, but I cant seem to find a good solution for how I want my objects to collide. In my project I have: a Ball(moving object) and a Floor(not moving).
The ball is positioned over the floor and drops onto the floor through the gravity that is applied with the code.
[Code]...
Is there a way to have a global gravity in flash AS3. In which you could choose what objects you want to be affected by it? Is there a way to have a block of code that separates moving from still objects and will not let any objects collide(not overlap)?
In my project I have: a Ball(moving object) and a Floor(not moving).The ball is positioned over the floor and drops onto the floor through the gravity that is applied with the code.
[code]....
First: the -23 in the code is what I don't like. Second: every single object that deals with collisions would need to be put into the if statement.Is there a way to have a global gravity in flash AS3. In which you could choose what objects you want to be affected by it?Is there a way to have a block of code that separates moving from still objects and will not let any objects collide(not overlap)?
In my project I have: a Ball(moving object) and a Floor(not moving).The ball is positioned over the floor and drops onto the floor through the gravity that is applied with the code.
Code: var gy:Number = 0; var gravity:Number = .2 function ballMovement(event:Event):void{
[code]....
First: the -23 in the code is what I don't like.
Second: every single object that deals with collisions would need to be put into the if statement.Is there a way to have a global gravity in flash AS3. In which you could choose what objects you want to be affected by it?Is there a way to have a block of code that separates moving from still objects and will not let any objects collide(not overlap)?
referring to Pom's tutorial on gravity (up and down), I was wondering how to alter the code to make it so that the object moved and bounced along the x-axis. I tried this:
Code: onClipEvent (load) { gravity = 2 ; // We get the time when the ball is released for the
I am using Box2d 2.02, and am having trouble with setting linear velocity of a body in 0 gravity. When I trace GetLinearVelocity() when left is pressed, it reports the correct vector (-20.0, 0.0) but the body does not move. It is a dynamic body.
Code: if (Key.isDown(Keyboard.LEFT)) { if (mover.IsSleeping()){ mover.WakeUp(); } mover.SetLinearVelocity(new b2Vec2( -20.0, 0.0)); }
I'm making a game were parts of the level are randomly generated and move across the screen and while I have made it so all that works correctly I am having trouble running a hittest on them to allow for gravity. Below is the piece of code attached to the player movieclip that I think is causing the issue (shortened for sake of space)
I am creating a flash animation for my physics class. I am demestrating free fall. I know how to create a free fall object, but how would I make it so that the user can change the gravity?
check this code onClipEvent (load) { k = .2; damp = .9; grav = .1; } onClipEvent (enterFrame) { ax = (_root._xmouse-_x)*k; ay = (_root._ymouse-_y)*k; vx += ax; vy += ay; vy += grav; vx *= damp; vy *= damp; _x += vx; _y += vy; } tell me where am i going wrong??? cos after giving the code to mc its not responding in any terms except the drag and drop to the invisible button.
i have a game where fish fall out the sky and a penguin on ice skates has to catch them before the fish get to heavy for the ice, the ice cracks and the ice skating penguin falls into the water and freezes. I have all the code but cant work out how to set the random location along the Y axis for the fish to fall. I have a gravity script but cant work out how to include the random position for the fish. There are 30 fish and i want to be able to have one fish fall wait a half a second and have another fall and so on....until all 30 have been dropped...
I want to do gravity effect on a ball . I found some thing do this but I need to make the ball goes to the floor direction actually I want it to follow the sloping of the floor with the gravity effect .
I'm trying to find a way to do a cable in papervision(great white) that has the behavior(gravity and elasticity) like the following two links:url... Any clues as to how should I approach this?
I need to access the elements of an array that is declared in the main swf(_level0). But I need to change it from another swf.How can I do it??So far I have this:
MAIN SWF:
var vector1:Array = [biblio_vid1, biblio_vid2, biblio_vid3, btn_1_4, biblio_vid4];
OTHER SWF:
var vector2:Array = _level0.vector1.slice(); trace(vector2); // undefined,undefined,undefined,undefined,undefined
I'm creating a map in flash and I would like to have a smooth movement similar to this:[URL]..i have made a start but I'm having trouble taking it to the next stage.
My code currently throws the movieclip after the mouse is release but there is no easing while the mouse button is down.
I'm trying to make a button draggable and also throw it across the screen. I know that I have to use the mouseDown and mouseUp options for the button, but could someone explain a method for allowing me to drag it and then throw it? In other words, it should keep going after mouseUp.
Code: var spring:Number=.1; var frizione:Number=.98; var gravita:int=1; var limite:Number=stage.stageHeight; stage.frameRate=31; var colorsArray:Array = new Array(); [Code] .....
I've made a character, and used the bone tool to make it move in runtime.This works fine, but now I want to add gravity/physics, so I can throw my character and it lands on the ground like a real ragdoll. How do I do this in actionscript 3 ? And is it possible to do this within the fla (no class file).
i designed a ball that falls down in soft place and goes under the eart ...when we carry this ball uper ...ball goes more under the eart...i make this ball dragable and with varible speed=..... &...&...make this ball.but may metod its not good.and not works correctly.
how to set boundaries for the y coordinates of a falling box with gravity. i am using the gravity AS, and i could not find a specific tut for setting the floor boundary.
I am in a pinch for time and know very little about Flash and even less about Actionscript, but I need to know how to make a ball fall according to gravity!
Thomas <a href="mailto:ttorrey@slc.edu">ttorrey@slc.edu</a>
I have a file where two objects fall from the top of the stage and bounce and then eventually stop (using gravity and hit test). You can grab the objects (a ball and a box --- each has a button symbol n the movie clip) and toss them and they bounce off each other and off the 4 sides of the stage. The issue is when one of the objects is dropped directly on top of the other object, after it stops bouncing, it slides down until it hits the bottom of the stage (in this case, the box slides down in front of the ball, and the ball slides down in back of the box).
i works on phisic project...(learning phisic for childs)...i designed a ball that falls down in soft place and goes under the eart ...when we carry this ball uper ...ball goes more under the eart...i make this ball dragable and with varible speed=..... &...&...make this ball.but may metod its not good.and not works correctly.
I am trying to create a drag and throw effect I have most of the effect working correctly but I am wondering how to only move one item at a time and have that thrown unaffected til the friction brings the item to a stop. what happens currently is if an mc is moving and you select another it moves both items.
Code: var mx0; // Previous Mouse X Position var my0; // Previous Mouse Y Position var velocityX = 0; // Velocity in X Direction[code]...................
I need to access the elements of an array that is declared in the main swf(_level0). But I need to change it from another swf. I have this:
MAIN SWF: var vector1:Array = [biblio_vid1, biblio_vid2, biblio_vid3, btn_1_4, biblio_vid4]; OTHER SWF: var vector2:Array = _level0.vector1.slice(); trace(vector2); // undefined,undefined,undefined,undefined,undefined
I'm a total beginner trying to do some basic navigation using AS3.I was following along a lynda.com tutorial and being careful not to have any syntax errors but for some reason it just won't work.The trace function doesn't work and I'm also getting this error message.[code]
I'm developing a flex application and I want to access a component by using it's id. I know I must use .property of the component. The problem is I have the component Id in a String var and now I don't know how to access to it's properties.