Example #1
0
        public Script(Vector2f position, ScriptDef scriptDef)
        {
            RectShape = new RectangleShape { Position = position };

            ScriptDef = scriptDef;

            LoadState(ScriptDef.sStartState);
        }
Example #2
0
        public ScriptDef(ScriptDef copy)
        {
            Name = copy.Name;
            Ref = copy.Ref;

            ScriptStates = new Dictionary<string, ScriptState>();
            foreach (var copyScriptState in copy.ScriptStates) {
                ScriptStates.Add(copyScriptState.Key, new ScriptState(copyScriptState.Value));
            }
            Variables = new Dictionary<string, object>();
            foreach (var variable in copy.Variables) {
                Variables.Add(variable.Key, variable.Value);
            }

            sFollowCamera = copy.sFollowCamera;
            sStartState = copy.sStartState;
            sAttachPhysicsBody = copy.sAttachPhysicsBody;
            sJumpMaxCount = copy.sJumpMaxCount;
            sGravity = copy.sGravity;
            sMaxScript = copy.sMaxScript;
            sRemoveAtPos0 = copy.sRemoveAtPos0;
            sDynamic = copy.sDynamic;
        }
Example #3
0
 public void AddScriptDef(ScriptDef scriptDef)
 {
     ScriptDefs.Add(scriptDef.Ref, scriptDef);
 }