Eldest Posted September 11, 2008 Content Count: 2686 Joined: 03/22/08 Status: Offline Share Posted September 11, 2008 Basically, I have the following code put in to one frame. When I try to make the tiles move, everything moves, including the ball and the background?Why aren't the other objects stationary?Help please! PS:I have no idea where to post these kind a coding problems . But this sub-forum seems a good place //stop level stop(); //väärtused var kiirus:Number = 3; //build level level = new Array(); _root.attachMovie("taevas1","taevas1",1); _root.createEmptyMovieClip("tiles",2); level[0] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0); for (y=0; y for (x=0; x if (level[y][x] == 1) { ehita = tiles.attachMovie("normalTile", "normal_"+tiles.getNextHighestDepth(), tiles.getNextHighestDepth(), {_x:x*100, _y:y*100}); } } } //spawn player _root.attachMovie("player","player_uus",_root.getNextHighestDepth(),{_x:35, _y:35}); //pos tiles._x = 220; tiles._y = 240; player_uus._x = 220; player_uus._y = 240; //movement tiles.onEnterFrame = function() { if (Key.isDown(Key.LEFT)) { _x += kiirus; } if (Key.isDown(Key.UP)) { _y += kiirus; } if (Key.isDown(key.RIGHT)) { _x -= kiirus; } if (Key.isDown(key.DOWN)) { _y -= kiirus; } }; Link to comment
cOff- Posted September 11, 2008 Content Count: 111 Joined: 07/06/08 Status: Offline Share Posted September 11, 2008 Fixed it .. //build level level = new Array(. )( .) _root.attachMovie("taevas1","taevas1",1); _root.createEmptyMovieClip("tiles",2); level[0] = new Array(1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0); for (y=0; y for (x=0; x if (level[y][x] == 0) { Link to comment
Eldest Posted September 11, 2008 Content Count: 2686 Joined: 03/22/08 Status: Offline Share Posted September 11, 2008 Serious answers please:sad: Link to comment
cOff- Posted September 11, 2008 Content Count: 111 Joined: 07/06/08 Status: Offline Share Posted September 11, 2008 Serious answers please:sad: Seriously, try the boobies, they're magical !!! Link to comment
Eldest Posted September 11, 2008 Content Count: 2686 Joined: 03/22/08 Status: Offline Share Posted September 11, 2008 Righty, I got it fixed now. tiles.onEnterFrame = function() { if (Key.isDown(Key.LEFT)) { player_uus._x += kiirus; } if (Key.isDown(Key.UP)) { player_uus_y += kiirus; } if (Key.isDown(key.RIGHT)) { player_uus_x -= kiirus; } if (Key.isDown(key.DOWN)) { player_uus_y -= kiirus; } }; Link to comment
cOff- Posted September 12, 2008 Content Count: 111 Joined: 07/06/08 Status: Offline Share Posted September 12, 2008 Righty, I got it fixed now. tiles.onEnterFrame = function(. Y .) { if (Key.isDown(Key.LEFT)) { player_uus._x += kiirus; } if (Key.isDown(Key.UP)) { player_uus_y += kiirus; } if (Key.isDown(key.RIGHT)) { player_uus_x -= kiirus; } if (Key.isDown(key.DOWN)) { player_uus_y -= kiirus; } }; told ya .. the boobies help Link to comment
Recommended Posts
Reply to Thread
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now