Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Bike Physics Tutorial



Hi,

I’m looking for a tutorial that explains a little of the physics they used on those games:

http://adrenaline-challenge.freeonlinegames.com/
or
http://www.teagames.com/games/bmxbackflips2/play.php

Does anyone knows any? I’m having particular hard time on coding for 2 wheels. I found several tutorials about one wheel, and also coded a “one wheel” game myself, but how do I make it for 2 wheels?

Thanks for any help,
--Malu



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 11-16-2005, 04:41 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Looking For A Physics Tutorial
I'm looking to create an effect that mimics a piece of string that is attached to two objects that are moving. Anyone know of a tutorial that could demonstrate something like this?

I Need A Realistic Physics Tutorial
I want to learn about throwing, bouncing, collision, and gravity.
Do you know of any good sites or tutorials I can see?

I Need A Realistic Physics Tutorial
I want to learn about throwing, bouncing, collision, and gravity.
Do you know of any good sites or tutorials I can see?

FK Tutorial Probs (Math/Physics)
I'm trying to create the effect where you have some eyes that follow the curser around the screen. The eyeballs should basically just rotate or move around the eye sockets. I know theres a tutorial for this on FK but I preferred the 'magnetic rotating pointer' (which I can't seem to find again at the moment).

The problem is that the pointer works by rotating towards the mouse perfectly when published in it's own document but if I load the movie in from another file (into a blankMC)it stops working in the browser (still works in the F.Player tho!!?)

Here's the code:

//this goes in the blankMC called 'mouse'

onClipEvent (load) {
startDrag (this, true);
}

//this goes in the pointerMC called 'move'

onClipEvent (enterFrame) {
mouse_x = int(_root.mouse._x-this._x);
mouse_y = int(_root.mouse._y-this._y);
if (mouse_x>0 && mouse_y>0) {
quad = Number(4);
}
if (mouse_x<0 && mouse_y>0) {
quad = Number(1);
}
if (mouse_x<0 && mouse_y<0) {
quad = Number(2);
}
if (mouse_x>0 && mouse_y<0) {
quad = Number(3);
}
abs_x = Math.abs(mouse_x);
abs_y = Math.abs(mouse_y);
tg = abs_y/abs_x;
_root.maths = Math.atan(tg)*Number(180)/Math.PI;
if (quad == 1) { angle = number(90) - number(_root.maths) }
if (quad == 2) { angle = number(90) + number(_root.maths) }
if (quad == 3) { angle = number(270) - number(_root.maths) }
if (quad == 4) { angle = number(270) + number(_root.maths) }
setProperty (_this, _rotation, angle);
}


What happens when loaded in from another movie and played back in the browser the arrow moves slightly then freezes up completely.

Can anyone help me with this problem? I tried putting an absolute link on the mouse_x and y lines but no use.

Thanks.

Bike Game
How would i make a bike trick game thing
eg , you race along (side view) then you jump off ramps and crash into bins and jump and do tricks, and have a bar showing your energy

Bike Gamee
I am really new at making games with flash. I wanted to try and make a game with a dirtbike (or bike) that goes over jumps and do things like that. The language is just too hard for me and I couldn't find anything that suited my needs. I was just wondering if someone has or knows where I can get the .fla or source code for a game like this.

Pedaling A Bike Anim
Hi there everbody

Does anyone know where I can find a tutorial on ...I'm not sure what this would be called...articulated motion? relative motion? I am making an animation of a guy riding a bike. The user inputs the gear to change his pedaling speed.

I can make the wheels change speed and the gears change speed and size.

I don't know how to fix his foot to the rotating pedal circle, with a fixed hip point and the knee moving appropriately inbetween.

If anyone can point me in the right direction that would be fabulous!

Thnx!!!!

Making A Website To Help With Choosing The Colour Of A Bike - Please Help Me :D
Hello I am trying to make a website where you can take conponents of a bike and change their colour

there are about 17 conponents that I want to be able to change the colour of e.g. frame colour and seat colour.
and I want to have 10 - 20 colours

the number of combinations would be huge, so to have that many pictures, with a link to each is probs not the best solution by far.

I was planning on having a more interaction site, where when a colour or conponent is selected, it changes in front of you - any ideas how I could do this?

prehaps a simple solution would be to have a range of buttons, that when selected display a different coloured conponent - how do I make a button that when pressed reveals say a coloured box and doesnt dissapear when the mouse is moved away from the button - is this the hit feature? if so how do I make it work!?

Any help would be fantastic

Simon

Bike Lock, Slot Machine Effect
Looking for a little guidance for a dynamic text field and a mask, to set it's value from 0 to "x" by scrolling/rotating/dialing up from 0 to the actual set value (100 max). I don't even know what to call this affect. The slot machine affect is a good way to think about it. Maybe the lost countdown timer, but counting up of course. The time duration should be pretty quick though. I also don't need real 3D here, just a semi-blurry count-up to the appropriate value.

So any ideas here? Something to get me started at least...

Thanks

PS-This is the page it would go on. Affect would be for the DSS Sales Percentage field.
flash page so far

Help With Physics
Hey Everyone,

Need help with programming an acceleration curve. Basically I want to move an object back and forth, with easing in and out and the ends. Basically the acceleration curve is that of a "U". I'm aweful at math, can someone please give me a hand with this one, and kinda ASAP.

Thank you

Car Physics
Can anyone please give me an example of car physics? I looked at some at Outside Of Society, but they were kinda... swervy.

Thanks,
Scott

Physics
Ok...heres the thing...I am currently making a game, and I thought it would be kind of cool, and ALOT better if I could add some realistic physics.

So i was wondering if anyone would be able to point me in the right direction or tell me how I can make physics for my game, alike in this game:

http://www.teagames.com/games/bmxbackflips/play.php

Any help would be highly appreciated.

Thnx alot - SecondComing114

[F8] Physics Help
i need help making a game like linerider
so making an object that doesn't go through another object but it can slide across it, with gravity.

any help???

Thanks

-Freaky

Help With Physics
Hey, I have some questions on using physics in flash that no one can seem to answer. I'm pretty new to action script and I've written the following code:


Code:
onClipEvent(load)
{
dY = this._y;
t = 0;
toff = 0;
v0 = 0;
v = 0;
aY = g; //g is a defined global
}
onClipEvent(enterFrame)
{
if(this._y > floor) //floor is a defined global
{
toff = getTimer()/100;
v0 = -v;
dY = floor;
}

t = getTimer()/100 - toff;
this._y = dY + v0*t + 1/2 * aY * t * t;
v = v0 + aY * t;
}
For some reason the ball keeps bouncing higher and higher each time but there's no reason for it to do so. Also, I found that I had to use dY as an intermediate variable b/c just saying this._y += wasn't working and I don't know why. If you can help me figure out whats wrong with my code that'd be great. Please don't just give me alternate code.

Ps sorry for cross posting, I was hoping to get some new input

[F8] 2d Box Physics?
Yeah anyone got any good tutorials for 2d box physics e.g. Box hits barrier at angle and encorperating gravity and air resistance it follows the correct tragectory and lands. I need them for a game think 2d Half-Life.

[CS3] 2D Box Physics, Help
Hi I'm now attempting to simulate physic upon polygons such as quadrilaterals.

Such as aligning them selfs to the surface, gravity, rotation etc.

Starting simply how would I get a box 25x25 to align to the surface it sits upon after being dropped with gravity. In AS2.

Air Physics (again)
I want to thank the Moderators for their quick responce to my last post and for keeping and eye on the forums, but it was moved to an improper section in the forum so i need to post it again.

I need to know the ACTIONSCRIPT coding to make my project work.
so, here is the post again.


Quote:




So, ive no idea how to even begin this so im hoping someone could help me out with it.

If you look at the SWF its pretty apparent what im looking to do. (please keep in mind i kinda just THREW the swf together for this post so its not amazing yet)

Aaaanyway, Id like the glass ball to float as if its being blown from underneath by an air vent. Im sure it can be done! I hope its not too increadibly hard. I just dont know my physics programming!

Thanx in advance for everyones help

Physics?
Hello everyone. I'm making a flash game that involves physics.

Okay, so whenever I press the spacebar button, the ball should goto the mouse position (slowly, not at once) and then if I let go of the spacebar, the ball will continue in the direction it was going (passing the mouse cursor). But I have no idea how to do this!

So what I want to have is:

- When SPACEBAR is pressed/held, a ball appears at a specific x,y point. And however long you hold spacebar is how far the ball will go towards the mouse.

-Then the ball will curve down and hit the ground.

I have this code so far so the ball will goto the mouse pos slowly when spacebar is pressed:


ActionScript Code:
function moveBall() {
var diffx = _root._xmouse - Balloon._x ;
var diffy = _root._ymouse - Balloon._y ;
if (Key.isDown(Key.SPACE)) {
Balloon._x += diffx / 5;
Balloon._y += diffy / 5;
}
}
But when I let go of the spacebar, the gravity just comes into effect and just makes the ball go straight down on the Y axis in a straight line.. And it looks stupid :P.

If ANYONE could help, it would be great.
Thanks.

Physics Api?
does anybody know of a good physics api for flash? I know there's some stuff for director, but I need to be working in Flash 4. Any ideas?

thanks
em

Physics AS
i need the AS for numchakus to swing, and have a weight that points downward from the fixed pivot point, thanks for the help

Help With Physics Pls
ok, im making the escape pod phyics for my game, ive got everything working fine, execpt one little complex bit, i need the physics to be realistic in that once u give thrust in one direction, u get momentum, and therefore to go the opposite way,u must give thrust to cancel out ur momemtum to go fowards again, get it? what happens that the mo is, u accelerate all fine, but can change direction instantly!
download FLA here

Physics Help
Alright so I have this code for throwing/dragging for movieclips. All i want is for the mcs not to spin as much. I realize this is some crazy long code that I don't really understand so if no one can do it...so be it

here it is in action www.radioactivechimp.com/ChimpPages/Newsite.htm


Code:
MovieClip.prototype.declareToRotate = function()
{
this.mode = "release";
this.x = this._x;
this.y = this._y;
this.r = 0;
this.draw();
topDepth = 500;
this.onPress = function()
{
topDepth = topDepth + 2;
this.swapDepths(topDepth);
this.moveControl("click");
}
this.onRelease = this.onReleaseOutside = function()
{
this.moveControl("release");
}
}

MovieClip.prototype.moveControl = function (option)
{
var _l3 = _global;

{
switch (option)
{
case "click":
{
this.weight = _l3.weight_small;
this.inertia = _l3.inertia_small;
this.b = _l3.b_small;
this.onEnterFrame = this.moveLoop;
this.mode = "drag";
this.first_action = true;
break;
}
case "release":
{

if (this.mode != "focus")
{
this.mode = "release";
this.first_action = true;
}
break;
}
case "rotate_align":
{
this.mode = "focus";
this.tox = this.x;
this.toy = this.y;
this.r = (this.r + 360000) % 360;
this.tor = (-this._parent._rotation + 360000) % 360;
this.onEnterFrame = this.moveLoop;
break;
}
case "reset":
{
this.x = scWidth / 2 - scWidth / 2 * randx * bunpu_x;
this.y = scHeight / 2 - scHeight / 2 * randy * bunpu_y;
this.r = Math.round(Math.random() * 360);
this.moveControl("stop");
this.draw();
break;
}
}
}
};
MovieClip.prototype.moveLoop = function ()
{
switch (this.mode)
{
case "drag":
{

if (this.first_action)
{
this.first_action = false;
this.mx = this._parent._xmouse;
this.my = this._parent._ymouse;
this.dmx = 0;
this.dmy = 0;

}
else
{
this.mx = this._parent._xmouse;
this.my = this._parent._ymouse;
this.dmx = this.mx - this.mx0;
this.dmy = this.my - this.my0;

}
this.mx0 = this.mx;
this.my0 = this.my;
var fx = (this.dmx - this.vx) * this.weight;
var fy = (this.dmy - this.vy) * this.weight;
var _l3 = this.mx - this.x;
var _l2 = this.my - this.y;
if (fx == 0)
{
var mlength = _l3;
var mforce = fy;
var torque = mforce * mlength;
}
else if (fy == 0)
{
var mlength = _l2;
var mforce = fx;
var torque = -mforce * mlength;
}
else
{
var k = fy / fx;
var kx = (-k * k * _l3 + k * _l2) / (-k * k - 1);
var ky = k * (kx - _l3) + _l2;
var mlength = Math.sqrt(kx * kx + ky * ky);
var mforce = Math.sqrt(fx * fx + fy * fy);
if (fx * ky > 0)
{
var torque = -mforce * mlength;
}
else
{
var torque = mforce * mlength;
}
}
if (this.rotateMode == "force_to_0")
{
torque = 0;
}
this.vx = this.dmx;
this.vy = this.dmy;
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.vr = this.vr - torque / this.inertia;
_l3 = this.mx - this.x;
_l2 = this.my - this.y;
var cos = Math.cos(this.vr / 180 * 3.141593);
var sin = Math.sin(this.vr / 180 * 3.141593);
this.addx = _l3 * cos + _l2 * sin - _l3;
this.addy = -_l3 * sin + _l2 * cos - _l2;
this.x = this.x - this.addx;
this.y = this.y - this.addy;
this.r = this.r - this.vr;
this.vx = this.vx / this.b;
this.vy = this.vy / this.b;
this.vr = this.vr / this.b;
break;
}
case "release":
{
if (this.first_action)
{
this.first_action = false;
this.vx = (this.vx - this.addx) * speed;
this.vy = (this.vy - this.addy) * speed;
this.addx = 0;
this.addy = 0;
}
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.r = this.r - this.vr;
this.vx = this.vx / this.b;
this.vy = this.vy / this.b;
this.vr = this.vr / this.b;
break;
}
case "focus":
{
if (this.first_action)
{
this.first_action = false;
}
this.vx = (this.vx + (this.tox - this.x) / backA) / backB;
this.vy = (this.vy + (this.toy - this.y) / backA) / backB;
this.vr = (this.vr - (this.tor - this.r) / backRa) / backRb;
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.r = this.r - this.vr;
break;
}
}
this.checkScreenArea();
this.draw();
};

MovieClip.prototype.checkScreenArea = function ()
{
if (this.x < scMargin || this.x > scWidth - scMargin)
{
if (this.vx != undefined)
{
this.vx = -this.vx;
this.x = this.x + this.vx;
}
if (this.x < scWidth ){this.x = Math.max(this.x, scMargin);}
else{this.x = Math.min(this.x, scWidth - scMargin);}
this.draw();
}
if (this.y < scMargin || this.y > scHeight - scMargin)
{
if (this.vy != undefined)
{
this.vy = -this.vy;
this.y = this.y + this.vy;
}
if (this.y < scMargin){this.y = Math.max(this.y, scMargin);}
else{this.y = Math.min(this.y, scHeight - scMargin);}
this.draw();
}
};

MovieClip.prototype.draw = function ()
{
this._x = this.x;
this._y = this.y;
this._rotation = this.r;
};

_global.speed = .4;
_global.scMargin = 1;
_global.scwidth = 800;
_global.scheight = 600;
_global.b_small = 1.100000;
_global.b_large = 1.150000;
_global.backA = 2;
_global.backB = 2.500000;
_global.backRa = 2;
_global.backRb = 2.500000;
_global.weight_small = 3;
_global.inertia_small = 300;
_global.weight_large = 4;
_global.inertia_large = 500;
_global.gosa = 0.300000;
_global.firstClick = true;

//use the declareToRotate() prototype on mc's to get the rotate effect (like below)
News.declareToRotate();
Contact.declareToRotate();
About.declareToRotate();

Physics
I have been looking for quite some time on how to do www.teagames.com flash physics. I have uncovered 1 buggy source here: http://www.kirupa.com/forum/showthread.php?t=209836

That is one but it is very buggy, and if your lucky enough to turn all the way you can still drive the car! Also you are able to climb hills easily unlike teagames, teagames needs you to accelerate and lean a little back!

So yep.... if theres anyone that could shed some light

Looking For Physics...
I had started a thread in the "Random" section of the K-forum, but I didn't get any replies.. So I will try here, as it is prolly a topic that is suited to be in the actionscript forum.


I was wondering if anybody out there would be able to create a tutorial on making a ragdoll, or at least post a link. If there is one thing I don't know about physics and the whole collision detection thingy it would have to be creating a ragdoll-like-effect with the use of rigid bodies. It adds a sense of realism to a game, and I would really like to be able to implement in my next project.

If any of you have tips or advice, such as links to a tutorial let me know. I have already read over Jakobsen's paper several times, and played around with it, but I didn't get the result I wanted.

If your willing to write a tutorial on the topic, it would be much appreciated and I'm sure that I wouldn't be the only one to consider using it. It could really help people create an actual video-game,( such as N, www.harveycartel.org/metanet) not just some cheap looking game with plain old hitTest(). Believe it or not, hitTesting has been around since the 80's. I think it's time we add some new ground-beraking physics in our game, without using something that was considered to be ground-breaking technology in the first few games ever made.


Anyways, I would like the help, I need a tutorial, preferably not based around c++, but instead actionscript.

Hot Cup Of Physics
Actually I am trying to find any intermediate tutorials that would help me to understand the physics and perspective tutorials better. I tried to do the simple Tutorial on perspective but I couldn't even figure out how to set the vanishing point. And as for the starfield tutorial I was all but completely lost.

Any tips, links, or info on how where I can learn to better understand/implement these concepts would be much appreciated.

Thanks

Wonder If Someone Can Help Me With Physics.
Hi guys.

Firstly let me say love this site and love this forum. Plenty of Flash problems have been sorted thanks to all the people on this site.

I have a quick question (Well might night be quick).

What I am trying to do is work out a formula based on a ball being launched at an angle and then having its direction affected by wind.

I will have the following variables. Speed (The speed will be a random scale that when you click the mouse button it will stop at a speed and launch at that speed). Wind (Will be randomly generated) and Distance.

At the end of the day any help would be appreciated, or a simple FLA file, or maybe web link. I have trawlled for formulas all over the web, but no joy.

I have probably been a bit vauge.

Well cheers guys.

Physics Help
Alright so I have this code for throwing/dragging for movieclips. All i want is for the mcs not to spin as much. I realize this is some crazy long code that I don't really understand so if no one can do it...so be it

here it is in action www.radioactivechimp.com/ChimpPages/Newsite.htm


Code:
MovieClip.prototype.declareToRotate = function()
{
this.mode = "release";
this.x = this._x;
this.y = this._y;
this.r = 0;
this.draw();
topDepth = 500;
this.onPress = function()
{
topDepth = topDepth + 2;
this.swapDepths(topDepth);
this.moveControl("click");
}
this.onRelease = this.onReleaseOutside = function()
{
this.moveControl("release");
}
}

MovieClip.prototype.moveControl = function (option)
{
var _l3 = _global;

{
switch (option)
{
case "click":
{
this.weight = _l3.weight_small;
this.inertia = _l3.inertia_small;
this.b = _l3.b_small;
this.onEnterFrame = this.moveLoop;
this.mode = "drag";
this.first_action = true;
break;
}
case "release":
{

if (this.mode != "focus")
{
this.mode = "release";
this.first_action = true;
}
break;
}
case "rotate_align":
{
this.mode = "focus";
this.tox = this.x;
this.toy = this.y;
this.r = (this.r + 360000) % 360;
this.tor = (-this._parent._rotation + 360000) % 360;
this.onEnterFrame = this.moveLoop;
break;
}
case "reset":
{
this.x = scWidth / 2 - scWidth / 2 * randx * bunpu_x;
this.y = scHeight / 2 - scHeight / 2 * randy * bunpu_y;
this.r = Math.round(Math.random() * 360);
this.moveControl("stop");
this.draw();
break;
}
}
}
};
MovieClip.prototype.moveLoop = function ()
{
switch (this.mode)
{
case "drag":
{

if (this.first_action)
{
this.first_action = false;
this.mx = this._parent._xmouse;
this.my = this._parent._ymouse;
this.dmx = 0;
this.dmy = 0;

}
else
{
this.mx = this._parent._xmouse;
this.my = this._parent._ymouse;
this.dmx = this.mx - this.mx0;
this.dmy = this.my - this.my0;

}
this.mx0 = this.mx;
this.my0 = this.my;
var fx = (this.dmx - this.vx) * this.weight;
var fy = (this.dmy - this.vy) * this.weight;
var _l3 = this.mx - this.x;
var _l2 = this.my - this.y;
if (fx == 0)
{
var mlength = _l3;
var mforce = fy;
var torque = mforce * mlength;
}
else if (fy == 0)
{
var mlength = _l2;
var mforce = fx;
var torque = -mforce * mlength;
}
else
{
var k = fy / fx;
var kx = (-k * k * _l3 + k * _l2) / (-k * k - 1);
var ky = k * (kx - _l3) + _l2;
var mlength = Math.sqrt(kx * kx + ky * ky);
var mforce = Math.sqrt(fx * fx + fy * fy);
if (fx * ky > 0)
{
var torque = -mforce * mlength;
}
else
{
var torque = mforce * mlength;
}
}
if (this.rotateMode == "force_to_0")
{
torque = 0;
}
this.vx = this.dmx;
this.vy = this.dmy;
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.vr = this.vr - torque / this.inertia;
_l3 = this.mx - this.x;
_l2 = this.my - this.y;
var cos = Math.cos(this.vr / 180 * 3.141593);
var sin = Math.sin(this.vr / 180 * 3.141593);
this.addx = _l3 * cos + _l2 * sin - _l3;
this.addy = -_l3 * sin + _l2 * cos - _l2;
this.x = this.x - this.addx;
this.y = this.y - this.addy;
this.r = this.r - this.vr;
this.vx = this.vx / this.b;
this.vy = this.vy / this.b;
this.vr = this.vr / this.b;
break;
}
case "release":
{
if (this.first_action)
{
this.first_action = false;
this.vx = (this.vx - this.addx) * speed;
this.vy = (this.vy - this.addy) * speed;
this.addx = 0;
this.addy = 0;
}
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.r = this.r - this.vr;
this.vx = this.vx / this.b;
this.vy = this.vy / this.b;
this.vr = this.vr / this.b;
break;
}
case "focus":
{
if (this.first_action)
{
this.first_action = false;
}
this.vx = (this.vx + (this.tox - this.x) / backA) / backB;
this.vy = (this.vy + (this.toy - this.y) / backA) / backB;
this.vr = (this.vr - (this.tor - this.r) / backRa) / backRb;
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.r = this.r - this.vr;
break;
}
}
this.checkScreenArea();
this.draw();
};

MovieClip.prototype.checkScreenArea = function ()
{
if (this.x < scMargin || this.x > scWidth - scMargin)
{
if (this.vx != undefined)
{
this.vx = -this.vx;
this.x = this.x + this.vx;
}
if (this.x < scWidth ){this.x = Math.max(this.x, scMargin);}
else{this.x = Math.min(this.x, scWidth - scMargin);}
this.draw();
}
if (this.y < scMargin || this.y > scHeight - scMargin)
{
if (this.vy != undefined)
{
this.vy = -this.vy;
this.y = this.y + this.vy;
}
if (this.y < scMargin){this.y = Math.max(this.y, scMargin);}
else{this.y = Math.min(this.y, scHeight - scMargin);}
this.draw();
}
};

MovieClip.prototype.draw = function ()
{
this._x = this.x;
this._y = this.y;
this._rotation = this.r;
};

_global.speed = .4;
_global.scMargin = 1;
_global.scwidth = 800;
_global.scheight = 600;
_global.b_small = 1.100000;
_global.b_large = 1.150000;
_global.backA = 2;
_global.backB = 2.500000;
_global.backRa = 2;
_global.backRb = 2.500000;
_global.weight_small = 3;
_global.inertia_small = 300;
_global.weight_large = 4;
_global.inertia_large = 500;
_global.gosa = 0.300000;
_global.firstClick = true;

//use the declareToRotate() prototype on mc's to get the rotate effect (like below)
News.declareToRotate();
Contact.declareToRotate();
About.declareToRotate();

Physics/ Math
I had an idee a few days ago to make a Flash Movie that shows the movement of a ball shooted out of a cannon.
I have worked with Flash, but never with difficult action script. I would like to learn that.

The script I had in mind is the following:
t = t+deltat;
Flw = k*v^2;
Flwx = Flw*(Vx/v);
Fx = -Flwx;
ax = Fx/m;
deltaVx = ax*deltat;
vx = vx+deltaVx;
deltax = vx*deltat;
x = x+deltax;
Flwy = Flw*(vy/v);
Fy = -Fz-Flwy;
ay = Fy/m;
deltavy = ay*deltat;
vy = vy+deltat;
deltay = vy*deltat;
y = y+deltay;
v = Math.sqrt ((vx^2+vy^2));
if (y<0) {
stop ();
}
_root.ball._x = x;
_root.ball._y = y;

//Start values//
t = 0;
deltat = 0.1;
g = 9.81;
m = 5;
Fz = m*g;
k = 3;
v = 20;
hoek = 15;
x = 0;
y = 1,5;
Vx = v*Math.cos (hoek);
Vy = v*Math.cos (hoek);


Can anyone help me or is interested in the project. So far it is now it doesn't work. I will be very pleased if someone cann tell me how to use mathematical functions in Flash.

Need Some Maths/physics Help...
Hi, can anyone help me with my maths/phsics in a game I am making. Look at http://www.kitachi.com/donut.swf
I need the collision better, because, as you will find out, when the 2 objects hit off each other and the walls, they shoot out of the screen. cheers

Game Physics
Hey all,

I am trying to get a handle on how to create games in a 2D pseudo-3D environment.

I saw the HP bettle buggin' game here:

http://www.hp-expo.com/winabeetle/uk...etlebuggin.asp


Any tips or links that can help me learn the code behind that to create my own driving games?

I am starting with just a simple on (keypress) and then move it 10px up, down, left or right in a loop, but that car on Buggin' moves forward based on which angle the car is pointed.

Thanks.

Game Physics?
Hey all,

I am trying to get a handle on how to create games in a 2D pseudo-3D environment.

I saw the HP bettle buggin' game here:

http://www.hp-expo.com/winabeetle/uk...etlebuggin.asp

Is it Shockwave and not Flash?

Any tips or links that can help me learn the code behind that to create my own driving games?

I am starting with just a simple on (keypress) and then move it 10px up, down, left or right in a loop, but that car on Buggin' moves forward based on which angle the car is pointed.

Thanks.

Ball Physics
hi guys,
this is the first time ive written in the actionscript forum!!! i live in the games forum he he he... neway what i was wondering is if there is a simple way of making a ball go down a half pipe and up the other side, back to the other side and each time losing speed... i think u catch my drift neway is there a simple way of doing that or is there a tut somewhere because i think thats heaps kool!!!

Code:
| ball ->O/|
| ......./ |
|___________|

i was just mucking around with something thats way off the track but kinda does it and kinda doesnt. neway thanks for your help...

Grav Nav Physics
i'm trying to build a subtle nav interface that 'glides' as you mouse over it. i have got it to about 50% but am stuck.

i now need it to:

a) stop when it reaches the bottom.

b) decelerate on mouse out

all the code is on the nav mc:

[size=1]onClipEvent (enterFrame) {
yOffset = 455;
trueY = (yOffset)-Math.round(_root.slider._y);
_root.slidery = trueY;
_root.sliderheight = _root.slider._height;
if (_root.hotSpot.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.slider._y = _root.slider._y-(_root._ymouse-_root.hotSpot._y)/30;
}
if (trueY<0) {
_root.slider._y = (Yoffset);
}
}
SIZE]

see attached

Physics And Direction
Hey everyone,

I used to have a code in a text file to turn direction of the MC(rotate it)... and when i press the up key it would move in that direction it was facing... Can anyone help me with finding this code again.. thanks to all who could help!

Cheers,

~Bill

HitTest, Physics, And Me
I am working on a side-scrolling game and the only way I have figured out how to make the character jump and fall back down is with this code:

if (Key.isDown(key.UP)) {
_y -= 10;
} else {
_y += 10;
}
}

the problem with the script is that I do not know how to limit the jump (holding up takes you higher and higher) and I am using that script because it is the only way I have found to make my hitTest script work. the hitTest script that I am using is a very basic one:

onClipEvent (enterFrame) {
with (_root.player) {
if (walls.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= 10;
}
if (walls.hitTest(getBounds(_root).xMin, _y, true)) {
_x += 10;
}
if (walls.hitTest(_x, getBounds(_root).yMax, true)) {
_y -= 10;
}
if (walls.hitTest(_x, getBounds(_root).yMin+27, true)) {
_y += 10;
}
}
}

If I add any sort of physics to the jump the hitTest that I am using doesnt work because it only cancels the speed that the player is going. with varying speed, I do not know how to make it so the player can stand on top of platforms without going through them

summary:

1. a jump that has a little more physics than holding UP to go UP just as fast as you fall

2. a hitTest that does not just cancel the speed that the player is moving so the hitTest works with a jump that has physics applied to it.

Jump Physics
could someone tell me how to make a character jump please? I have searched the forum, but nothing on it!

Tank Physics
I've made this tank, but when the tank stand still it's moving about 0.1 px per sec...

The physic code I've made:

onClipEvent (enterFrame){

_x += _root.speed*Math.cos(2.0*Math.PI*
(_rotation-90)/360.0);

_y += _root.speed*Math.sin(2.0*Math.PI*
(_rotation-90)/360.0);

if (_root.speed > 0){
_root.speed -= 0.01
}

if (_root.speed < 0){
_root.speed += 0.01
}

if (Key.isDown(87)) {
if (_root.speed < 1.5){
_root.speed += 0.02
}
}

if (Key.isDown(83)) {
if (_root.speed > -1.5){
_root.speed -= 0.02
}
}
}

Plz help me (You can download the fla file)

:::: Spring Physics ::::
hey i am working on a project to replicate something like this.. and then toy around with it to get a better understanding of flash and how physics ties in etc etc.. http://www.flashcomponents.com/detai...f&id=123&link=
thats what i am trying to duplicate and i have the circle matrix grid but now i am trying to work on the physics part of it.. i am running MX 2004 btw . i thikn they use a spring function to oscillate the _xscale and _yscale but i dont know is anyone good at this stuff that could walk me through it or at least get me started??? Thanks
--Adam

Help For Physics Programming
Plz tell me some resources from where i can learn to program physics in Action script for games like the link specified below:


http://yeti1.yetisports.org/yetipart1/?c=DFdk45(kdj/(6re80()76%)=fldfj(77345pdk=(/73647idfihj,)86r37849kojnvkdf%


Lots of games like these is avilable at:
http:\yetisports.org

Sarbjeet Gaba

Elasticity And Physics
Can anyone help me find tutorials on how to create elastic effects with actionscript for FLASH MX 2004?

Thanks.

Ball Physics
I'm trying to model what works out to be a pinball situation: a ball hits another ball and rebounds off of it. This is getting tricky- at least to me- and I'm wondering if I'm making it harder than it needs to be.
Now I can figure the angle of incidence, that is, the angle that the balls collide in relative to the X and Y in Flash. Now what I think needs to happen is that the moving ball bounces off that stationary ball at a mirror of the same angle it strikes it, relative to that angle of incidence.
Is this making any sense?

I'd post some code, but I've been over it and over it, and my code wouldn't help at this point. I'm confused.

Does anyone know where I can find any tutorials, formulas, or even trigonometry help online!?

Physics Ideas
Hello all. I'd just like to ask two things.
1.
I've been trying unsuccessfully to make a game. One of the only things that has been stopping me is a succesful usage of hittests. Could someone please help me? For example, when I hit a wall I want my "ball" (the protaganist ) to go to the frame in the movie that says game over. How would I use a hit test to make that happen? Also, as well as that, could you please point me to any tutorials that assume I know nothing about it? I seem to be having the easiest time with them .
2.
Finally, I have managed to make a physics system of sorts for my objects. What ideas come to mind of what I can use this for? Platforming? Action? Half-life 2 style (nowhere near the game of course ) puzzles? Do tell, don't worry if your idea sounds far fetched or half assed (within reason).

Thanks very much.

Ball Physics.
I have this code(at bottem) but i would like it to be bounceing off the stage height/width but also "player1" and "player2". the players look like domes so i know there has to be getBounds(). iv raked my brains trying but its to difficult. for me

Drift Like Physics
how can i make drifting or sliding like physics for a racing game?

Physics/bouncy
I'm trying to find a snippet of code that I can attach to a movie clip and just change the Y max position.

I have something that enters the stage from the bottom and I want it to rebound a little off the top of the stage and settle...like a rubber-band effect..but subtle.

I'm not hip on all that math stuff so I'm wondering if anyone has a snippet somewhere where I just change instance names and simple parameters?

Thanks

Hanging Physics
I am making an RPG style fighting game engine demo, and I want the character to hit a punching bag... all I need tho is to learn how to code the punching bag so that it swings on its hanging rope when it is hit. How can I program the realistic swinging physics... it dosn't even have to move exactly reallistic... all i want is the left and right swinging actions that eventually taper off because of gravity... thanks ahead of time!

Dragging With Physics
http://www.intentionallies.co.jp/content_normal.html

try dragging the little cards.. how would i recreate that effect? anyone have a tutorial or can explain? thx!

Drag Physics?
Hi,

I am trying to make a draggable object that is only draggable on the X axis. I want the user to be able drag the object say to the left and when he/she lets go of the mouse the object bounces back into starting position. I have searched exensivly and haven't been able to find something fitting what im looking for. Does anyone have any exerience with this or know of a tutorial to get me going? I have attached a sample .fla in MX format to demonstrate what i mean. Thanks in advance.

Physics Question
Hi all,
I have a ball that is essentially bouncing and hitting a wall. How do i create a ball that increases with velocity even after hitting the wall. In other words, how can i change the direction of a ball yet still maintain an increase in velocity. Here is what little code i have so far. Any help would be greatly appreciated.
Thanks
gravity=2;
speed=12;
bounce=.9

this.onEnterFrame=function(){
speed=speed+gravity;
positive=speed;
trace("speed " + speed);
trace("positive " + positive);

ball._x=ball._x+positive;

if (ball._x>400){
ball._x=400;
speed=speed*-1;
positive=-speed;
}


}

Copyright © 2005-08 www.BigResource.com, All rights reserved