play() 공개 메소드

public play ( string animName, bool forced = false ) : void
animName string
forced bool
리턴 void
예제 #1
0
    public LungLevel()
    {
        background_ = new FAnimatedSprite("Lungs_Background");
        int[]      breathing_frames    = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        FAnimation breathing_animation = new FAnimation("breathing", "Lungs_Background", breathing_frames, 250, true);

        background_.addAnimation(breathing_animation);
        background_.play("breathing");

        AddChild(background_);

        dust_container_size_ = new Rect(-Futile.screen.halfWidth * 2.5f, -Futile.screen.halfHeight * 2.5f, Futile.screen.width * 2.5f, Futile.screen.height * 2.5f);

        dust1_ = new Dust("Dust_4", dust_container_size_);
        AddChild(dust1_);

        tubes1_ = new FSprite("Lungs_Rear");
        AddChild(tubes1_);
        tubes2_ = new FSprite("Lungs_MidBack1");
        AddChild(tubes2_);

        dust2_ = new Dust("Dust_3", dust_container_size_);
        AddChild(dust2_);

        tubes3_ = new FSprite("Lungs_MiddleFore");
        AddChild(tubes3_);
        tubes4_ = new FSprite("Lungs_Fore");
        AddChild(tubes4_);

        dust3_ = new Dust("Dust_2", dust_container_size_);
        AddChild(dust3_);
    }
예제 #2
0
    public LungLevel()
    {
        background_ = new FAnimatedSprite("Lungs_Background");
        int[] breathing_frames = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        FAnimation breathing_animation = new FAnimation("breathing", "Lungs_Background", breathing_frames, 250, true);
        background_.addAnimation(breathing_animation);
        background_.play("breathing");

        AddChild(background_);

        dust_container_size_ = new Rect(-Futile.screen.halfWidth*2.5f, -Futile.screen.halfHeight*2.5f, Futile.screen.width*2.5f, Futile.screen.height*2.5f);

        dust1_ = new Dust("Dust_4", dust_container_size_);
        AddChild(dust1_);

        tubes1_ = new FSprite("Lungs_Rear");
        AddChild(tubes1_);
        tubes2_ = new FSprite("Lungs_MidBack1");
        AddChild(tubes2_);

        dust2_ = new Dust("Dust_3", dust_container_size_);
        AddChild(dust2_);

        tubes3_ = new FSprite("Lungs_MiddleFore");
        AddChild(tubes3_);
        tubes4_ = new FSprite("Lungs_Fore");
        AddChild(tubes4_);

        dust3_ = new Dust("Dust_2", dust_container_size_);
        AddChild(dust3_);
    }
    // Update is called once per frame
    void Update()
    {
        _time += Time.deltaTime;

        if (_time > 5.0f)
        {
            if (burglar.currentAnim.name == "run")
            {
                burglar.play("idle");
            }
            else
            {
                burglar.play("run");
            }

            _time -= 5.0f;
        }
    }
예제 #4
0
    public HitSwitch(string doorName, string name, World world)
        : base(new RXRect(0, 0, 10,10), world)
    {
        this.handleStateCount = true;
        this.blocksOtherObjects = true;
        this.doorName = doorName;
        this.name = name;
        sprite = new FAnimatedSprite("HitSwitch/switch");
        sprite.addAnimation(new FAnimation("idle", new int[] { 1 }, 100, false));
        sprite.addAnimation(new FAnimation("activate", new int[] { 1,1,1,1,2, 3 }, 150, false));
        sprite.addAnimation(new FAnimation("activated", new int[] {3 }, 150, false));
        sprite.play("idle");
        sprite.ignoreTransitioning = true;
        this.AddChild(sprite);

        if (C.Save.switchesActivated.Contains(this.name))
        {
            pressed = true;
            sprite.play("activated");
        }
    }
예제 #5
0
 public override void Update()
 {
     if (this.GamePage.leftArrow)
     {
         facingLeft    = true;
         sprite.scaleX = -1.0f;
         gameObject.transform.position = new Vector3(gameObject.transform.position.x - 0.1f, gameObject.transform.position.y, gameObject.transform.position.z);
         sprite.play("walking");
     }
     else
     if (this.GamePage.rightArrow)
     {
         facingLeft    = false;
         sprite.scaleX = 1.0f;
         gameObject.transform.position = new Vector3(gameObject.transform.position.x + 0.1f, gameObject.transform.position.y, gameObject.transform.position.z);
         sprite.play("walking");
     }
     else
     {
         sprite.play("standing");
     }
 }
예제 #6
0
 public MagicOrb(FNode owner, World world)
     : base(new RXRect(0, 0, 5, 5), world)
 {
     this.useActualMaxVel = true;
     maxVel = 2;
     this.bounceiness = 1f;
     this.owner = owner;
     handleStateCount = true;
     collidesWithWater = false;
     sprite = new FAnimatedSprite("Magic Orb/magic_orb");
     sprite.addAnimation(new FAnimation("idle", new int[] { 1, 2 }, 150, true));
     sprite.play("idle");
     this.AddChild(sprite);
     this.xVel = RXRandom.Float() * .5f - .25f;
     this.yVel = RXRandom.Float() * .5f - .25f;
     FSoundManager.PlaySound("orbShoot");
 }
예제 #7
0
	// Use this for initialization
	void Start () {

        FutileParams futileParams = new FutileParams(true, false, false, false);
        futileParams.AddResolutionLevel(568.0f, 1.0f, 1.0f, ""); // Scale up to 1136

        futileParams.origin = new Vector2(0.5f, 0.5f);
        futileParams.backgroundColor = new Color(0, 0, 0);
        futileParams.shouldLerpToNearestResolutionLevel = true;

        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadAtlas("Atlases/NinjaCircuitAtlas");

        FAnimatedSprite test = new FAnimatedSprite("player");
        test.addAnimation(new FAnimation("run", new int[] { 1,2 },100,true));
        test.play("run");
        Futile.stage.AddChild(test);

	}
예제 #8
0
    /*
     * El enemigo se mueve hacia la direccion que tiene asignada.
     */

    public override void Update()
    {
        if (direction > 0)
        {
            sprite.scaleX = 1f;
            gameObject.transform.position = new Vector3(gameObject.transform.position.x + speed, gameObject.transform.position.y, gameObject.transform.position.z);
        }
        else
        {
            sprite.scaleX = -1f;
            gameObject.transform.position = new Vector3(gameObject.transform.position.x - speed, gameObject.transform.position.y, gameObject.transform.position.z);
        }
        sprite.play("enewalk");

        if (life <= 0)
        {
            generateParticles();
            Destroy();
        }
    }
예제 #9
0
    public Player(World world)
        : base(new RXRect(0, -5, 12, 7), world, "playerShadow")
    {
        int animSpeed = 200;
        int attackSpeed = 100;
        sprite = new FAnimatedSprite("player");
        bounceiness = 0;
        ResetMaxVel();
        handleStateCount = true;
        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.IDLE + "1", new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1 }, animSpeed, false));
        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.IDLE + "2", new int[] { 10, 1 }, 1500, false));
        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.IDLE + "3", new int[] { 1, 10, 11, 10, 1 }, animSpeed, false));
        sprite.addAnimation(new FAnimation(Direction.UP.ToString() + State.IDLE, new int[] { 4 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.LEFT.ToString() + State.IDLE, new int[] { 7 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.RIGHT.ToString() + State.IDLE, new int[] { 7 }, animSpeed, true));

        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.MOVING, new int[] { 1, 2, 1, 3 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.UP.ToString() + State.MOVING, new int[] { 4, 5, 4, 6 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.LEFT.ToString() + State.MOVING, new int[] { 7, 8 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.RIGHT.ToString() + State.MOVING, new int[] { 7, 8 }, animSpeed, true));

        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.ATTACKING, new int[] { 17, 18 }, attackSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.UP.ToString() + State.ATTACKING, new int[] { 19, 20 }, attackSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.LEFT.ToString() + State.ATTACKING, new int[] { 21, 22 }, attackSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.RIGHT.ToString() + State.ATTACKING, new int[] { 21, 22 }, attackSpeed, true));

        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.TAKE_DAMAGE, new int[] { 12 }, animSpeed, false));
        sprite.addAnimation(new FAnimation(Direction.UP.ToString() + State.TAKE_DAMAGE, new int[] { 13 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.LEFT.ToString() + State.TAKE_DAMAGE, new int[] { 14 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.RIGHT.ToString() + State.TAKE_DAMAGE, new int[] { 14 }, animSpeed, true));

        sprite.addAnimation(new FAnimation(Direction.DOWN.ToString() + State.DYING, new int[] { 25 }, animSpeed, false));
        sprite.addAnimation(new FAnimation(Direction.UP.ToString() + State.DYING, new int[] { 25 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.LEFT.ToString() + State.DYING, new int[] { 25 }, animSpeed, true));
        sprite.addAnimation(new FAnimation(Direction.RIGHT.ToString() + State.DYING, new int[] { 25 }, animSpeed, true));

        sprite.play(Direction.UP.ToString());
        this.AddChild(sprite);
    }