Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Sidescroller Bkrd
Author: RanMan
| Website: www.randyrooonline.com |
The Code
onClipEvent (enterFrame) {
// When the right key is down, it starts scrolling left.
if(Key.isDown(Key.RIGHT)) {
this._x=_x-25;
}
}
onClipEvent (enterFrame) {
// When the left key is down, it starts scrolling right.
if(Key.isDown(Key.LEFT)) {
this._x=_x+25;
}
}
Playing With The Code
Change Scroll Speed:
Change the 25.
Change scroll button:
Change LEFT to RIGHT
OR
Change RIGHT to LEFT
Explaining Code
That is just a movement code reversed. It is very easy.
Try to explain code even farther
MMMkaay. This snippet:
this._x=_x-25;
means x wil go backward (-). The minus means go backward.
This snippet:
this._x=_x+25;
means x will go foreward (+). The plus means go foreward.
| » Level Basic |
|
|
Added: : 2006-04-23
Rating: 1.87 Votes: 15
Hits: 685
|
| » Author |
|
I have taken some great haymakers since over 7 of my games have been slaughtered. One took me 3 months to make.
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (0 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|