i was just wondering, because i'm trying to port my shinobi-like into tile based method, what is the best way to synchronise animated tiles?
because if i'm using the attach/remove or gotoAndPlay method to create tiles during the scrolling, of course it will not working, new tiles will begin naturally their animation at frame 1.
There's a possibility of using a _visible method, why not, but in that case there will be way too much tiles that are animated (using a gotoAndStop("loop") at the same time).
i also have the possibility to create custom tiles (254x32 for example to limit the simultaneous gotoAndPlay factor), but tiles will show properly only when you scroll from right to left... it's logical
here's the example: http://www.marmotte.levillage.org/_e..._progress.html
it's a mix between tile based and art based for the moment, look at the animated water (to the right) and tell me, if you know what i mean, what's the best way to translate it into synchronised tiles.
i've been playing your demo for soo long, trying to feind any bugs!
FOUND ONE (not that it's a big thing, but i've been checking it for soo long!)
If you press, Left, Right and CTRL at the same time repeatedly, when you are in the middle of the map, the character kind of reappears on the far left...
If you don't know what i mean, ill do screen shots and keyboard presses............
lol, im a bug sniffer! (no, NOT BUTT...sick people)
not that i know much about animated tiles and such (which maybe gives me the best vantage point...that of the ignorant gamer!) but the water tiles look fine to me...I'm not sure what your suggesting the problem is.
the_xell:
As far as that bug...LOL, of course if you smash all the gameplay buttons repeatedly something buggy will happen!! duh! LOL...but i did see your "bug" the player like vanishes and reappears a few pixels to the left.
About synchronizing tiles. When building a new column of tiles if you can access the tiles of the column right before it you could check their _currentframe and have the tiles in your new column start there or 1 frame behind or ahead depending on how you want to synchronize them.
The_Xell
wow, i didn't that my small demo impressed you that much! ^^
in fact i had that problem a lot of times, sometimes only by walking left then right.
i think i did a little mistake with the _x pos of the character, but it will be fixed once the engine will be more advanced... thanks for "playing" it so far. i guess i'll have to continue that project a little bit, huh? creating sprites takes so much time...
chuckles
ah, the problem is not in that file; i tried to adapt the posted example into tiles, which gave me that synchro problem
Kirill M.
i was thinking about something like that, hoping all that actions each time will not slow down too much the smoothness of the game... and also the fact to track the _currentframe of a tile "xy" near left or right (depending of the scrolling direction) is not that easy to code...
of course, i can do a background more art based (loaded like a tile method on load) and keep the tile-like hitTest...
I probably worded my answer in a bad way. You wouldn't have to check every tile in an adjacent column when making the new column, just those tiles that are animated. You could give animated tiles a property like "anim" which would tell if it's animated or not and if it is and the tile you'll place right next to it is, you check it's _currentframe for synchronization. If you don't have a lot of animated tiles this probably won't slow down your engine too much.
"and also the fact to track the _currentframe of a tile "xy" near left or right (depending of the scrolling direction) is not that easy to code..."
The scrolling is only done in one direction at a time, you could make a function to do the scrolling which would take a direction as the argument and scroll in that direction. Then you'd always know which column of tiles to check for the animated tiles and their _currentframe. So as you're scrolling left and building a column say at j index 5 you know you have to check the tiles at j index 4. Then as you move down the column at j index 5 you do an additional check of the tile at the same i index but at j index 4 for the anim attribute and then _currentframe if both of the tiles (at j index 5 and j index 4)are animated.
To make the tast of referencing the tile at xy easier on yourself you could make an object for a tile would store all the info about it and then store that object in your map array.
Say there is this object called tile and it contains members bool anim and MovieClip tileMC, and you have these objects stored in your map array.
PHP Code:
//This would be used when scrolling left
//The code for scrolling right could be easily obtained from this.
for(var i=0;i<columnSize;i++)
{
if(map[i][leftJ].anim && map[i][leftJ+1].anim)
{
map[i][leftJ].tileMC.gotoAndPlay(map[i][leftJ+1].tileMC._currentframe);
}
}
This just takes care of the part where it would do animated tile synchronization you'd have to do all the other stuff where you attach the new tile and assign it to map[i][leftJ].tileMC and so on. LeftJ in this case is the j index of the next left column; you'd also have to keep rightJ, j index of the next right column for scrolling right and update both of them appropriately after you scroll.
i'll see what i can do, your two examples are good.
i'm still not too familiar with tile games; i understand how it works but not fully yet...
maybe the WilloughbyJackson's idea will be faster though... with a gotoAndPlay(frameVar) at the begining of each animated tile, although the counter has to be claculated each frame. And with Kirill M. example, it's calculated only when you moved 32 pixels (this is the size of my tiles, 32x32)
and that should work. where the tiles clip has each tile with the animation named 'gfx'.
Edit: The problem with Kiril's idea is if a column has NO animated tiles it wont work, and it wont work if the number of animated frames is different on differnet tiles.
Wow Marmotte that is some damn good pixel art. I was thinking about having a go art some pixel art, could fit it in with drawing iso tiles and anime. What program do you use, Paint Shop or Photoshop?
Morb.
- In the darkness lies your fears -
Http://www.gawentertainment.com
Hey marmotte great game cant wait to see the finished version
Found a lil prob with the jumping though. When u hold down jump and right and move across the level at a certian stage in the level his jumping stuffs up[ and he flips around. Just thought you should know.
But other then that awsome graphics and great game Kepp up the awsome work.
hey marmotte. i have a problem for my game at: http://flashkit.com/board/showthread...hreadid=427685 see how when the map reaches the edge, the ufo doesnt have freeplay to go where he wants? i noticed in your game, when the character reaches the edge, he can still run, until he returns to the point you specified. how did you do that? or do you have a better way that maybe you could share with me? cause im stumped. thanks..
-frank
btw.. your game looks awesome.. ill be keeping track of this one for sure!
Originally posted by marmotte ^^ ^^ ^^
haha! what a real fan you are!
don't worry the_xell, the graphics you have here are in no way finished!
i'll add stones, flowers, mountains etc etc...
once i'll have the engine done, i'll do better graphics! tadaaa!
(are you in love with that more than little demo?)
LOL, i am marmotte!
Seriosly, your previous games are so well put together, it's difficult to find any bugs or graphical errors (i'm not lookin for them but its the fact that its such a well put together game)
And as for this demo, its amazing.... seriously, i'm dying here waiting for the final game!