A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Game style website; character left and right

  1. #1
    Member
    Join Date
    Oct 2004
    Posts
    32

    Game style website; character left and right

    Hi guys,
    I really need some help with a code for a website I am developing - i thought i could avoid the issue but it has made it way too complicated and im sure someone will know the answer on here!

    Basically, i have my stage and i have a long background image that only a small percentage is visable in the stage area at any one time. I have a character who i want to walk left and right and when the character gets infront of certain things on this background image i would like to hit enter or up and for a movie clip to play overlaying the background image, which will load the text for that link. Does anyone have anyidea the actionscripting i would need for this? The character barely needs to move - the background is what should scroll left and right when the keys are pressed....

    I would REALLY appreciate any help at all.
    Thankyou!

  2. #2
    Qwaizang:syntax_entity_ Q__Hybrid's Avatar
    Join Date
    Aug 2005
    Posts
    270
    this won't help much, but if you're scrolling a very large background or even too many segments at one time, you're going to wind up with a really super slow framerate during playback.

    Break your background down into pieces and use an array of locations that represent where they are placed on the screen during a scroll. Only allow a piece of background to move when its array location can be seen on the screen.

    This means if the piece's _x property is less than negative _width, the movieClip stops moving but the location in the array continues to decrease during the scroll function. The same with _x greater than the width of the stage.

    See? That way only a few move and there's no slowdown.
    +Q__

  3. #3
    Avoiding the real world. NeedleInMySpine's Avatar
    Join Date
    May 2005
    Location
    Canada
    Posts
    188
    mabye look at tonypa's tutorials, they might be more comlicated than what you want to do but they could help.
    http://www.tonypa.pri.ee/
    Knowledge is power, power corrupts, study hard, be evil.

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