public void Play(int sheet) { this.sheet = sheet; Animation[] animation = new Animation[] { new Animation(0, spritesheets[sheet].totalFrames, spritesheets[sheet].loop) }; Vector2 pos = Vector2.Zero; if (anim != null) { pos = anim.position; } anim = new AnimSprite(spritesheets[sheet].sheet, spritesheets[sheet].frameSize, animation, spritesheets[sheet].sprite); anim.frameOffset += frameOffset; anim.SetFrame(0); anim.position = pos; if (spritesheets[sheet].autoplay) { anim.Play(0); } }
public void SetupAnimations() { collectorAnim = new AnimSet(CollectorAnimations()); collectorAnim.frameOffset = new Vector2(0, 135); collectorAnim.Play((int)States.Intro); Animation[] portalAnimations = { new Animation(0, 47, false) }; portalAnim = new AnimSprite("collector_portal", new Point(570, 200), portalAnimations); portalAnim.frameOffset.Y += 620; portalAnim.Play(0); Animation[] poofAnimations = { new Animation(0, 30, false) }; poofAnim = new AnimSprite("collector_poof", new Point(200, 150), poofAnimations); poofAnim.playing = false; Animation[] explodeAnimations = { new Animation(0, 48, false) }; explodeAnim = new AnimSprite("collector_explosion_particles", new Point(500, 500), explodeAnimations); explodeAnim.playing = false; explodeAnim.frameOffset.Y += 100; }
protected void SetupAnimations() { Animation[] pointerAnimations = { new Animation((int)Pointers.Alert, 6, false, (int)Pointers.Idle), new Animation((int)Pointers.Exit, 14, false), new Animation((int)Pointers.Enter, 43, false, (int)Pointers.Idle), new Animation((int)Pointers.Idle, 1), }; pointerAnim = new AnimSprite("user_pointer", new Point(70, 70), pointerAnimations); pointerAnim.Play((int)Pointers.Enter); Animation[] pointsAnimations = { new Animation(0, 50), new Animation(1, 50) }; pointsAnim = new AnimSprite("user_points", new Point(70, 70), pointsAnimations); pointsAnim.SetFrame(26); Animation[] stateAnimations = { new Animation((int)States.Pinch, 8), new Animation((int)States.BloatStart, 4,false, (int)States.Bloat), new Animation((int)States.BloatEnd, 4,false, (int)States.Idle), new Animation((int)States.Bloat, 8), new Animation((int)States.PinchStart, 4,false, (int)States.Pinch), new Animation((int)States.PinchEnd, 4,false, (int)States.Idle), new Animation((int)States.Idle, 1), }; stateAnim = new AnimSprite("user_bloat_pinch", new Point(70, 70), stateAnimations); stateAnim.Play((int)States.Idle); }
public EnemyBulger() : base() { drag = 10.0f; Animation[] stateAnimations = { new Animation(0, 48), new Animation(1, 48,false, 0), }; animation = new AnimSprite("enemy_bloat", new Point(85, 62), stateAnimations); }
public EnemyCrazy() : base() { velocity = Randomizer.RandomVelocity(2.0f); drag = 6f; Animation[] stateAnimations = { new Animation(0, 48) }; animation = new AnimSprite("enemy_bomb", new Point(85, 64), stateAnimations); }
public EnemyShooter() : base() { drag = 16.0f; Animation[] stateAnimations = { new Animation(0, 48), new Animation(1, 48,false, 0), }; animation = new AnimSprite("enemy_shooter", new Point(85, 64), stateAnimations); }
public Enemy() : base() { wrapY = true; height = 0; velocity = Randomizer.RandomVelocity(); position = new Vector2(Randomizer.RandomFloat(0, ScreenManager.window.X), -wrapBuffer); display = Randomizer.RandomDisplay(); dampening = 0.985f; addDelay = new Schedualizer(0, 1, 40); Animation[] stateAnimations = { new Animation(0, 40, false) }; explosion = new AnimSprite("enemy_explosion", new Point(100, 75), stateAnimations); }