public void GoToPage(PageType pageType)
    {
        RXDebug.Log("Here i am changing the page");
        if (_currentPageType == pageType)
        {
            return;
        }

        Page pageToCreate = null;

        if (pageType == PageType.MenuPage)
        {
            pageToCreate = new MenuPage();
        }
        if (pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if (pageToCreate != null)
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
示例#2
0
文件: Game.cs 项目: riktothepast/LD29
    public void GoToPage(PageType pageType)
    {
        Page pageToCreate = null;

        if(pageType == PageType.MainMenuPage)
        {
            pageToCreate = new MainMenuPage();
        }

        if(pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if(pageToCreate != null)
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();

        }
    }
示例#3
0
    public void GoToPage(TPageType pageType)
    {
        if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything

        TPage pageToCreate = null;

        if(pageType == TPageType.PagePlayerSelect)
        {
            pageToCreate = new PlayerSelectPage();
        }
        else if (pageType == TPageType.PageInGame)
        {
            pageToCreate = new InGamePage();
        }
        else if (pageType == TPageType.PageResults)
        {
            pageToCreate = new PlayerSelectPage();
        }

        if(pageToCreate != null) //destroy the old page and create a new one
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _currentPage.Destroy();
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
    public void GoToPage(PageType pageType)
    {
        RXDebug.Log("Here i am changing the page");
        if(_currentPageType == pageType) return;

        Page pageToCreate = null;

        if(pageType == PageType.MenuPage)
        {
            pageToCreate = new MenuPage();
        }
        if(pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if(pageToCreate != null)
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();

        }
    }
示例#5
0
文件: Main.cs 项目: jrendel/LD27
    public void GoToPage(PageType pageType)
    {
        if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything

        BasePage pageToCreate = null;

        if(pageType == PageType.TitlePage)
        {
            pageToCreate = new TitlePage();
        }
        if(pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }
        else if (pageType == PageType.ScorePage)
        {
            pageToCreate = new ScorePage();
        }

        if(pageToCreate != null) //destroy the old page and create a new one
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _currentPage.Destroy();
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
示例#6
0
文件: Game.cs 项目: riktothepast/LD29
    public void GoToPage(PageType pageType)
    {
        Page pageToCreate = null;

        if (pageType == PageType.MainMenuPage)
        {
            pageToCreate = new MainMenuPage();
        }

        if (pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if (pageToCreate != null)
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
示例#7
0
    public void GoToPage(BPageType pageType)
    {
        if(_currentPageType == pageType) {
            return;
        } //we're already on the same page, so don't bother doing anything

        BPage pageToCreate = null;

        if(pageType == BPageType.MenuPage) {
            pageToCreate = new MenuPage();
        }else if(pageType == BPageType.InGamePage) {
            pageToCreate = new InGamePage();
        }

        if(pageToCreate != null) { //destroy the old page and create a new one
            _currentPageType = pageType;

            if(_currentPage != null) {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
示例#8
0
    public void GoToPage(BPageType pageType)
    {
        if (_currentPageType == pageType)
        {
            return;
        } //we're already on the same page, so don't bother doing anything

        BPage pageToCreate = null;

        if (pageType == BPageType.MenuPage)
        {
            pageToCreate = new MenuPage();
        }
        else if (pageType == BPageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if (pageToCreate != null)  //destroy the old page and create a new one
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
示例#9
0
 public void destroyShip()
 {
     this.RemoveFromContainer();
     healthBar.RemoveFromContainer();
     energyBar.RemoveFromContainer();
     InGamePage.LivingPlayers[player - 1] = false;
     InGamePage.checkForWin();
 }
示例#10
0
    public void Init(Vector2 startPos, InGamePage container)
    {
        gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS, startPos.y * FPhysics.POINTS_TO_METERS, 0);

        sprite = new FSprite(Futile.atlasManager.GetElementWithName("man"));
        sprite.SetPosition(startPos);

        container.persons.AddChild(holder = new FContainer());
        holder.AddChild(sprite);

        InitPhysics();

        holder.ListenForUpdate(HandleUpdate);
    }
示例#11
0
    public InGamePage()
    {
        instance = this;

        if (DogfighterMain.instance.musicOn == true)
        {
            FSoundManager.PlayMusic("Music/Corneria", 0.2f);
        }

        background = new FSprite("Original_Starfield.png");
        // eventually this will change to 1080
        background.scaleY = (Futile.screen.height / 1050.0f);
        // eventually this will change to 1920
        background.scaleX = (Futile.screen.width / 1680.0f);
        AddChild(background);

        /* Removed for HTML release. */
        primaryFireButton                = new FButton("Holding_Circle_Unselected.png");
        primaryFireButton.x              = 25 - (Futile.screen.width / 2);
        primaryFireButton.y              = 25 - (Futile.screen.height / 2);
        primaryFireButton.scale          = 0.25f;
        primaryFireButton.SignalPress   += primaryFireButtonPress;
        primaryFireButton.SignalRelease += primaryFireButtonRelease;
        AddChild(primaryFireButton);

        secondaryFireButton                = new FButton("Holding_Circle_Selected.png");
        secondaryFireButton.x              = (Futile.screen.width / 2) - 25;
        secondaryFireButton.y              = 25 - (Futile.screen.height / 2);
        secondaryFireButton.scale          = 0.25f;
        secondaryFireButton.SignalPress   += secondaryFireButtonPress;
        secondaryFireButton.SignalRelease += secondaryFireButtonRelease;
        AddChild(secondaryFireButton);

        for (int i = 0; i < numPlayers; i++)
        {
            LivingPlayers.Add(true);
        }
        playersLeft = numPlayers;

        escapeMenu   = new FLabel("FranchiseFont_Scale1", "Press back to return to menu");
        escapeMenu.y = -(Futile.screen.halfHeight / 2);

        asteroidRate   = (40 * ShipSelect.instance.getAsteroidRate());
        spawnAsteroids = ShipSelect.instance.getSpawnAsteroids();
        CreateShips();

        frameCount = 0;

        baseRotation = Input.acceleration;
    }
示例#12
0
 public static Projectile Create(InGamePage world, Vector2 pos, Vector2 Aceleration, FSprite sprite)
 {
     GameObject GObj = new GameObject("Bullet");
     Projectile body = GObj.AddComponent<Projectile>();
     body.GamePage = world;
     body.Position=pos;
     body.Aceleration=Aceleration;
     body.Size=new Vector2(8,5);
     body.Sprite = new FSprite("Futile_White");
     Color cl =new Color(80,90,0,1);
     body.Sprite.color=cl;
     body.Sprite.width = body.Size.x;
     body.Sprite.height = body.Size.y;
     return body;
 }
示例#13
0
 public static Platform Create(InGamePage world, Vector2 pos, float angulo, Vector2 size, FSprite sprite, string name)
 {
     GameObject GObj = new GameObject(name);
     Platform body = GObj.AddComponent<Platform>();
     body.GamePage = world;
     body.Position=pos;
     body.Size=size;
     body.Sprite = sprite;
     body.Sprite.width = size.x;
     body.Sprite.height = size.y;
     if(name.Equals("Bottom")){
     Color cl =new Color(250,0,0,1);
     body.Sprite.color=cl;}
     body.Rotation=angulo;
     body.transform.Rotate(new Vector3(0,0,angulo));
     return body;
 }
示例#14
0
    public static Projectile Create(InGamePage world, Vector2 pos, Vector2 Aceleration, FSprite sprite)
    {
        GameObject GObj = new GameObject("Bullet");
        Projectile body = GObj.AddComponent <Projectile>();

        body.GamePage    = world;
        body.Position    = pos;
        body.Aceleration = Aceleration;
        body.Size        = new Vector2(8, 5);
        body.Sprite      = new FSprite("Futile_White");
        Color cl = new Color(80, 90, 0, 1);

        body.Sprite.color  = cl;
        body.Sprite.width  = body.Size.x;
        body.Sprite.height = body.Size.y;
        return(body);
    }
示例#15
0
    public static Enemy Create(InGamePage world, Vector2 pos, int direction)
    {
        GameObject GObj = new GameObject("Enemy");
        Enemy body = GObj.AddComponent<Enemy>();
        body.GamePage = world;
        body.Position=pos;
        body.Size=new Vector2(80,80);
        body.Sprite = new FSprite("Futile_White");
        Color cl =new Color(0,0,90,1);
        body.Sprite.color=cl;
        body.Sprite.width = body.Size.x;
        body.Sprite.height = body.Size.y;
        body.direction=direction;
        body.life=3;
        body.sprite = new FAnimatedSprite(new FAnimation("enewalk","enewalk",80,80,0,0,2,120,true));

        return body;
    }
示例#16
0
    public static Player Create(InGamePage world, Vector2 pos)
    {
        GameObject GObj = new GameObject("JumpMan");
        Player body = GObj.AddComponent<Player>();
        body.GamePage = world;
        body.Position=pos;
        body.Size=new Vector2(40,40);
        body.Sprite = new FSprite("Futile_White");
        Color cl =new Color(0,90,0,1);
        body.Sprite.color=cl;
        body.Sprite.width = body.Size.x;
        body.Sprite.height = body.Size.y;

        body.sprite = new FAnimatedSprite(new FAnimation("standing","standing",40,40,0,0,2,120,true));
        body.sprite.addAnimation(new FAnimation("walking","standing",40,40,0,1,2,120,true));

        return body;
    }
示例#17
0
    public static Enemy Create(InGamePage world, Vector2 pos, int direction)
    {
        GameObject GObj = new GameObject("Enemy");
        Enemy      body = GObj.AddComponent <Enemy>();

        body.GamePage = world;
        body.Position = pos;
        body.Size     = new Vector2(80, 80);
        body.Sprite   = new FSprite("Futile_White");
        Color cl = new Color(0, 0, 90, 1);

        body.Sprite.color  = cl;
        body.Sprite.width  = body.Size.x;
        body.Sprite.height = body.Size.y;
        body.direction     = direction;
        body.life          = 3;
        body.sprite        = new FAnimatedSprite(new FAnimation("enewalk", "enewalk", 80, 80, 0, 0, 2, 120, true));

        return(body);
    }
示例#18
0
    public static Player Create(InGamePage world, Vector2 pos)
    {
        GameObject GObj = new GameObject("JumpMan");
        Player     body = GObj.AddComponent <Player>();

        body.GamePage = world;
        body.Position = pos;
        body.Size     = new Vector2(40, 40);
        body.Sprite   = new FSprite("Futile_White");
        Color cl = new Color(0, 90, 0, 1);

        body.Sprite.color  = cl;
        body.Sprite.width  = body.Size.x;
        body.Sprite.height = body.Size.y;

        body.sprite = new FAnimatedSprite(new FAnimation("standing", "standing", 40, 40, 0, 0, 2, 120, true));
        body.sprite.addAnimation(new FAnimation("walking", "standing", 40, 40, 0, 1, 2, 120, true));

        return(body);
    }
示例#19
0
    public static Platform Create(InGamePage world, Vector2 pos, float angulo, Vector2 size, FSprite sprite, string name)
    {
        GameObject GObj = new GameObject(name);
        Platform   body = GObj.AddComponent <Platform>();

        body.GamePage      = world;
        body.Position      = pos;
        body.Size          = size;
        body.Sprite        = sprite;
        body.Sprite.width  = size.x;
        body.Sprite.height = size.y;
        if (name.Equals("Bottom"))
        {
            Color cl = new Color(250, 0, 0, 1);
            body.Sprite.color = cl;
        }
        body.Rotation = angulo;
        body.transform.Rotate(new Vector3(0, 0, angulo));
        return(body);
    }
示例#20
0
    public InGamePage()
    {
        FSprite bg = new FSprite("Atlases/bg");

        bg.width  = Futile.screen.width;
        bg.height = Futile.screen.height;
        AddChild(bg);
        hudStuff        = new FLabel("Minecraftia", "Energy:");
        hudShadow       = new FLabel("Minecraftia", "Energy:");
        hudStuff.scale  = 0.7f;
        hudShadow.scale = 0.7f;
        hudShadow.color = Color.black;
        hudStuff.SetPosition(new Vector2(0, (Futile.screen.height / 2) * 0.9f));
        hudShadow.SetPosition(new Vector2(1f, ((Futile.screen.height / 2) * 0.9f - 1)));


        gameArea            = new FContainer();
        enemies             = new List <Entity>();
        projectiles         = new List <Entity>();
        Enemyprojectiles    = new List <Entity>();
        entityContainer     = new FContainer();
        projectileContainer = new FContainer();
        particleContainer   = new FContainer();
        gameArea.AddChild(particleContainer);
        particleContainer.AddChild(projectilesParticles = new FParticleSystem(300));

        gameArea.AddChild(entityContainer);
        gameArea.AddChild(projectileContainer);
        AddChild(gameArea);
        InGamePage.CurrentInGamePage = this;
        ListenForUpdate(Update);
        jugador = new Player();
        GenerateFoe();

        AddChild(hudShadow);
        AddChild(hudStuff);
    }