voitvito = 2; //vitesse de la voiture voit.onEnterFrame = function() { trace(voitvito); if (Key.isDown(Key.RIGHT)) { voit._rotation += 2; } if (Key.isDown(Key.LEFT)) { voit._rotation -= 2; } if (Key.isDown(Key.DOWN)) { voitvito = 2; } if (Key.isDown(Key.UP)) { if (voit._rotation>=0 && voit._rotation<=90) { voit._y -= (voitvito/90)*(90-voit._rotation); voit._x += (voitvito/90)*voit._rotation; if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>90 && voit._rotation<=180) { voit._x += (voitvito/180)*(270-voit._rotation); voit._y += (voitvito/180)*voit._rotation; if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>=0-90 && voit._rotation<0) { voit._y -= (voitvito/90)*(90+voit._rotation); voit._x -= (voitvito/90)*(-voit._rotation); if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>=0-180 && voit._rotation<-90) { voit._x -= (voitvito/90)*(-(90+voit._rotation)); voit._y -= 0-((voitvito/90)*(-voit._rotation)); if (voitvito<7) { voitvito += 0.05; } } } };
Télécharger le zip
bon ben voila jaten ke vious maidiez lol ^^non je dékonne mais jespère ke vous allez maider kan mememerci
coucou, je c pa si je pourai t'aider pour ça, mais juste un conseil, colle au moins le code sur le site pour qu'on voie déjà si y'a quelque chose qu'on pourait gratter un peu pour comprendre
Bonjour,Je te conseil d'aller voir mon code http://www.flashkod.com/code.aspx?id=26978Il est dès plus simple et dès moins compliqué. Peut-être qu'en regardant les différents "if" et "case" de déplacement tu vas trouvé une solution. Ton code est ce que je chercheais pour amilorer mon propre code de déplacement.Cordialement___________________Bouffard
aïe aïe!! Faut surtout pas travailler en radian!!! tu n'as pas remarqué que tes angles ne sont pas précis du tout? flash calcul en radian donc il faut convertir en degrés par ce code tout con mais qui résoudra tout:angle = angle * Math.PI / 180; La ça sera nikel ;)
Les Flash travail en Degrés regarder l'aide de Flash MX ou encore l'ouvrage de Colin Moock ActionScript Pour Flash MX !!
Voilà, j'ai regardé ton code à l'école, il n'a pas l'aire parfait, mais c'est un peu mieu...voitvitba = 5;voit.onEnterFrame = function() { //trace(voitvito); //trace(voit._rotation); if (Key.isDown(Key.RIGHT)) { voit._rotation += 4; } if (Key.isDown(Key.LEFT)) { voit._rotation -= 4; } if (Key.isDown(Key.DOWN)) { voitvito = 2; } if (Key.isDown(Key.UP)) { if (voit._rotation>=0 && voit._rotation<=90) { voit._y -= (voitvito/90)*(90-voit._rotation); voit._x += (voitvito/90)*voit._rotation; if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>90 && voit._rotation<=180) { voit._y -= (voitvito/90)*(90-voit._rotation); voit._x += (voitvito/90)*(180-voit._rotation); if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>=0-90 && voit._rotation<0) { voit._y -= (voitvito/90)*(90+voit._rotation); voit._x -= (voitvito/90)*(-voit._rotation); if (voitvito<7) { voitvito += 0.05; } } if (voit._rotation>0-180 && voit._rotation<-90) { //voit._x -= (voitvito/90)*(-(90+voit._rotation)); voit._x += (voitvito/90)*(-180-voit._rotation); //voit._y -= 0-((voitvito/90)*(-voit._rotation)); voit._y += (voitvito/90)*(-90-voit._rotation); if (voitvito<7) { voitvito += 0.05; } } }};
Zike, je t'aime tu es mon sauveur :-).Sérieusement je te dis chapeau !Un grand merci pour ton code qui fonctionne a merveille.G faillit abandonné ce projet mais maintenant je peux continuer. MERCI !!Fab'
Bonjour,Je cherche justement une personne qui me ferais un jeux plate forme simple un seul niveaux ou il sajit de faire avencer sauté un cheval et lui faire manger des pommes pour gagner des point si le dessin 2D n'est pas votre fort pas grave je peux fournirJe ne sait pas codé donc....Mais j'ai besoin d'une réponse rapidement merci!!!au cas ou il y a des interessés voici mon msn pour plus d'informations sur le sujetmely_dacari_AT_hotmail.com
Salut, j'ai tester le flash et ca a fonctionné. Mais moi, je ne sais pas coder, donc, est-ce que quelqu'un peut me dire comment mettre des limites? Je cherche cela depuis très longtemps.Merci d'avance.Amicalement Fehd01
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 624 217 membres 14 nouveaux aujourd'hui 15 512 membres club