ActionScript 3.0 :: Basic Physics Engine Including 1 Ball And One Solid Object?

Apr 8, 2011

Is there anyone that can write a really basic physics engine including 1 ball and 1 solid object?

So it should be 1 ball and then 1 solid object like a box. The box should be completely solid, the ball shouldn't be able to go through the box, it should just stop when hitting it at any angle.

View 13 Replies


Similar Posts:


ActionScript 3.0 :: Is Basic Physics Possible Without Physics Engine

Aug 29, 2011

I know you can add a var to add grvity and velocity ect. But what are the limits of this?Can i have a ball roll downhill using physics from within flash, without a external physics engine like box 2D.Can i have impulses? Well thats not important just wondering really.What can you do with physics in flash?

View 5 Replies

ActionScript 2.0 :: Build A Model With Physics Incorporated Without Physics Engine?

Feb 3, 2010

I wanted to study some physics code lines related to flash actionscript 2.0.Is there anyway to build a model with physics incorporated without a physics engine? By bare actionscript?If yes, can anyone show me a tutorial or an explanation to learn somehting about it, please?

View 0 Replies

ActionScript 3.0 :: Get Best Physics Engine?

Mar 9, 2011

I am in need for some 2D physics seen from "above and straight down". Basicly I can sum it up with a "throwing balls into walls" kinda physics.

There seem to be quite a few physic engines for as3 out there, but I wonder if anyone have anyone special to recommend regarding my particular need as well as performance of the engines.

View 9 Replies

ActionScript 3.0 :: The Right Physics Engine / Collission Detection?

Apr 15, 2010

Some time ago i played this great flash game I want to create a simple level where you can walk around, just like in that game. But i was wondering what kindof physics engine or collission detection i would need if you want to walk over hills or objects where the persons reacts to

View 2 Replies

Flash :: Get A Physics Engine Like Nape Working?

Jan 9, 2011

Introduction: I think Nape is a relatively new engine so some of you may not know it. It's supposedly faster than box2d and I like that there is decent documentation. Here's the site: [URL] I'm relatively new to programming. I am decent at AS3's basic functionality, but every time I try to implement some kind of engine or framework I can't even seem to get it to work. With Nape I feel I got a little further than before but I still got stuck.

My problem: I'm using Adobe CS5, I managed to import the SWC file like described here. Next I tried to copy the source of one of the demo's like this one and get it to work but I keep getting errors. I made a new class file, copied the demo source to it, and tried to add it to the stage. My stage code basically looks like this:

[Code]...

View 1 Replies

Actionscript 3.0 :: Find A Water Physics Particle Engine?

Jun 3, 2009

where i can find a water physics particle engine.

View 2 Replies

Flash :: Physics Required To Make A Basic Weighing Scale?

Dec 15, 2010

Okay so I need to make a basic activity (working Flash/as3) that simulates very basic weighing scales. All the objects that go on to the scales are the same weight.

If you imagine the classic weighing scales [URL]..we are dragging/dropping stuff on to the sides and animating accordingly.

I don't want anything fancy, just the maths required to affect the scales according to how many objects are on each side.

What I'm looking for is probably the angle of rotation of the horizontal arm. Any pointers?

View 3 Replies

ActionScript 3.0 :: Pool Ball Physics With The Boundary Be A 3d Sphere

Nov 11, 2009

I'm creating a ball bouncing in 3d. My problem is that I have a square boundaries. top,bottom, front, back. I tried get the the distance ( of the sphere/radius) but went I * vx , vy , vz by 1 or -1. One of the position is - while the other two might by positive. I need pool ball physics with the boundary be a 3d sphere.

View 9 Replies

Actionscript 3 :: Stop And Reset Wheel Particle - Physics Engine (APE) (latest Trunk)

May 16, 2011

I'm trying to create a simple disappearing action when a WheelParticle hits a special disappearing CircleParticle. Normally the WheelPartical bounces off of a bunch of other CircleParticles, but when the WheelParitcal collides with this CircleParticle, the action Pauses, an animation plays, and when the action resumes, many surrounding circle particles have dissappeared.

The problem is that the WheelParticle needs to just drop from a complete stop, but it continues as if having just bounced off of the, now non-existant CircleParticle.
I'm having trouble clearing out the forces. I've tried init(), addForce() and changing .velocity amoung other things, but it keeps wanting to continue the lateral bouncing movement. I'm using the latest trunk version of APE in order to capture Collision events for sound.

[Code]...

View 1 Replies

ActionScript 3 :: Ball Physics (Fast Move And Small Objects On Path)

Mar 31, 2012

After read a lot about ball physics, watch some examples and few days of trying making pinball with bitmaps, I use simple (easy to work with) and fast performance Physics AS3 engine for bitmaps [URL] but still cant fix problem: if ball is moving too fast and object on path is too small, there will be no collision detection (code works perfect only with bigger objects or if ball is moving slower). I am not good at physics and maths. Here is function code which make physics for ball on every frame rate (but maybe its better to change it to setTimeout):

function showFrame(e:Event) // onEnterFrame{
var collisions:Array = collisionlist.checkCollisions();
if(collisions.length) // if collision{
var collision:Object = collisions[0]; // get collision information
var angle:Number = collision.angle; // get collision angle
[Code] .....

View 2 Replies

Professional :: Open-source Physics Engine For Simulating Celestial Mechanics/planetary Orbits?

Jul 19, 2010

I have APE, but I'm not sure I can effectively utilize it for this project. Box2D seems popular, as do WOW and some others but I'm not sure which would be best for simulating celestial mechanics. The physics I need are essentially those used in the classic two-body problem.

View 1 Replies

ActionScript 3.0 :: Vector Addition (Physics) - Move Ball Towards A Specific Angle And Magnitude?

Jun 28, 2010

Say for example I have a ball and I would like to move it towards a specific angle and a specific magnitude I would use something like:

[Code]...

Now if I wanted to change this force, for example, add a force to it, say, with magnitude 0.5 and angle 20, how would I do that?

View 2 Replies

ActionScript 3.0 :: Collision With A Solid Object?

Mar 30, 2010

I am currently creating a game in which the character is stationary in the middle and the world moves in relation to the character. When the character is not moving and not touching anything, I need the world to shift upward to meet the character and stop on collision detection. The problem is I have no idea how to conceptually make this work.

making assets "fall up" and stop when colliding with an object (basically reverse gravity).

View 2 Replies

ActionScript 3.0 :: Getting Display Object Dimensions Including Transparent Areas

Dec 20, 2010

I'm having troubles getting the dimensions I'm looking for for a given display object. This display object has some transparent area to the top-left of the opaque content but to the bottom-right of 0,0. As such, the display object's reported width ONLY includes the opaque area, not the transparent area. For example:

Code:
var myChild:Sprite = new Sprite();
myChild.graphics.beginFill(0xff0000);
myChild.graphics.drawRect(100, 100, 100, 100);
myChild.graphics.endFill();
trace(myChild.width);

This reports 100 as the width and height. I need to somehow retrieve 200 as the width and height.

I'm trying to take a bitmapdata snapshot of the display object, but when I do new BitmapData(myChild.width, myChild.height) and then draw into it I don't get the full opaque content of myChild drawn because the dimensions are too small.

View 3 Replies

Actionscript 3 :: Clone An Object Including Copying The Event Handlers/listeners?

Apr 15, 2010

I want to clone an object of a class (whose source code I do not have) and copy all of the associated event handlers from the original object to the new cloned object. Does anyone know how I can do that? I know how to copy the properties from the original to the new, but can I iterate over all the event handlers and add them to the new object?

View 1 Replies

Media Server :: JavaScript Engine: How Many Properties Is Too Many For An Object

May 6, 2010

I know the engine is derived from Mozilla SpiderMonkey. I am using an object which properties are IP addresses, i mean literally, as in: object["123.456.789.012"] The object is a map of banned clients. The number of properties approaches several hundreds. I wonder if this is a strain on the engine in any way? The reason I use this is because property lookup is just about the fastest thing you can do, as opposed to say an array with indexes and ip addresses as values, which would be an O(n) operation when doing lookup.

View 1 Replies

IDE :: Bouncing A Ball Off A Wall Object

Apr 26, 2010

I have created a flash AS3 file with two movieclips. One is a ball (ball_mc) and a wall (wall_mc). The ball bounces around off the outer walls of the stage, in horizontal lines.

The ball also changes direction if it bounces off the wall. However its not bouncing off the wall in the right direction?

Code:

var dx:Number=3; //the amount the ball will move horizontally each frame
var dy:Number=5; //the amount the ball will move vertically each frame
this.addEventListener(Event.ENTER_FRAME,moveBall); // call the function moveBall every frame

[Code].....

View 6 Replies

ActionScript 2.0 :: Make A Ball Bounce Off Something Like A Ball Bouncing Off A Bumper In A Pinball Game?

Jun 20, 2006

i wanna ask how do i make a ball bounce off something like a ball bouncing off a bumper in a pinball game? i've tried a lot of times but everytime the ball get stucked to the box and it doesn't move anymore...will be grateful if anyone noes the actionscript of it..

View 3 Replies

ActionScript 1/2 :: Bouncing Ball - Move Object Using Arrow Key

Aug 19, 2009

I'm using the actionscript below to Move Object Using The Arrow Keys and it works fine but I want to modify it so that when I press the up key it goes to and play a movie clip. Basically it's a ball movie clip that responds to the arrow key but on the up key it plays a bouncing movieclip and everything remains aligned.

Here is the script-
var speed =5;
this.onEnterFrame =function(){
if(Key.isDown(Key.UP)) {
circle._y -= speed;
} if(Key.isDown(Key.DOWN)) {
circle._y += speed;
} if(Key.isDown(Key.LEFT)) {
circle._x -= speed;
} if(Key.isDown(Key.RIGHT)) { 
circle._x += speed;
}};

View 13 Replies

ActionScript 2.0 :: Setup A System Where A Ball Would Bounce On An Object

Feb 10, 2006

In the process of making a pinball game, i wanted to set up a system where a ball would bounce on an object, and eventually come to rest on it. Everything works fine, but eventually the ball just goes through it instead of coming to rest on top of it. I do not understand why this happens, and would like to know if there is anything i can do to fix this. The .fla is attatched.

View 4 Replies

Actionscript :: Pushbutton Engine EventSoundTrigger - Sound Object Is Null When The Component Is Created

May 11, 2011

I'm running into some issues using EventSoundTrigger in Pushbutton Engine I am able to make it work using xml like this:

<component type="com.pblabs.components.basic.EventSoundTrigger" name="Sounds">
<startSound filename="/assets/explosion.mp3" />
</component>

But if I try to write actionscript to do the same I throughs errors. I can't find any examples online to explain how to initialize or use EventSoundTrigger directly in ActionScript. The following throws an error that the sound object is null when the component is created. I figured it out here's the answer:

[Code]...

View 1 Replies

ActionScript 3.0 :: Ball Collision Inside Another Ball Using Gravity?

Jun 5, 2009

ball collision inside another ball using gravity.I have one large circle in the middle of the stage (its radius is 150 pixels). I have another circle inside of that one (20 pixels radius), this is the smaller ball that I would like to have bounce around inside of the larger one with gravity. When the small ball hits the edge of the larger circle, I would like it bounce inwards to the center of the larger circle. It keeps doing this until it eventually stops in the center of the larger circle at the bottom.

View 1 Replies

ActionScript 2.0 :: Object Oriented - Apply A Movement To Each New Ball Created

Mar 19, 2007

I am dynamically creating a movieclip, say, a ball. I want to apply a movement to each new ball created. I have created a movement function and now I need to know how to use this function as a method on each newly created ball. Would I do something like this:

[Code]...

View 2 Replies

Professional :: Move The Object "ball"based On This Potential Requires That Script?

Mar 11, 2011

suppose one has two buttons "left" and a "right ".the 'left' moves to the leftand the "right" to the rightand the goal is to move the object "ball"based on this potential requires that script to do this?

View 1 Replies

Professional :: Solid Red Box In SWF?

Apr 5, 2010

I am making a flash video game. You will have control of a spaceship that is going to go to space. I made a 550x30,000 JPG file in photoshop to use in flash as the background for the game. 30,000 pixels is about what I need to make a good scale of the earths atmosphere because earths atmosphere is about 36,000 feet high and I was goign to use a scale of 1 pixel = 1 foot.

When I import the jpg to flash and test the movie instead of my background all I see a a plain red box in the movie window. It fills the whole stage. This led me to think that there could be a pixel limitation. If so what are the limitatoions and how can I get around them?

View 11 Replies

ActionScript 3.0 :: Make A Circle Object Movie Clip Call Ball And Make A Rectangle Object Movie Clip Call Mc

Dec 12, 2010

make a circle object movie clip call ball and make a rectangle object movie clip call mc and paste this coding.

[Code]...

can anyone explain about the movement about D? the D is talk about the distance if i go -X,way my ball go ++ to +x?

View 1 Replies

ActionScript 2.0 :: Fading A MC As A Solid?

Dec 16, 2007

I have a few movieclips that I am fading out alpha with actionscript

The problem is the MC is not a solid shape, it has layered shapes in it, so you can see all the shapes within it fading indivually

Is there a way of fading an MC as if it were a solid (bitmap?)

Is there an easy way of converting a vector mc into a bitmap in actionscript?

View 5 Replies

ActionScript 2.0 :: Possible To Make Objects Solid?

Dec 27, 2010

I've trying to make blocks solid so my character can walk across the blocks and not go straight through it ive looked around for around 12-13 hrs at the moment and im still stuck.

View 1 Replies

ActionScript 3.0 :: Drawing API - Solid Overlap?

Feb 15, 2007

I'm trying to simply draw a solid shape consisting of various other shapes, however, when I overlap two shapes, the overlapped area becomes transparent again. For instance:

Code:
var myShape:Shape = new Shape();
myShape.graphics.beginFill(0x000000);
myShape.graphics.drawCircle(10, 10, 25);
myShape.graphics.drawCircle(20, 10, 25);
myShape.graphics.endFill();
this.addChild(myShape);

The above code is AS3, but I believe the same thing happens for AS2 as well. The overlapping area between the two circles is not clack.

View 1 Replies







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