Little Fighter Empire - Forums
Screen Speed - Printable Version

+- Little Fighter Empire - Forums (https://lf-empire.de/forum)
+-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7)
+--- Forum: LF2 Discussion (https://lf-empire.de/forum/forumdisplay.php?fid=8)
+--- Thread: Screen Speed (/showthread.php?tid=4597)



Screen Speed - Magnamancy - 03-14-2010

A fairly simple question, but we don't seem to have a General Q&A thread.
:p

Well anyways, here's my question:
How fast can the play-screen move?

The screen doesn't 'stick to' the player so much as follow them, and I'm
not asking that the screen's speed be changed (which would really dictate
I post this in the HEX section :D) I'd just like to know how fast the screen
can go before the player outruns it and vanishes off screen.

Doesn't have to be exact either, relative/vague terms are fine. ^^

Also, if no-one's actually checked this out I can always just figure it out
myself, when I've got the time ofc.
If you're curious as to why, I'm thinking about epic style moves, but it'll be
of no use if you can't see them. :D


RE: Screen Speed - prince_freeza - 03-14-2010

(03-14-2010, 09:26 AM)Magnamancy Wrote:  How fast can the play-screen move?
The screen doesn't 'stick to' the player so much as follow them,

yeah it goes fast at first then starts going faster after a while and so on...


RE: Screen Speed - Silverthorn - 03-14-2010

Yeh, as freeza said, it's not a continuously equal camera-movement-speed but it's accelerating/decelerating according to the distance of the player to the center (or approximately at least). Personally, I haven't tested out how fast you'll have to be to leave the screen (as fast as possible), but I suspect it to be around the running_speed of 30-40. Don't know how exactly it translates into dvx-values (as those movements accelerate at first, too), but yeah, that's the subject for you to try out :P


RE: Screen Speed - Azriel - 03-15-2010

exact position calculation:

take the average of all (players that are alive)'s x coordinates (on the same computer), store it in avgX

next variable, start with 0, and add 1 for every player facing right, and subtract 1 for every player facing left, store this in facing

let xLimit be where we want the camera to move to, screenW be 792 (lf2 window width), and halfW= 792/2 = 396.

also, let numPlayers be the number of alive players on the current computer

the calculation for xLimit is:
xLimit=
(facing × screenW) / (numPlayers × 6) - (halfW + avgX)

if xLimit < 0, then xLimit = 0
if xLimit > background's width - screenW then xLimit = background's width - screenW


kayz so that's where the camera will scroll to assuming the characters don't move from their current positions. but since we want to implement a smooth scroll (the dvx: of the camera), instead of making the camera's x position = xLimit, we would do:

x = currentX + (xLimit - currentX position) / 8

---

I'm 80% sure that that's the exact algorithm that lf2 uses (i know xLimit is exactly the same as lf2's, but not sure about the x scrolling speed. if any of you still have the java HQ running, then you could check by running them side by side



Azriel~