-
[HELP] Moving Scene
I making a 2-D game I need the code to make it where I have the sprite in the middle of the screen and when I choose these directions the screen moves that direction and the sprite stays in the middle
forward-W
backward-S
left-A
right-D
please help
Ce-Bro Productions, an online game making a web comic community
Ce-Bro.com
-
Hey Timmy!!!
just add the code. And change the guy to whatever the background is called
_root.onEnterFrame = function() {
if (Key.isDown(Key.UP)) {
_root.guy._y -= 1;
}
if(Key.isDown(Key.DOWN)){
_root.guy._y+=1
}
if(Key.isDown(Key.RIGHT)){
_root.guy._x+=1
}
if(Key.isDown(Key.LEFT)){
_root.guy._x-=1
}
};
-
Expression could not be resolved on line 10 _root.onEnterFrame = function()
I dont know what happened?
Ce-Bro Productions, an online game making a web comic community
Ce-Bro.com
-
Hey Timmy!!!
Did you but the { on that line. And also in the code I fogot you were using asdw. So change the up to W, down to S, left to A and right to D. Sorry bout that.
-
Im not sure what you mean by
Did you but the { on that line
all I did was copy and paste what the code was, and change the keys.
Ce-Bro Productions, an online game making a web comic community
Ce-Bro.com
-
Hey Timmy!!!
Okay, is the code you pasted on the main timeline or on the movieclip?
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
|