home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Esportes
/
CrossingCup.swf
/
scripts
/
__Packages
/
CBallPoint.as
< prev
next >
Wrap
Text File
|
2007-12-11
|
1KB
|
48 lines
class CBallPoint
{
var count = 0;
var gravity = 0.9;
var def_bx = 54.8;
var def_by = 0.1;
var def_bz = -38.5;
function CBallPoint(bg, mcParent, obax, alp)
{
this.obax2 = new Object();
this.obax2.bx = obax.bx;
this.obax2.by = obax.by;
this.obax2.bz = obax.bz;
this.obax2.xVel = obax.xVel;
this.obax2.yVel = obax.yVel;
this.obax2.zVel = obax.zVel;
this.obax2.power = obax.power;
this.obax2.Aangle = obax.Aangle;
this.calc(this.obax2);
var _loc3_ = new sandy.primitive.Line3D(new sandy.core.data.Vector(obax.bx,obax.by,obax.bz),new sandy.core.data.Vector(this.obax2.bx,this.obax2.by,this.obax2.bz));
_loc3_.setSkin(new sandy.skin.SimpleLineSkin(2,65280,alp));
this.axes = new sandy.core.group.Group();
this.axes.addChild(_loc3_);
bg.addChild(this.axes);
}
function getPosition()
{
var _loc2_ = new sandy.core.data.Vector(this.obax2.bx,this.obax2.by,this.obax2.bz);
return _loc2_;
}
function calc(ob)
{
var _loc3_ = 0.01;
ob.yVel -= this.gravity;
ob.bx += ob.xVel * _loc3_;
ob.by += ob.yVel * _loc3_;
ob.bz += ob.zVel * _loc3_;
if(ob.by < this.def_by)
{
ob.by = 0;
}
}
function destroy()
{
this.axes.destroy();
}
}