Depuis quelques jour je cherche désespérément de l'aide pour continuer mon jeu que je suis en train de créer.
J'essaie de créer un jeu de plateforme avec un de mes amis. Je suis un étudiant en développement web, alors je m'intéresse beaucoup a flash et action script.
J'essaie de faire bouger mon personnage principal ''principal'' grace a mon clavier et de faire jouer les animation pour qu'il marche et surtout, de les arrêter au moment ou on lâche le bouton.
Voici mon code...
et voici l'erreur qui se produit quand je fais preview:
1084: Syntax error: expecting rightbrace before end of program.
//Variables
var checkmove:Boolean;
var speed:Number = 8;
var keycode:Number = 0;
addEventListener(Event.ENTER_FRAME,enterframe);
stage.addEventListener(KeyboardEvent.KEY_DOWN,keydown);
stage.addEventListener(KeyboardEvent.KEY_UP,keyup);
function keyup(arg:KeyboardEvent):void {
checkmove=false;
}
function keydown(event:KeyboardEvent):void {
keycode=event.keyCode;
movingcheck();
}
function movingcheck():void {
checkmove=true;
}
//arret des clips
principal.stop("marche");
principal.stop("stance");
principal.stop("couppied");
principal.stop("pousse");
//mouvements
function enterframe(arg:Event):void {
trace ("checkmove:",checkmove);
if (keycode==39&&checkmove==true) {
principal.x+=speed;
principal.scaleX = 1;
principal.gotoAndStop("marche");
} else
if (keycode==37&&checkmove==true) {
principal.x-=speed;
principal.scaleX = -1;
principal.gotoAndStop("marche");
} else
if (checkmove==false) {
principal.marche.stop();
}
}


Connexion
Inscription
Citer