Skip to content
Discussion options

You must be logged in to vote

By setting superInstance to a non-null value, you are telling scripts that it should change variables in the parent class, if any exist.

source

varobject:FlxSprite=newFlxSprite(100,0);
varscript:RuleScript=newRuleScript();
script.superInstance=object;
// ... script execute

script

trace(x); // 100, because sprite's x value is 100x=200;
trace(x) // 200, It will also change for the object

Replies: 1 comment 1 reply

Comment options

Kriptel
Dec 5, 2024
Maintainer

You must be logged in to vote
1 reply
@rodney528
Comment options

Answer selected byrodney528
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@rodney528@Kriptel