Saturday, March 16, 2013

Moving Background part 4

                        Moving the background
To parralex scroll the background. Which will give you depth in the game. I did this by using a if  statement in a function then all you do is what ever the instance names of them you would say something like this 



example code

if (man.x <= stage.stageWidth * 0.25)




The man is the name of the  character the dot is like  access  to the next part x is  the x  access. Less than of the stage. =  Assigns the value stage.stageWidth and the multiply number is where you want the action to work on the stage. Then the symbols of your background is in the x axis and then + is left and - is right and then just put in the speed of them. 

No comments:

Post a Comment