Monday, 2024-05-20, 4:58 PM Welcome Guest

.

Site menu
Cauta Pe Site
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » Ajutor UCOZ » Scripturi » Elastic Trail (mouse trail effect)
Elastic Trail (mouse trail effect)
sergiuDate: Tuesday, 2009-12-15, 1:05 PM | Message # 1
Major general
Group: Administrators
Messages: 437
Reputation: 0
Status: Offline

Code
<!--
// image src
var trailsrc = "http://armkayf.do.am/js95573248.gif";

var nDots = 7;
var Xbpos = 0;
var Ybpos = 0;

// fixed time step, no relation to real time
var DELTAT = .01;
// size of one spring in pixels
var SEGLEN = 10;
// spring constant, stiffness of springs
var SPRINGK = 10;
// all the physics is bogus, just picked stuff to make it look okay
var MASS = 1;
// Positive XGRAVITY pulls right, negative pulls left
// Positive YGRAVITY pulls down, negative up
var XGRAVITY = 0;
var YGRAVITY = 50;
// RESISTANCE determines a slowing force proportional to velocity
var RESISTANCE = 10;
// stopping criterea to prevent endless jittering
// doesn't work when sitting on bottom since floor
// doesn't push back so acceleration always as big
// as gravity
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
// BOUNCE is percent of velocity retained when
// bouncing off a wall
var BOUNCE = 0.75;

var ff=(document.getElementById&&!document.all);
var ns=(document.layers);
var ie=(document.all);

// always on for now, could be played with to
// let dots fall to botton, get thrown, etc.
var followmouse = true;
var dots = new Array();

function init()
{
var i = 0;
for (i = 0; i < nDots; i++) {
dots[i] = new dot(i);
}

// set their positions
for (i = 0; i < nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}

setTimeout("startanimate()", 10);
}

function dot(i)
{
this.X = Xbpos;
this.Y = Ybpos;
this.dx = 0;
this.dy = 0;

if (ns){
document.write("Elastic Trail (mouse trail effect)");
} else if (ie||ff) {
if (i == 0) {
document.write("


:D www.fonline.ucoz.com :D
 
Forum » Ajutor UCOZ » Scripturi » Elastic Trail (mouse trail effect)
  • Page 1 of 1
  • 1
Search:

Statici !!!
Site Facut De Sergiu © 2024 Free web hostinguCoz