Me gustaría aplicar un array para tener más monedas por nivel, y no sólo una. Si alguien pudiese explicarme cómo puedo aplicarle el array y cómo funcionaría en este caso, le estaría bastante agradecido.
Aquí está el swf:
y aquí está mi código:
Código ActionScript :
var mySo:SharedObject = SharedObject.getLocal( "variasMonedas" );
var xPos = 275;
var yPos = 200;
_root.a_recoger._visible = false;
if (mySo.data.monedasAcoger == undefined){
trace("aún no la has cogido");
_root.a_recoger._visible = true;
}else if (mySo.data.monedasAcoger == 1)
trace ("ya la cogiste");
if (mySo.data.monedasAcoger == undefined) {
attachMovie("la_moneda","moneda1",this.getNextHighestDepth(), {_x:xPos, _y:yPos});
}else
{
_root.moneda1.unloadMovie;
}
attachMovie("el_reset","reinicio",this.getNextHighestDepth(), {_x:475, _y:yPos});
onEnterFrame = function() {
if (_root.jugador.hitTest(_root.moneda1))
{
_root.moneda1.gotoAndStop(2);;
_root.moneda1.unloadMovie;
mySo.data.monedasAcoger = 1;
trace(mySo.data.monedasAcoger);
}
mySo.flush();
if (_root.jugador.hitTest(_root.reinicio))
{
_root.reinicio.gotoAndStop(2);
mySo.clear();
}
}
