ok, aside from the “don’t reinvent the wheel” bit, I am writing my own scroller.
I have spent a number of hours going over planetation by zparticle(fantastic and a great learning tool)
but wanted to do my own on a lesser scale.
Anyway, my problem is npc’s walking around.
I have my avatar centered on the canvas. I translate the background image ( a group of isometric tiles)
then draw each tile, then draw my avatar centered. the tranlate back to draw layovers(menus, stats, etc)
I am hopelessly lost on when, how where to draw the npcs. If an npc is at x=100, y=100(walking at y+1) and I scroll
the background, his location is affect by that scroll.
He still walks along the y axis at +1 per update, but is now two buildings over because of the scroll.
here is my process…
create tiles ans set at postitions starting at 0,0, aligning them properly for isometric look and feel.
then I get the map width and height and set the avatar at half of each(centered on map)
I then calc a translation tx and ty to tranlate the map so avatar is centered on canvas/screen.
When I scroll north(for example) I scroll all background images(tiles only right now) the appropriate
1up and 2over(from zoggles isometric schema). Each tiles location is updated(then drawn at the appropriate time)
I missed something somewhere in my code design and my npc’s scroll all over the place.
Any suggestions?
M