package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;
import com.stencyl.models.Actor;
import com.stencyl.models.GameModel;
import com.stencyl.models.actor.Animation;
import com.stencyl.models.actor.ActorType;
import com.stencyl.models.actor.Collision;
import com.stencyl.models.actor.Group;
import com.stencyl.models.Scene;
import com.stencyl.models.Sound;
import com.stencyl.models.Region;
import com.stencyl.models.Font;
import com.stencyl.Engine;
import com.stencyl.Input;
import com.stencyl.Key;
import com.stencyl.utils.Utils;
import nme.ui.Mouse;
import nme.display.Graphics;
import nme.display.BlendMode;
import nme.display.BitmapData;
import nme.display.Bitmap;
import nme.events.Event;
import nme.events.KeyboardEvent;
import nme.events.TouchEvent;
import nme.net.URLLoader;
import box2D.dynamics.joints.B2Joint;
import motion.Actuate;
import motion.easing.Back;
import motion.easing.Cubic;
import motion.easing.Elastic;
import motion.easing.Expo;
import motion.easing.Linear;
import motion.easing.Quad;
import motion.easing.Quart;
import motion.easing.Quint;
import motion.easing.Sine;
import com.stencyl.graphics.shaders.BasicShader;
import com.stencyl.graphics.shaders.GrayscaleShader;
import com.stencyl.graphics.shaders.SepiaShader;
import com.stencyl.graphics.shaders.InvertShader;
import com.stencyl.graphics.shaders.GrainShader;
import com.stencyl.graphics.shaders.ExternalShader;
import com.stencyl.graphics.shaders.InlineShader;
import com.stencyl.graphics.shaders.BlurShader;
import com.stencyl.graphics.shaders.ScanlineShader;
import com.stencyl.graphics.shaders.CSBShader;
import com.stencyl.graphics.shaders.HueShader;
import com.stencyl.graphics.shaders.TintShader;
import com.stencyl.graphics.shaders.BloomShader;
class SceneEvents_0 extends SceneScript
{
public var _SCORE:Actor;
public function new(dummy:Int, engine:Engine)
{
super(engine);
nameMap.set("SCORE", "_SCORE");
}
override public function init()
{
/* ======================== When Creating ========================= */
playSoundOnChannel(getSound(67), Std.int(1));
/* ======================== When Creating ========================= */
setGameAttribute("scorecounter", 0);
/* ======================== When Creating ========================= */
hideMobileAd();
/* ============================ Click ============================= */
addMouseReleasedListener(function(list:Array<Dynamic>):Void
{
if (wrapper.enabled)
{
getActor(15).disableBehavior("Follow Drag and Drop");
}
});
/* ======================== Actor of Type ========================= */
addActorEntersRegionListener(getRegion(2), function(a:Actor, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(4),a.getType(),a.getGroup()))
{
getRegion(1).setLocation(0, 0);
getRegion(3).setLocation(0, 0);
}
});
/* ========================= When Drawing ========================= */
addWhenDrawingListener(null, function(g:G, x:Float, y:Float, list:Array<Dynamic>):Void
{
if (wrapper.enabled)
{
g.setFont(getFont(39));
g.drawString("" + getGameAttribute("scorecounter"), 450, 9);
g.drawString("" + "SCORE", 270, 9);
}
});
/* ======================== Actor of Type ========================= */
addCollisionListener(getActor(15), function(event:Collision, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(6), event.otherActor.getType(),event.otherActor.getGroup()))
{
setGameAttribute("scorecounter", (getGameAttribute("scorecounter") + 1));
}
});
/* ======================== Actor of Type ========================= */
addActorEntersRegionListener(getRegion(3), function(a:Actor, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(4),a.getType(),a.getGroup()))
{
getRegion(1).setLocation(797, 15);
}
});
/* ============================ Click ============================= */
addMouseReleasedListener(function(list:Array<Dynamic>):Void
{
if (wrapper.enabled)
{
recycleActor(getActor(12));
}
});
/* ======================== Actor of Type ========================= */
addActorEntersRegionListener(getRegion(1), function(a:Actor, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(4),a.getType(),a.getGroup()))
{
getActor(15).moveTo(300, 200, 3, Linear.easeNone);
createRecycledActor(getActorType(26), 540, 260, Script.FRONT);
}
});
/* ======================= After N seconds ======================== */
runLater(1000 * 20, function(timeTask:TimedTask):Void
{
if (wrapper.enabled)
{
showMobileAd();
}
}, null);
/* ======================== Actor of Type ========================= */
addCollisionListener(getActor(15), function(event:Collision, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(10), event.otherActor.getType(),event.otherActor.getGroup()))
{
runLater(1000 * 5, function(timeTask:TimedTask):Void
{
createRecycledActor(getActorType(34), getActor(2).getXCenter(), 222, Script.FRONT);
getActor(15).setY(-333);
getCamera().setLocation(getActor(2).getXCenter(), getActor(2).getYCenter());
}, null);
}
});
/* ======================== Actor of Type ========================= */
addCollisionListener(getActor(15), function(event:Collision, list:Array<Dynamic>):Void
{
if (wrapper.enabled && sameAsAny(getActorType(10), event.otherActor.getType(),event.otherActor.getGroup()))
{
runLater(1000 * .8, function(timeTask:TimedTask):Void
{
recycleActor(getActor(10));
}, null);
runLater(1000 * 5.9, function(timeTask:TimedTask):Void
{
createRecycledActor(getActorType(40), 450, 44, Script.FRONT);
showMobileAd();
}, null);
runLater(1000 * 8, function(timeTask:TimedTask):Void
{
createRecycledActor(getActorType(59), 488, 166, Script.FRONT);
createRecycledActor(getActorType(61), 419, 200, Script.FRONT);
createRecycledActor(getActorType(63), 200, 188, Script.FRONT);
createRecycledActor(getActorType(26), 838, 230, Script.FRONT);
}, null);
}
});
/* ======================== Actor of Type ========================= */
addWhenTypeGroupKilledListener(getActorType(6), function(eventActor:Actor, list:Array<Dynamic>):Void
{
if (wrapper.enabled)
{
playSound(getSound(71));
}
});
/* =========================== On Actor =========================== */
addMouseOverActorListener(getActor(15), function(mouseState:Int, list:Array<Dynamic>):Void
{
if (wrapper.enabled && 5 == mouseState)
{
runLater(1000 * 6, function(timeTask:TimedTask):Void
{
showMobileAd();
}, null);
if (getActor(10).isAlive())
{
runLater(1000 * 8, function(timeTask:TimedTask):Void
{
createRecycledActor(getActorType(26), getActor(15).getXCenter(), 222, Script.FRONT);
stopAllSounds();
runLater(1000 * .5, function(timeTask:TimedTask):Void {
playSoundOnChannel(getSound(66), Std.int(4));}, null);
}, null);
}
}
});
}
override public function forwardMessage(msg:String)
{}}