MysticDrow
July 10th, 2008, 02:12 PM
Hello,
I am programing a tile-based RPG game and I want the player's character to stay in the center of the screen while walking, scrolling the screen in the oposite direction instead of moving the char.
I'm an AS3 beginner and I didn't know that it would result in a great slowdown of the game, so first I tried just to move the whole world. Then I read about the scrollRect method but when I used it the speed didn't improve, even using cacheAsBitmap (it works only for a small scrolling area and I don't want my RPG to be gameBoy-sized). I tried some other things like moving each tile with a loop and even blocks of 50 tiles with 1ms intervals (that worked but looked strange). I even tried to copyPixel but I must be doing something wrong because it causes an ever greater slowdown. The problem is that I don't know how to copyPixel into a bitmap without creating a new BitmapData and then a new Bitmap. Right now each tile is a movieclip stopped in the corresponding frame with some properties I use for the pathfinding.
So now I don't know what to do and I need your help. I know there is some GAS scrolling method but I couldn't find how it works. There are some other advanced tricks out there but I don't understand them well, so I hope you could help me.
Any other methods would also be great. Anything that works for a scrolling screen at last, lets say, 600X500.
I am programing a tile-based RPG game and I want the player's character to stay in the center of the screen while walking, scrolling the screen in the oposite direction instead of moving the char.
I'm an AS3 beginner and I didn't know that it would result in a great slowdown of the game, so first I tried just to move the whole world. Then I read about the scrollRect method but when I used it the speed didn't improve, even using cacheAsBitmap (it works only for a small scrolling area and I don't want my RPG to be gameBoy-sized). I tried some other things like moving each tile with a loop and even blocks of 50 tiles with 1ms intervals (that worked but looked strange). I even tried to copyPixel but I must be doing something wrong because it causes an ever greater slowdown. The problem is that I don't know how to copyPixel into a bitmap without creating a new BitmapData and then a new Bitmap. Right now each tile is a movieclip stopped in the corresponding frame with some properties I use for the pathfinding.
So now I don't know what to do and I need your help. I know there is some GAS scrolling method but I couldn't find how it works. There are some other advanced tricks out there but I don't understand them well, so I hope you could help me.
Any other methods would also be great. Anything that works for a scrolling screen at last, lets say, 600X500.