开发者

Upgrade Menu in flash

I'm making a game and i want to make a upgrade menu like if he buys it开发者_StackOverflow then the main character gets faster or something... But when i set the variables they don't work here is the code i use :

if(speed1=true){ 
movespeed == 11 
speed2 = false 
speed3 = false 
speed = false
}

But it just uses the last "movespeed" i put in the main character actions :/ Could u guys/girls help me ? oh yea i tried it whit hats :

if(hat1=true){
_root.char.gotoAndStop(2);
hat = false
hat2 = false
hat3 = false
}

Still doesn't work eaven if i put == in there :/ i would appreciate some help.


Well, the code should read:

if(speed1==true){ 
    movespeed = 11;
    speed2 = false;
    speed3 = false;
    speed = false;
}

if(hat1==true) {
    _root.char.gotoAndStop(2);
    hat = false;
    hat2 = false;
    hat3 = false;
}

Also, since you seem to be using AS1 or 2, is that code inside an event? if so, it is possible those variables you are modifying are not the ones you are expecting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜