script Gravity (Vishnubhatla)

  • vishnubhatla
  • Newbie
  • Newbie
  • No Avatar
  • Inscription: Avr 07, 2010
  • Messages: 11
  • Status: Offline

Message Avril 7th, 2010, 10:28 pm

Professionnels Salut,

J'ai apprendre l'animation gravité pour la balle,

J'ai écrire du code total,

var ball1: boule = nouveau ballon ();
addChild (ball1);
ball1.x = 30;
ball1.y = 300;
gravité var: Nombre = 0,00098;
dx var: Number = 0,2;
dy var: 0,8 =- Nombre;
var i = 0;
dernierTemps var: int = getTimer ();
addEventListener (Event. ENTER_FRAME, supérieur);
fonction supérieure (event: Event)
(
timeDiff var: int = getTimer ()-dernierTemps;
+ = DernierTemps timeDiff;
* Gravité + dy = (getTimer () - (getTimer () * i));
+ = Ball1.x timeDiff * dx;
+ = Ball1.y timeDiff * dy;
if (> ball1.y = 300) (
ball1.y = 300;
dy =- 0,8;
timeDiff = timeDiff-getTimer ();
i = i +1;
)
)


Je l'ai eu!

Essayez-le, C'est cool


Merci,
K Vishnubhatla Swamy,
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Avril 7th, 2010, 10:28 pm

Afficher de l'information

  • Total des messages de ce sujet: 1 message
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 33 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC