-
[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?
-
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
-
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.
-
Professional Air Guitarist
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!!!
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|