Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthordwightepp
    • CommentTimeNov 8th 2011
     
    So I have two different gametypes, one you have to hit each pin once to win and the other it just counts the total hits. for some reason "type1" starts to slow down and use more memory, while "type2" stays consistent throughout. From what I see "type1" should actually perform faster. Thoughts?

    [code]
    function collisionHandler(_event:ParticleEvent):void{
    //plays hit animation
    hitPin.x = _event.otherObject.x;
    hitPin.y = _event.otherObject.y;
    hitPin.play();
    //plays hit sound
    var collideSound = new collide();
    var channel:SoundChannel = collideSound.play();

    if(masterGameType == "type1"){ //code for pin clearing game type
    //moves both movieclips involved in collision to frame two, making the pin green
    _event.particle.image.gotoAndStop(2);
    _event.otherObject.image.gotoAndStop(2);
    pinsHitRound++;
    }else if(masterGameType == "type2"){//code for hit counter game type
    if(_event.particle.dictionary['type'].substr(0,3) == 'pin' || _event.otherObject.dictionary['type'].substr(0,3) == 'pin'){
    totalHits++;
    hitCounter.text = totalHits;
    }
    }

    }
    [/code]
    • CommentAuthordwightepp
    • CommentTimeNov 8th 2011
     
    so I tried have the image in frame two being the same as frame 1, performance increased. Were' talking about really small images here, can't believe that would affect the frame rate so much that it would drop for 25 fps to 12.