View Single Post
djazz djazz's Avatar

JCF Member

Joined: Feb 2009

Posts: 257

djazz is OFF DA CHARTdjazz is OFF DA CHARTdjazz is OFF DA CHART

Oct 18, 2010, 10:47 PM
djazz is offline
Reply With Quote
Quote:
Originally Posted by Unknown Rabbit View Post
Oh, hey, DJazz! Did you ever figure out how layer speeds worked? I feel I'm really close to finding the right equation but I have a sign wrong somewhere or something like that.
I think so... here is some code from saving levels in WebJCS:
PHP Code:
$LayerXSpeed = array(3.3752.251110.250.1250);
$LayerYSpeed = array(3.3752.251110.250.1250);
$LayerAutoXSpeed = array(00000000);
$LayerAutoYSpeed = array(00000000);

foreach(
$LayerXSpeed as $v$Stream0.= pack("V"$v*65536);
foreach(
$LayerYSpeed as $v$Stream0.= pack("V"$v*65536);
foreach(
$LayerAutoXSpeed as $v$Stream0.= pack("V"$v*65536);
foreach(
$LayerAutoYSpeed as $v$Stream0.= pack("V"$v*65536); 
When loading use the same method but reverse (unpack and divide with 65536).
__________________
WebJCS 2 (new and in progress)
WebJCS 1 (old but complete)
SGIP Simple Games in Progress list
Level Packer v2 - With a GUI!
PHP Tileset Compiler