Really odd problem!

(Not too sure which forum this belongs in but i think this should be right)

Okay, i’ve made a simple pong game, it has a score system and i think it’s pretty simple and good.
But i’ve got a very strange problem with it.

The game has Preloader, intro, menu and then the actual game. I tested the game out by clicking the “Test Scene” option, and the pong game worked perfect, like i wanted it to.However, i chose the “Test Movie” option and when i get to the game, it doesn’t work. I am able to move the paddle up and down, but neither the ball or the opponent’s paddle moves.

I’m not sure what information you will need. But for the game to work, there is one script written and put on the first frame of the game. This is the script.

Please help, i’ve been around so many different places to find help and nobody knows!

_root.onLoad = function() {
    ymov = 4;
    xmov = 4;
    stop();
    enemyx = 2;
    enemyy = 2;
    _root.playerscore = 0;
    _root.enemyscore = 0;
};
_root.onEnterFrame = function() {
    _root.block._x += xmov;
    _root.block._y += ymov;
    // Tells the ball where to go when you get hit
    if (_root.block.hitTest(_root.wall)) {
        xmov *= -1;
        ymov *= 1;
    }
    if (Key.isDown(Key.DOWN)) {
        _root.wall._y += 5;
    } else if (Key.isDown(Key.UP)) {
        _root.wall._y -= 5;
    }
    if (_root.block.hitTest(_root.bottom)) {
        xmov *= 1;
        ymov *= -1;
    }
    if (_root.block.hitTest(_root.top)) {
        xmov *= 1;
        ymov *= -1;
    }
    if (_root.block.hitTest(_root.left)) {
        xmov *= -1;
        ymov *= 1;
    }
    if (_root.block._y>_root.left._y) {
        _root.left._y += enemyy;
    }
    if (_root.block._y<_root.left._y) {
        _root.left._y -= enemyy;
    }
    // Boundries for top and bottom 
    if (_root.wall.hitTest(_root.bottom)) {
        _root.wall._y -= 5;
    }
    if (_root.wall.hitTest(_root.top)) {
        _root.wall._y += 5;
    }
    if (_root.left.hitTest(_root.bottom)) {
        _root.left._y -= 4;
    }
    if (_root.left.hitTest(_root.top)) {
        _root.left._y += 4;
    }
    if (_root.block.hitTest(_root.score1)) {
        _root.enemyscore = _root.enemyscore+1;
        _root.block._x = 249.7;
        _root.block._y = 187.7;
        _root.block._x -= xmov;
    }
    if (_root.block.hitTest(_root.score2)) {
        _root.playerscore = _root.playerscore+1;
        _root.block._x = 249.7;
        _root.block._y = 187.7;
        _root.block._x += xmov;
    }
    if (_root.enemyscore == 10) {
        _root.gotoAndStop("Lose");
    }
    if (_root.playerscore == 10) {
        _root.gotoAndStop("Win");
    }
};

can you provide the fla? It would be really hard to help without it.

I just copied your code into a new flash file and created objects called wall, bottom and block, and it worked fine!

Don’t use scenes, they are evil :stuck_out_tongue:

[quote=onion;2333241]I just copied your code into a new flash file and created objects called wall, bottom and block, and it worked fine!

Don’t use scenes, they are evil :-P[/quote]

lol that’s what I was going to say, I just wanted to see the fla to make sure…

Okay, i put them into one scene and i think i messed it up. I’m not thinking properly this morning:huh:
It still does the same thing?

I’m not able to upload it cause it’s too big… >_<

its pong and its too big?

I can only suggest exporting the scene as a swf then loading it in

however you have to watch all that _root nonsense

I put the game into a movie clip and changed all the "_root"s to "_parent"s but it’s not working either.