AS 2 Parallax Movement Effect for sidescroller game
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Parallax Movement Effect for sidescroller game

  1. #1
    Junior Member
    Join Date
    Jul 2014

    Parallax Movement Effect for sidescroller game

    Hello! Making a game and i want to create some depth in the background.

    I have 1 background for the game.

    Infront of that background i have a "middle background" with trees and stuff.

    And infront of that background i have the plane where the character is walking.

    I want to make so whenever the characters._x is either raising or getting lower then the background assets (the middle background) will also move in the same direction but with a lower speed than the character.

    Any kind soul out there that can figure out the code for that?

    I'm using Actionscript 2.0

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    I can't think too much right now..but maybe when you move you character towards a direction, you can set a variable like var direction to "right" or "lef" or whatever direction, and also the var speed. Then to your background, if(direction == "right") background._x+= speed - 10; (where 10 is the substraction of the character speed so the background runs with a slower speed). Maybe that works for you, see you by
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center

Poll by