ce n'est pas une jeux complet, ce n'est pas un jeux tout court, c'est un moteur de deplacement de demonstration.
Ce moteur ayant été refusé et remplacé par un autre, ce moteur devient libre.
ce n'est pas la version final, ce n'est pas une version demo, C un prototype d'evaluation uniquement.
pas de support en cas de bug ou autre.
Source / Exemple :
stop();
_root.smoke.stop();
function makemoke() {
i++;
duplicateMovieClip(_root.smoke, "smoke" + i, i);
newSmoke = eval("_root.smoke" + i);
newSmoke._x = _root.pod._x;
newSmoke._y = _root.pod._y;
newSmoke.gotoAndPlay(2);
}
function collisionMap(object) {
if (object.hitTest(_root.pod._x, _root.pod._y, true) || object.hitTest(_root.pod.pt._x, _root.pod.pt._y, true)) {
unloadMovie(_root.pod);
}
}
function keepOnScreen(object) {
if (object._y >= 499) {
object._y = 2;
}
if (object._y <= 1) {
object._y = 498;
}
if (object._x >= 599) {
object._x = 2;
}
if (object._x <= 1) {
object._x = 598;
}
}
/* ## CREATION DES ETOILES ## */
for (i = 1; i <= 50; i++) {
duplicateMovieClip(_root.star, "star" + i, i);
newStar = eval("_root.star" + i);
newStar._y = Math.random() * 450;
// Y aleatoire
newStar._x = 800 - (math.random() * 800);
// X aleatoire
newStar.starSize = Math.random() * .7;
// distance sur l'axe Z des etoiles aleatoires
newStar._alpha = newStar.starSize * 80;
// transparence
newStar._width *= newStar.starSize;
// taille
newStar._height *= newStar.starSize;
// taille
}
movieclip.prototype.init = function(r) {
this.decay = r;
};
movieclip.prototype.move = function() {
if (Key.isDown(Key.UP)) {
this.vy -= 1;
}
if (Key.isDown(Key.DOWN)) {
this.vy += 1;
}
if (Key.isDown(Key.RIGHT)) {
this.vx += 1;
}
if (Key.isDown(Key.LEFT)) {
this.vx -= 1;
}
this._x += this.vx;
this._y += this.vy;
this.vx *= this.decay;
this.vy *= this.decay;
this._rotation = 180-(90 * Math.atan2(this.vx, this.vy) / (Math.PI / 2));
};
Conclusion :
le code est moche, etant donnée que CT un prototype de demonstration (seul le visuel compte), je n'ai pas codé en OO (sinon, j'aurai utilisé les proto a la place des fonctions)
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.