Skip to content

Visual bug in http://www.zefrank.com/showcase/maya/index.html #7261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pgnj99 opened this issue Jun 19, 2022 · 2 comments · Fixed by #9616
Closed

Visual bug in http://www.zefrank.com/showcase/maya/index.html #7261

pgnj99 opened this issue Jun 19, 2022 · 2 comments · Fixed by #9616
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) bug Something isn't working

Comments

@pgnj99
Copy link

pgnj99 commented Jun 19, 2022

Describe the bug

In the animation linked below, the planets are meant to orbit around the sun. Instead, they seem to all be stuck in the sun's position.
http://www.zefrank.com/showcase/maya/index.html

Ruffle.-.sun4.swf.2022-06-19.17-32-12.mp4

Expected behavior

Adobe.Flash.Player.32.2022-06-19.17-33-39.mp4

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

@pgnj99 pgnj99 added the bug Something isn't working label Jun 19, 2022
@Toad06
Copy link
Member

Toad06 commented Jun 29, 2022

Thanks for the report.

It seems like Ruffle has issues accessing some variables.
For instance, in \DefineSprite (16: ball)\frame 1\DoAction:

// Lines added for testing

if(_root.test == undefined) {
   _root.test = 1;
}
if(_root.test < 50) {
   trace(count);
   trace(eval(tar));
   trace(depth);
   trace(r);
   trace("");
   _root.test = _root.test + 1;
}


// Actual code

count = count + speed;
this._x = eval(tar)._x + Math.cos(count) * r;
this._y = eval(tar)._y + Math.sin(count) * 4;
this._xscale = (Math.sin(count) + 3) / 2 * 50;
this._yscale = (Math.sin(count) + 3) / 2 * 50;
prev = Math.cos(count);
depth = Math.round(400 + Math.sin(count) * r) + 5;
if(depth == 400) {
   depth = 401;
}
this.swapDepths(depth);
moon.gotoAndStop(41 - Math.floor((Math.sin(count) + 1) * 20));

Flash Player traces on the first iteration (test == 1):

-6.28318530717959
_level0.instance4700.planet.sun
undefined
101 (random number)

Flash Player traces on the last iteration (test == 49):

-0.997197551196598
_level0.instance4700.planet.sun
141
314

Ruffle traces on the first iteration:

undefined
undefined
undefined
undefined

Ruffle traces on the last iteration:

0
undefined
405
undefined


Prefixing these variables with _parent. seems to fix the issue in Ruffle, but Flash Player disagrees:

trace(_parent);
trace(_parent.count);
trace(eval(_parent.tar));
trace(_parent.depth);
trace(_parent.r);

Flash Player traces on the first iteration:

_level0.instance4701.planet
undefined
undefined
undefined
undefined

Ruffle traces on the first iteration:

_level0.instance49.planet
-0.698131700797732
_level0.instance49.planet.sun
undefined
489 (random number)

@Toad06 Toad06 added the A-avm1 Area: AVM1 (ActionScript 1 & 2) label Jun 29, 2022
@Toad06
Copy link
Member

Toad06 commented Jun 29, 2022

Scratch my previous post, in fact the values are not set because the following code in \DefineSprite (19: sun1)\frame 1\DoAction doesn't work as expected:

i = 1;
while(i < numplanets)
{
   attachMovie("ball","ball" + i,i);
   this = eval("ball" + i); // <-- this line
   this.tar = "_parent.sun";
   this.speed = 0.01;
   // (...)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants