Actually I made the background scroll with the guy ... soon this will be added to the website, but I need to be at home to do that...
Here is the segment of code used:
Okayyy, so here we have an if statement determined by the position of the player on the y axis. If the player's y value is greater than 100 (remember y axis is reversed in flash) the player will move up (y-2) and if the player is less than 100 (near the top) the wall will move down instead of the player moving up.
if(_root.player._y > 100){
_root.player._y -= 2;
} else {
_root.wall._y += 2;
}
This all gives the effect of the player moving up, yet the player will never reach the edge of the screen because as soon as it hits the y = 100 point the wall will move instead!
SWF coming soon!
No comments:
Post a Comment