Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-25-2004, 09:38 AM   #1
Registered User
Join Date: May 2004
Posts: 7
Default this is a difficult question (isometric scrolling)

this concerns isometric scrolling. ok. i need to keep the character always centered on a tile, no matter how much the user holds down the arrow key. I'm pretty sure that the problem can be solved by modifying this one simple formula:

ob.y += ob.speed*diry;

this basically means to change the isometric _y (ob.y) by how ever many pixels are specified in ob.speed, how ever many times the down arrow key is pressed (diry represents the arrow key being pressed.)

I've tried to change it to the following formula, which actually works wonderfully on a non-isometric map:

ob.y += (speed*diry)-(ob.y)/div;

Using this formula, speed is set to equal the tile width, and the numeric value assigned to div should actually control the speed of the scrolling. Actually, to be honest... I get the basic idea, but how dividing a number into the difference is supposed to control the scrolling I have no idea. The original source of this formula (the non-iso one that works wonderfully) says "we divide the difference by div to have an value that continues to change until the equation is true."

The problem: Without dividing by div, it kind of almost works but instead of scrolling, the map really just instantly moves that many pixels over. And the character doesn't stay centered in the tile. When dividing by div, it slows down the scrolling, but the character doesn't stay centered at all.

for reference:
Tile width (tileW) = 71
Speed, by my formula should also be 71, in the original is about 6 or whatever
div can be whatever

thanks so much in advance for any help
mrMeatbag is offline   Reply With Quote
Old 05-26-2004, 04:22 AM   #2
Registered User
Join Date: May 2004
Posts: 7

mrMeatbag is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:36 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.