A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [help] scrolling (advanced question for me)

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    9

    [help] scrolling (advanced question for me)

    first off, take a look at this tutorial i got from tonypa.
    http://www.tonypa.pri.ee/tbw/tut14.html

    now instead of tiles, wondering if someone can explain it, or the original creater. lets use an example of lets say...super mario brothers. how would you write the script of just the background scrolling as you move? i keep thinking it'd have to do with "if root guy on keydown left, then background move -x direction". but i dunno how to write it like that...can anyone fill me in if possible?

  2. #2
    Junior Member
    Join Date
    Jun 2004
    Location
    Ipswich,MA
    Posts
    26
    well, yes i know try this code

    onClipEvent (load) {
    if (Key.isDown(Key.RIGHT)) {
    if (!_root.ground.hitTest(_x+speed, _y-stepsize, true)) {
    _root.fjell._x -= speed/3;
    _root.ground._x -= speed;
    }
    }
    hopefully that will help
    -Joopson
    add it to your guy
    the time i had gas

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    9
    hmm i tryed to copy the code down and edit it from the action screen, but said errors cannot be copied into normal code. so yeah...looks like theres errors, i tried editing as a seperate text file and still doesnt work.

  4. #4
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    code:

    onClipEvent (load) {
    if (Key.isDown(Key.RIGHT) && !_root.ground.hitTest(_x+speed, _y-stepsize, true)) {
    _root.fjell._x -= speed/3;
    _root.ground._x -= speed;
    }
    }


    THURR YAH GO!!!

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Posts
    9
    tried it, but i cant get it working, added my speeds in, and my guy wouldnt move. i added in a gotoAndPlay so he can play the walk animation but that didnt work, any other ideas?

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