Exemplo n.º 1
0
    private void Start()
    {
        Instance = this;
        FutileParams fparams = new FutileParams(true, true, true, true);
        fparams.AddResolutionLevel(800.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.0f, 0.0f);
        Futile.instance.Init(fparams);

        // Clearly game assets must be put into an atlas as some point,
        // but for testing purposes I just load each image I need.
        Futile.atlasManager.LoadImage("grasstile");
        Futile.atlasManager.LoadImage("foresttile");
        Futile.atlasManager.LoadImage("evilsoldier");
        Futile.atlasManager.LoadImage("goodsoldier");
        Futile.atlasManager.LoadImage("bluehighlight");
        Futile.atlasManager.LoadImage("redhighlight");
        Futile.atlasManager.LoadImage("phaser");
        Futile.atlasManager.LoadImage("doublebluehighlight");
        Futile.atlasManager.LoadImage("attack");
        Futile.atlasManager.LoadImage("defend");
        Futile.atlasManager.LoadImage("wait");
        Futile.atlasManager.LoadImage("cancel");
        Futile.atlasManager.LoadImage("useitem");
        Futile.atlasManager.LoadImage("move");
        Futile.atlasManager.LoadImage("useitem");
        Futile.atlasManager.LoadImage("crosshair");

        GoToPage(GamePageType.MissionPage);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        FutileParams fParams = new FutileParams(true,true,false,false);
        fParams.AddResolutionLevel(640.0f,2.0f,1.0f,"");
        fParams.origin = new Vector2(0,0);
        Futile.instance.Init(fParams);

        Futile.atlasManager.LoadAtlas("Atlases/spritesheet");
        Futile.stage.shouldSortByZ = true;

        // this is the tmx file located in Resources/TileMaps
        currentLevel = new Level("demo");
        Futile.stage.AddChild(currentLevel);

        player = new Player();
        player.sortZ = 69f;

        // find spawn point in collision layer
        int lengthI = currentLevel.Grid_Collision.GetLength(0);
        int lengthJ = currentLevel.Grid_Collision.GetLength(1);

        for (int i = 0; i < lengthI; i++) {
            for (int j = 0; j < lengthJ; j++) {
                if (currentLevel.Grid_Collision[i, j] == 16) {
                    player.SetPosition(new Vector2(j * 16 + 8, (-i * 16)));
                    break;
                }
            }
        }

        currentLevel.AddChild(player);
    }
Exemplo n.º 3
0
    void Start()
    {
        RXDebug.Log("Starting the demo");
        instance                 = this;
        Go.defaultEaseType       = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");                //iPhone
//		fparams.AddResolutionLevel(960.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone retina
        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");               //iPad
//		fparams.AddResolutionLevel(1280.0f,	2.0f,	2.0f,	"_Scale2"); //Nexus 7
//		fparams.AddResolutionLevel(2048.0f,	4.0f,	4.0f,	"_Scale4"); //iPad Retina

        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);
        Futile.atlasManager.LoadAtlas("Atlases/SFB");
        Futile.atlasManager.LoadAtlas("Atlases/SFB_en");

        Futile.atlasManager.LoadFont("font", "font", "Atlases/font", 0, 0);


        _stage = Futile.stage;

        GoToPage(PageType.MenuPage);

        _stage.ListenForUpdate(HandleUpdate);
    }
Exemplo n.º 4
0
    void Start()
    {
        FutileParams fparms = new FutileParams(true,true,false,false);
        fparms.AddResolutionLevel(480.0f,1.0f,1.0f,"_Scale1");
        fparms.origin = new Vector2(0.5f,0.5f);
        Futile.instance.Init(fparms);

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

        FSprite rigidBox = new FSprite("box.png");
        Futile.stage.AddChild(rigidBox);
        new FPRigidBody(rigidBox);

        FSprite staticBody = new FSprite("box.png");
        staticBody.y = staticBody.y - 100.0f;
        Futile.stage.AddChild(staticBody);
        new FPStaticBody(staticBody);

        for(int x = 0; x< 100; x++)
        {
            FSprite ball = new FSprite("ball.png");
            ball.y = ball.y + 170.0f;
            ball.x =  Random.Range(-Screen.width/4, Screen.width/4);
            ball.width = 10;
            ball.height = 10;
            Futile.stage.AddChild(ball);

            FPRigidBody ballBody = new FPRigidBody(ball, FPRigidBody.BodyShape.CIRCLE);
            ballBody.velocity = new Vector3(0.0f, -50.0f,0.0f);
        }

        FPhysics.instance.Init(true,true,true,true);
        FPhysics.instance.gravity = new Vector3(0.0f,-9.8f,0.0f);
    }
Exemplo n.º 5
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType       = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Time.timeScale = 0.4f;
        // ======= FUTILE INIT ======= //
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "_Scale1");                  //iPhone
        fparams.AddResolutionLevel(960.0f, 2.0f, 2.0f, "_Scale2");                  //iPhone retina
        fparams.AddResolutionLevel(1280.0f, 2.0f, 2.0f, "_Scale2");                 //Nexus 7

        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/BananaLargeAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/BananaGameAtlas");

        Futile.atlasManager.LoadFont("Franchise", "FranchiseFont" + Futile.resourceSuffix, "Atlases/FranchiseFont" + Futile.resourceSuffix, 0.0f, -4.0f);
        // ======= ENVIRONMENT INIT ======= //
        _stage = Futile.stage;

        FSoundManager.PlayMusic("NormalMusic", 0.5f);

        // ======= GAME INIT ======= //
        bad_foods.AddRange(new string[] { "Banana" });

        // ======= SWITCH PAGE ======= //
//        GoToPage(BPageType.TitlePage);
        GoToPage(BPageType.SelectPage);
    }
Exemplo n.º 6
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }

        FutileParams fp = new FutileParams(true, true, false, false);

        fp.AddResolutionLevel(480f, 1.0f, 1.0f, "-res1");
        fp.AddResolutionLevel(1136f, 2.0f, 2.0f, "-res2");
        fp.AddResolutionLevel(2048f, 4.0f, 4.0f, "-res4");
        fp.backgroundColor = new Color(0.3f, 0.3f, 0.3f, 1.0f);
        fp.origin          = Vector2.zero;

        Futile.instance.Init(fp);

        Futile.atlasManager.LoadAtlas("Atlases/ExtrudersSheet");
        Futile.atlasManager.LoadAtlas("Atlases/ImmunitySheet");
        Futile.atlasManager.LoadFont("TwCen", "twCen.png", "Atlases/twCen", 0, 0);

        Go.defaultEaseType = EaseType.SineInOut;

        SwitchToScene(SceneType.Immunity);
    }
Exemplo n.º 7
0
    void Start()
    {
        FutileParams fParams = new FutileParams(true, true, true, true);
        fParams.AddResolutionLevel(1366, 1, 1, "");
        fParams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fParams);
        Futile.atlasManager.LoadAtlas("Atlases/Breakout");

        BreakoutBackground bg = new BreakoutBackground(1.4f, 1);
        _player = new Paddle();

        bricks = new List<Brick>();
        Brick b1 = new Brick();
        b1.x = -Futile.screen.halfWidth/2;
        b1.y = -Futile.screen.halfHeight/2;
        Brick b2 = new Brick();
        b2.x = Futile.screen.halfWidth/2;
        b2.y = -Futile.screen.halfHeight/2;
        Brick b3 = new Brick();
        b3.x = -Futile.screen.halfWidth / 2;
        b3.y = Futile.screen.halfHeight / 2;
        Brick b4 = new Brick();
        b4.x = Futile.screen.halfWidth / 2;
        b4.y = Futile.screen.halfHeight / 2;
        bricks.Add(b1);
        bricks.Add(b2);
        bricks.Add(b3);
        bricks.Add(b4);

        _ball = new Ball();
    }
Exemplo n.º 8
0
    void Start()
    {
        instance = this;
        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(960.0f,	1.0f,	1.0f,	""); //iPhone

        fparams.origin = new Vector2(0.5f,0.5f);

        fparams.backgroundColor = new Color(18f / 100f, 13f / 100f, 28f / 100f, 1f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadImage("Atlases/Font");
        Futile.atlasManager.LoadImage("Atlases/title");
        Futile.atlasManager.LoadImage("Atlases/bg");

        Futile.atlasManager.LoadAtlas("Atlases/SpriteSheet");
        Futile.atlasManager.LoadFont("Minecraftia", "Atlases/Font", "Atlases/Font", 0, 0);

        _stage = Futile.stage;

        GoToPage(PageType.MainMenuPage);

        _stage.ListenForUpdate (HandleUpdate);
    }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        FutileParams fparams = new FutileParams (true, false, false, false);

        //Preload audio
        FSoundManager.Init();
        FSoundManager.PlayMusic("dino_ingame", 0);
        FSoundManager.PlayMusic("dino_music", 0);

        FScoreManager.Init();

        fparams.AddResolutionLevel (480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2 (0.5f, 0.5f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas ("Atlases/Game");
        Futile.atlasManager.LoadImage ("drumstick2");
        Futile.atlasManager.LoadFont ("BitOut", "BitOut_0.png", "Atlases/BitOut");

        _stage = Futile.stage;

        GoToPage(BPageType.MainMenu);
    }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 300;
                QualitySettings.vSyncCount = 0;
                RXDebug.Log ("Starting the game");
                instance = this;
                FSoundManager.Init ();
                Go.defaultEaseType = EaseType.Linear;
                Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
                FutileParams fparams = new FutileParams (true, true, false, true);

                fparams.AddResolutionLevel (480.0f, 1.0f, 1.0f, ""); //iPhone

                fparams.origin = new Vector2 (0.0f, 0.0f);

                Futile.instance.Init (fparams);

                Futile.atlasManager.LoadAtlas ("Atlases/Factory");
                Futile.atlasManager.LoadAtlas("Atlases/SFB");
                Futile.atlasManager.LoadFont("font", "font", "Atlases/font", 0, 0);

                _stage = Futile.stage;

                GoToPage (PageType.GamePage);
    }
Exemplo n.º 11
0
    void Start()
    {
        Go.defaultEaseType = EaseType.SineInOut;

        FutileParams fp = new FutileParams(true, true, false, false);

        fp.AddResolutionLevel(480f, 1.0f, 1.0f, "-res1");
        fp.AddResolutionLevel(1136f, 2.0f, 2.0f, "-res2");
        fp.AddResolutionLevel(2048f, 4.0f, 4.0f, "-res4");

        fp.backgroundColor = new Color(0.5f, 0.5f, 0.5f);
        fp.origin          = Vector2.zero;

        Futile.instance.Init(fp);

        Futile.atlasManager.LoadAtlas("Atlases/MainSheet");
        Futile.atlasManager.LoadFont("franchise", "franchise", "Atlases/franchise", -7, -16);
        // futile done initing

        WTUtils.Init();

        handler = new WTHandler();
        handler.SignalUpdate      += HandleUpdate;
        handler.SignalLateUpdate  += HandleLateUpdate;
        handler.SignalFixedUpdate += HandleFixedUpdate;
        handler.SignalMultiTouch  += HandleMultiTouch;

        Futile.stage.AddChild(handler);

        FPWorld.Create(64.0f);

        currentScene = new WTMainScene();
        Futile.stage.AddChild(currentScene);
    }
    // Use this for initialization
    void Start()
    {
        FutileParams fParms = new FutileParams(false, false, true, true);

        fParms.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fParms.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fParms);

        Futile.atlasManager.LoadAtlas("Atlases/art");
        Futile.atlasManager.LoadFont("Franchise", "FranchiseFontAtlas.png", "Atlases/FranchiseLarge");

        FSprite background = new FSprite("background.png");

        Futile.stage.AddChild(background);
        Futile.stage.AddChild(mBombaNode  = new FContainer());
        Futile.stage.AddChild(mPepperNode = new FContainer());

        mPepperNode.AddChild(mPepper = new Pepper(new FireDelegate(fire)));

        mSeed = new Seed(18, mPepper.y + mPepper.height / 2 - 15);
        Futile.stage.AddChild(mSeed);

        mScoreLabel         = new FLabel("Franchise", "Score :");
        mScoreLabel.anchorX = 0;
        mScoreLabel.anchorY = 1;
        mScoreLabel.color   = new Color(1.0f, 0.90f, 0.0f);
        mScoreLabel.x       = -Futile.halfWidth;
        mScoreLabel.y       = Futile.halfHeight;

        Futile.stage.AddChild(mScoreLabel);

        Futile.touchManager.AddSingleTouchTarget(this);

        FSoundManager.PlayMusic("music", 0.45f);
    }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true,true,false,false);
        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/simple");
        //		Futile.atlasManager.LoadFont("Arial", "Arial.png", "Atlases/Arial");

        gcmap = new GCMap();
        gcmap.Init();

        player = new FSprite("green.png");
        enemy = new FSprite("dark_grey.png");

        Futile.stage.AddChild(gcmap);

        Futile.stage.AddChild(player);
        Futile.stage.AddChild (enemy);

        gcmap.x = -240;
        gcmap.y = 160;

        player.x = 0;
        player.y = 0;

        enemy.x = 6 * 32;
        enemy.y = -3 * 32;
    }
Exemplo n.º 14
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Time.timeScale = 0.1f;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");

        bool shouldSupportPortraitUpsideDown = isIPad; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(true,true,true,shouldSupportPortraitUpsideDown);

        fparams.AddResolutionLevel(480.0f,	1.0f,	1.0f,	"_Scale1"); //iPhone
        fparams.AddResolutionLevel(960.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone retina
        fparams.AddResolutionLevel(1024.0f,	2.0f,	2.0f,	"_Scale2"); //iPad
        fparams.AddResolutionLevel(1280.0f,	2.0f,	2.0f,	"_Scale2"); //Nexus 7
        fparams.AddResolutionLevel(2048.0f,	4.0f,	4.0f,	"_Scale4"); //iPad Retina

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/BananaLargeAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/BananaGameAtlas");
        Futile.atlasManager.LoadFont("Franchise","FranchiseFontAtlas.png", "Atlases/FranchiseLarge");

        _stage = Futile.stage;

        BSoundPlayer.PlayRegularMusic();

        GoToPage(BPageType.TitlePage);
    }
Exemplo n.º 15
0
    void Start()
    {
        instance = this;

        //设置引擎参数
        FutileParams fparams = new FutileParams(true, true, true, false);

        fparams.AddResolutionLevel(1400f, 1f, 1f, string.Empty);
        fparams.origin = new Vector2(0.5f, 0.5f);          //RW原点在 0,0

        //初始化引擎
        Futile.instance.Init(fparams);

        //加载纹理资源
        this.tentaclePlants = Resources.Load("TPlantDemo_1") as Texture2D;
        Futile.atlasManager.LoadAtlasFromTexture("TPlantDemo_1", tentaclePlants);

        _stage = Futile.stage;
        Debug.Log("测试运行开始");
        //测试方法
        TestPage testPage = new TestPage();

        _stage.AddChild(testPage);
        testPage.Start();

        TestMethod();

        Debug.Log("测试路径读取:" + RootFolderDirectory());
    }
Exemplo n.º 16
0
    // Use this for initialization
    // ReSharper disable UnusedMember.Local
    // ReSharper disable InconsistentNaming
    void Start()
    {
        // ReSharper restore InconsistentNaming
        // ReSharper restore UnusedMember.Local
        //Create params
        var Params = new FutileParams(true, true, false, false) { origin = new Vector2(0.0f, 0.0f) };
        //Params.AddResolutionLevel(480.0f, 1.0f, 1.0f, "_x1"); //iPhone
        //Params.AddResolutionLevel(960.0f, 2.0f, 2.0f, "_x2"); //iPhone Retina
        Params.AddResolutionLevel(1024.0f, 1.0f, 1.0f, ""); //i

        //Initialize
        Futile.instance.Init(Params);
        Futile.atlasManager.LoadAtlas("Atlases/atlas");
        Futile.atlasManager.LoadAtlas("Atlases/atlas-pixel");
        Futile.atlasManager.LoadImage("Atlases/font_console");
        Futile.atlasManager.LoadFont("font", "font", "Atlases/font", 0, 0);
        Futile.atlasManager.LoadFont("font_console", "Atlases/font_console", "Atlases/font_console", 0, 0);
        //Futile.atlasManager.LoadFont("visitor", "visitor" + Futile.resourceSuffix, "Atlases/visitor" + Futile.resourceSuffix, 0, 0);
        //Futile.atlasManager.LoadFont("visitor-big", "visitor-big" + Futile.resourceSuffix, "Atlases/visitor-big" + Futile.resourceSuffix, 0, 0);
        //Futile.atlasManager.LoadFont("visitor-small", "visitor-small" + Futile.resourceSuffix, "Atlases/visitor-small" + Futile.resourceSuffix, 0, 0);

        //Create
        StateManager.instance.setup(new StateFactory());
        Futile.stage.AddChild(StateManager.instance);
    }
    // Use this for initialization
    void Start()
    {
        instance = this;

        if (!PlayerPrefs.HasKey("highest_level"))
        {
            PlayerPrefs.SetString("highest_level", "stomach");
        }

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/MainMenu");
        Futile.atlasManager.LoadAtlas("Atlases/DrawingAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/LevelSelectMenu");
        Futile.atlasManager.LoadAtlas("Atlases/CreditsAtlas");

        //Futile.atlasManager.LoadFont("ImmunityFont", "ImmunityFont", "Atlases/ImmunityFont", 0.0f, 0.0f);

        GoToMenu(PageType.TitlePage);
    }
Exemplo n.º 18
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Time.timeScale = 0.1f;

        FutileParams fparams = new FutileParams(true,true,false,false);

        fparams.AddResolutionLevel(512.0f,	0.5f,	1.0f,	"_Scale2"); //Unity Editor
        fparams.AddResolutionLevel(1024.0f,	1.0f,	1.0f,	"_Scale2"); //iPhone retina
        #if UNITY_IPHONE
        fparams.AddResolutionLevel(2048.0f,	2.0f,	2.0f,	"_Scale4"); //iPad retina
        #endif

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.shouldRemoveAtlasElementFileExtensions = false;

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/Game");
        Futile.atlasManager.LoadAtlas("Atlases/Background");

        Futile.atlasManager.LoadFont("Cubano","Cubano"+Futile.resourceSuffix+".png", "Atlases/Cubano"+Futile.resourceSuffix,1,2);

        MBeast.Init(); //sets up the MBeast animation elements
        MExplosion.Init(); //sets up the explosion elements
        MTower.Init (); //sets up the tower elements

        GoToPage(MPageType.TitlePage);
    }
Exemplo n.º 19
0
    void Start()
    {
        instance                 = this;
        Go.defaultEaseType       = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(960.0f, 1.0f, 1.0f, "");                  //iPhone

        fparams.origin = new Vector2(0.5f, 0.5f);

        fparams.backgroundColor = new Color(18f / 100f, 13f / 100f, 28f / 100f, 1f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadImage("Atlases/Font");
        Futile.atlasManager.LoadImage("Atlases/title");
        Futile.atlasManager.LoadImage("Atlases/bg");

        Futile.atlasManager.LoadAtlas("Atlases/SpriteSheet");
        Futile.atlasManager.LoadFont("Minecraftia", "Atlases/Font", "Atlases/Font", 0, 0);


        _stage = Futile.stage;

        GoToPage(PageType.MainMenuPage);

        _stage.ListenForUpdate(HandleUpdate);
    }
Exemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        //Futile initialization
        //create new FutileParams object, pass types of displays
        FutileParams fparams = new FutileParams(true, true, false, false);
        //Add a resolution level
        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        //set origin to center of screen
        fparams.origin = new Vector2(0.5f, 0.5f);
        //finally initialize the fparams object with futile
        Futile.instance.Init(fparams);
        //End Futile initialization

        //Load an Atlas for sprites
        Futile.atlasManager.LoadAtlas("Atlases/SpriteAtlases");

        //create a Sprite
        //FSprite test = new FSprite("grass.png");

        //Display the sprite
        //Futile.stage.AddChild(test);

        sceneManager = new SceneManager();

        sceneManager.ChangeScene(new TitleScene());
    }
Exemplo n.º 21
0
    void Start()
    {
        RXDebug.Log("Starting the demo");
        instance = this;
        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
        FutileParams fparams = new FutileParams(true,true, false,false);

        fparams.AddResolutionLevel(480.0f,	1.0f,	1.0f, ""); //iPhone
        //		fparams.AddResolutionLevel(960.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone retina
        fparams.AddResolutionLevel(1024.0f,	1.0f,	1.0f,	""); //iPad
        //		fparams.AddResolutionLevel(1280.0f,	2.0f,	2.0f,	"_Scale2"); //Nexus 7
        //		fparams.AddResolutionLevel(2048.0f,	4.0f,	4.0f,	"_Scale4"); //iPad Retina

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);
        Futile.atlasManager.LoadAtlas("Atlases/SFB");
                Futile.atlasManager.LoadAtlas("Atlases/SFB_en");

                Futile.atlasManager.LoadFont("font", "font", "Atlases/font", 0, 0);

        _stage = Futile.stage;

         GoToPage(PageType.MenuPage);

        _stage.ListenForUpdate (HandleUpdate);
    }
Exemplo n.º 22
0
    void Start()
    {
        state = STATE_SPLASH;

        FutileParams fparams = new FutileParams(true, true, false, false); //landscape left, right, portrait, portraitUpsideDown

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");               //max width, displayScale, resourceScale, resourceSuffix

        fparams.backgroundColor = RXUtils.GetColorFromHex("555555");
        fparams.origin          = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/lake_monster2");
        Futile.atlasManager.LogAllElementNames();

        MetaContainer.loadFont("Arial-Black", 120, "arial_black_120", "Atlases/arial_black_120", 0f, 0f);
        MetaContainer.loadFont("BrushScriptStd", 16, "BrushScriptStd_64", "Atlases/BrushScriptStd_64", 4f, -12f);

        ScreenManager.init(this, "");

        splash = new GameScreen("greetings_lochness_cleanup");
        splash.buttons["start"].SignalRelease += handleLevels;
        ScreenManager.loadScreen(splash, ScreenSourceDirection.Instant);
    }
Exemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, false, false, false);

        futileParams.AddResolutionLevel(160, 1.0f, 1.0f, "");
        futileParams.origin          = new Vector2(0.5f, 0.5f);
        futileParams.backgroundColor = new Color(0.494f, 0.561f, 0.639f);
        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadAtlas("Atlases/atlasOne");
        Futile.atlasManager.LoadFont("gameFont", "fontOne_0", "Atlases/fontOne", 0, 0);

        eventQueue = new List <Event>();

        GlitchManager gManager = GlitchManager.getInstance();


        camera = Ym90_GUI.getInstance();
        player = new Player();

        currentMap = new Map();
        currentMap.setPlayer(player);
        loadMap("testMap");

        loadingScreen = new LoadingScreen();
        camera.setLoadingScreen(loadingScreen);
        camera.follow(player);



        Futile.stage.AddChild(camera);
    }
Exemplo n.º 24
0
    private void Start()
    {
        Instance = this;
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(800.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.0f, 0.0f);
        Futile.instance.Init(fparams);

        // Clearly game assets must be put into an atlas as some point,
        // but for testing purposes I just load each image I need.
        Futile.atlasManager.LoadImage("grasstile");
        Futile.atlasManager.LoadImage("foresttile");
        Futile.atlasManager.LoadImage("evilsoldier");
        Futile.atlasManager.LoadImage("goodsoldier");
        Futile.atlasManager.LoadImage("bluehighlight");
        Futile.atlasManager.LoadImage("redhighlight");
        Futile.atlasManager.LoadImage("phaser");
        Futile.atlasManager.LoadImage("doublebluehighlight");
        Futile.atlasManager.LoadImage("attack");
        Futile.atlasManager.LoadImage("defend");
        Futile.atlasManager.LoadImage("wait");
        Futile.atlasManager.LoadImage("cancel");
        Futile.atlasManager.LoadImage("useitem");
        Futile.atlasManager.LoadImage("move");
        Futile.atlasManager.LoadImage("useitem");
        Futile.atlasManager.LoadImage("crosshair");

        GoToPage(GamePageType.MissionPage);
    }
Exemplo n.º 25
0
    void Start()
    {
        // Setup Futile
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparams);

        // Load the powerup sprite
        GSpineManager.LoadSpine("powerup", "spine/powerup/powerupJson", "spine/powerup/powerupAtlas");
        powerup = new GSpineSprite("powerup");
        Futile.stage.AddChild(powerup);
        powerup.Play("animation");
        powerup.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        _activeSprite = powerup;

        // load the goblin sprite
        GSpineManager.LoadSpine("goblin", "spine/goblin/goblinJson", "spine/goblin/goblinAtlas");
        goblin = new GSpineSprite("goblin");
        Futile.stage.AddChild(goblin);
        goblin.SetSkin("goblin");
        goblin.Play("walk");
        goblin.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        goblin.isVisible = false;

        // load the spineboy sprite
        GSpineManager.LoadSpine("spineboy", "spine/spineboy/spineboyJson", "spine/spineboy/spineboyAtlas");
        spineboy = new GSpineSprite("spineboy");
        Futile.stage.AddChild(spineboy);
        spineboy.SetAnimationMix("jump", "walk", 0.4f);
        spineboy.Play("walk");
        spineboy.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        spineboy.isVisible = false;
    }
Exemplo n.º 26
0
    public void Init(FutileParams futileParams)
    {
        enabled       = true;
        _futileParams = futileParams;

        Application.targetFrameRate = _futileParams.targetFrameRate;

        FShader.Init();         //set up the basic shaders
        FFacetType.Init();      //set up the types of facets (Quads, Triangles, etc)

        screen = new FScreen(_futileParams);

        //
        //Camera setup from https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/UIToolkit/UI.cs
        //

        if (existingCamera != null)
        {
            _cameraHolder = existingCamera.gameObject;
            _camera       = existingCamera;
        }
        else
        {
            _cameraHolder = new GameObject();
            _camera       = _cameraHolder.AddComponent <Camera>();
        }

        _cameraHolder.transform.parent = gameObject.transform;

        _camera.tag             = "MainCamera";
        _camera.clearFlags      = CameraClearFlags.SolidColor;
        _camera.nearClipPlane   = 0.0f;
        _camera.farClipPlane    = 500.0f;
        _camera.depth           = 100;
        _camera.rect            = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
        _camera.backgroundColor = _futileParams.backgroundColor;

        //we multiply this stuff by scaleInverse to make sure everything is in points, not pixels
        _camera.orthographic     = true;
        _camera.orthographicSize = screen.pixelHeight / 2 * displayScaleInverse;

        UpdateCameraPosition();

        touchManager = new FTouchManager();

        atlasManager = new FAtlasManager();

        CreateDefaultAtlases();


        _stages = new List <FStage>();

        stage = new FStage("Futile.stage");

        AddStage(stage);
    }
Exemplo n.º 27
0
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, true, true, true);

        manager = new MouseManager(this);
        futileParams.AddResolutionLevel(800, 1, 1, "");

        futileParams.origin = new Vector2(
            0.0f, 0.0f);
        Futile.instance.Init(futileParams);
        Futile.atlasManager.LoadImage("grasstile");
        Futile.atlasManager.LoadImage("foresttile");
        Futile.atlasManager.LoadImage("soldier");
        Futile.atlasManager.LoadImage("bluehighlight");
        var tileSize = 30;
        var width    = 50;
        var height   = 35;
        var tiles    = new TileProperties[width, height];

        var grassTile = new TileProperties()
        {
            SpriteName      = "grasstile",
            MovementPenalty = 1
        };

        var forestTile = new TileProperties()
        {
            SpriteName      = "foresttile",
            MovementPenalty = 2
        };

        var actorProps = new ActorProperties()
        {
            SpriteName     = "soldier",
            Name           = "Hunkfort",
            MovementPoints = 5
        };

        var rand = new System.Random();

        for (int ii = 0; ii < width; ii++)
        {
            for (int jj = 0; jj < height; jj++)
            {
                tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile;
            }
        }

        this.map = new Map(tiles, tileSize);
        this.map.AddActor(actorProps, new Vector2i(5, 5));
        this.map.Start();

        tileStage = new FStage("test");
        Futile.AddStage(tileStage);
        tileStage.stage.AddChild(this.map);
    }
Exemplo n.º 28
0
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);
        fparams.AddResolutionLevel(1024, 1, 1, "");
        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadImage("tile32");
        Futile.atlasManager.LoadImage("tile64");
        Futile.atlasManager.LoadImage("tile128");
        Futile.atlasManager.LoadImage("tile256");

        FSprite tile32 = new FSprite("tile32");
        FSprite tile64 = new FSprite("tile64");
        FSprite tile128 = new FSprite("tile128");
        FSprite tile256 = new FSprite("tile256");

        FSprite tile32_2 = new FSprite("tile32");
        FSprite tile32_4 = new FSprite("tile32");
        FSprite tile32_8 = new FSprite("tile32");

        // native res
        tile32.x = -150;
        tile32.y = 300;
        Futile.stage.AddChild(tile32);

        tile64.x = -150;
        tile64.y = 300-64;
        Futile.stage.AddChild(tile64);

        tile128.x = -150;
        tile128.y = 300-64-128;
        Futile.stage.AddChild(tile128);

        tile256.x = -150;
        tile256.y = 300-64-128-256;
        Futile.stage.AddChild(tile256);

        // upscaled
        tile32_2.scale = 2;
        tile32_2.x = 150;
        tile32_2.y = 300-64;
        Futile.stage.AddChild(tile32_2);

        tile32_4.scale = 4;
        tile32_4.x = 150;
        tile32_4.y = 300-64-128;
        Futile.stage.AddChild(tile32_4);

        tile32_8.scale = 8;
        tile32_8.x = 150;
        tile32_8.y = 300-64-128-256;
        Futile.stage.AddChild(tile32_8);
    }
Exemplo n.º 29
0
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, true, true, true);
        manager = new MouseManager(this);
        futileParams.AddResolutionLevel(800, 1, 1, "");

        futileParams.origin = new Vector2(
            0.0f, 0.0f);
        Futile.instance.Init(futileParams);
        Futile.atlasManager.LoadImage("grasstile");
        Futile.atlasManager.LoadImage("foresttile");
        Futile.atlasManager.LoadImage("soldier");
        Futile.atlasManager.LoadImage("bluehighlight");
        var tileSize = 30;
        var width = 50;
        var height = 35;
        var tiles = new TileProperties[width, height];

        var grassTile = new TileProperties()
        {
            SpriteName = "grasstile",
            MovementPenalty = 1
        };

        var forestTile = new TileProperties()
        {
            SpriteName = "foresttile",
            MovementPenalty = 2
        };

        var actorProps = new ActorProperties()
        {
            SpriteName = "soldier",
            Name = "Hunkfort",
            MovementPoints = 5
        };

        var rand = new System.Random();
        for (int ii = 0; ii < width; ii++)
        {
            for (int jj = 0; jj < height; jj++)
            {
                tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile;
            }
        }

        this.map = new Map(tiles, tileSize);
        this.map.AddActor(actorProps, new Vector2i(5, 5));
        this.map.Start();

        tileStage = new FStage("test");
        Futile.AddStage(tileStage);
        tileStage.stage.AddChild(this.map);
    }
Exemplo n.º 30
0
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, true, true, true);

        futileParams.AddResolutionLevel(1024, 1, 1, "");
        futileParams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(futileParams);
        Futile.atlasManager.LoadImage("background");
        FSprite fSprite = new FSprite("background");

        Futile.stage.AddChild(fSprite);
    }
Exemplo n.º 31
0
    void Start()
    {
        FutileParams fparams = new FutileParams(true,true,false,false);
        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

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

        game = new PDGame();
    }
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(480.0f, 2.0f, 1.0f, "");
        fparams.origin          = new Vector2(0.5f, 0.5f);
        fparams.backgroundColor = new Color(0.15f, 0.15f, 0.3f);
        Futile.instance.Init(fparams);

        // load image atlas (within Resources/Atlases folder)
        Futile.atlasManager.LoadAtlas("Atlases/Burglar");

        // Add tilemap
        FTilemap room1 = new FTilemap("Burglar Walls");

        room1.LoadCSV("CSVs/Room1Map");         // load comma separated text file (within Resources/CSVs folder)
        room1.x  = -room1.width / 2;
        room1.y -= 4;
        Futile.stage.AddChild(room1);

        // create burglar
        burglar   = new FAnimatedSprite("Burglar");
        burglar.y = -24;
        int[] frames = { 1, 1, 2, 1, 1, 1, 10, 1, 11, 1 }; // idle anim
        burglar.addAnimation(new FAnimation("idle", frames, 400, true));
        int[] frames2 = { 3, 4, 5, 6, 4, 7 };              // run anim
        burglar.addAnimation(new FAnimation("run", frames2, 180, true));
        Futile.stage.AddChild(burglar);                    // add burglar to stage

        // load font atlas
        Futile.atlasManager.LoadAtlas("Atlases/Fonts");

        // Add large font text
        Futile.atlasManager.LoadFont("Large", "Large Font", "Atlases/Large Font", 0, 0);
        FLabel label1 = new FLabel("Large", "LARGE FONT");

        label1.y = 26;
        Futile.stage.AddChild(label1);

        // Add small font text
        Futile.atlasManager.LoadFont("Small", "Small Font", "Atlases/Small Font", 0, 0);
        FLabel label2 = new FLabel("Small", "Small Font");

        label2.y = 12;
        Futile.stage.AddChild(label2);

        // Add tiny font text
        Futile.atlasManager.LoadFont("Tiny", "Tiny Font", "Atlases/Tiny Font", 0, 0);
        FLabel label3 = new FLabel("Tiny", "Tiny Font");

        label3.y = 3;
        Futile.stage.AddChild(label3);
    }
Exemplo n.º 33
0
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparams);

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

        game = new PDGame();
    }
Exemplo n.º 34
0
    void SetupFutile()
    {
        FutileParams futileParams = new FutileParams(true, true, false, false);
        futileParams.AddResolutionLevel(960f, 1.0f, 1.0f, "");
        futileParams.AddResolutionLevel(1920f, 2.0f, 2.0f, "");
        futileParams.origin = new Vector2(0.5f, 0.5f);
        futileParams.debugLog = false;
        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadAtlas("UI/UI");
        Futile.atlasManager.LoadFont("comfortaa20", "comfortaa20_0", "UI/comfortaa20", 0f, 0f);
        Futile.atlasManager.LoadFont("comfortaa32", "comfortaa32_0", "UI/comfortaa32", 0f, 0f);
    }
Exemplo n.º 35
0
    public static void InitialiseFutile()
    {
        FutileParams fParams = new FutileParams(true, true, false, false);
        int          iWidth  = 960;
        int          iHeight = 640;

        fParams.AddResolutionLevel(Mathf.Max(iWidth, iHeight), 1, 1, "");
        fParams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fParams);
        //Load all atlases
        FutileLoadAll();
    }
Exemplo n.º 36
0
        // Use this for initialization
        void Start()
        {
            instance = this;
            FutileParams fparams = new FutileParams(true,true,false,false);
            fparams.AddResolutionLevel(480.0f,	1.0f,	1.0f,	"");
            fparams.origin = new Vector2(0.5f, 0.5f);
            Futile.instance.Init(fparams);

            Futile.atlasManager.LoadAtlas("Atlases/SpriteSheets/MoveCharacterAtlas");

            char_container = new InGamePage();
            Futile.stage.AddChild(char_container);
        }
Exemplo n.º 37
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType       = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Time.timeScale = 0.1f;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");

        bool shouldSupportPortraitUpsideDown = isIPad;         //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(true, true, true, shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = RXUtils.GetColorFromHex(0x212121);
        fparams.shouldLerpToNearestResolutionLevel = true;
        fparams.resolutionLevelPickMode            = FResolutionLevelPickMode.Downwards;

        fparams.AddResolutionLevel(640.0f, 1.0f, 1.0f, "");
        fparams.AddResolutionLevel(1280.0f, 2.0f, 1.0f, "");
        fparams.AddResolutionLevel(1920.0f, 3.0f, 1.0f, "");
        fparams.AddResolutionLevel(2560.0f, 4.0f, 1.0f, "");

        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        FFacetType.Quad.maxEmptyAmount  = 100;
        FFacetType.Quad.expansionAmount = 100;
        FFacetType.Quad.initialAmount   = 100;

        FAtlas mainAtlas = Futile.atlasManager.LoadAtlas("Atlases/MainAtlas");

        mainAtlas.texture.filterMode = FilterMode.Point;

        TOFonts.Load();

        Config.Setup();

        Wolf.WolfAnimation.SetupAnimations();
        Human.HumanAnimation.SetupAnimations();

        core = new Core();
        Futile.stage.AddChild(core);

        //FSoundManager.PlayMusic ("NormalMusic",0.5f);

        Futile.screen.SignalResize += HandleSignalResize;
        HandleSignalResize(false);
    }
Exemplo n.º 38
0
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");         //iPhone 3G
        fparams.AddResolutionLevel(960.0f, 2.0f, 1.0f, "");         //iPhone 4S
        fparams.AddResolutionLevel(1280.0f, 2.0f, 1.0f, "");        //Nexus 7
        fparams.origin          = new Vector2(0.5f, 0.5f);
        fparams.backgroundColor = new Color32(0, 0, 0, 255);
        //fparams.shouldLerpToNearestResolutionLevel = true;

        Futile.instance.Init(fparams);
        Futile.atlasManager.LoadAtlas("Atlases/sprites");
        Futile.atlasManager.LoadFont("munro", "munro", "Atlases/munro", 0, 0);



        depthLabel         = new FLabel("munro", "Depth: " + PlayerState.DEPTH);
        depthLabel.anchorX = 0.0f;
        depthLabel.anchorY = 0.0f;
        depthLabel.x       = -Futile.screen.halfWidth + 20.0f;
        depthLabel.y       = -Futile.screen.halfHeight + 10.0f;

        scoreLabel         = new FLabel("munro", "Score: " + PlayerState.SCORE);
        scoreLabel.anchorX = 0.0f;
        scoreLabel.anchorY = 0.0f;
        scoreLabel.x       = Futile.screen.halfWidth - 90.0f;
        scoreLabel.y       = -Futile.screen.halfHeight + 10.0f;

        deathLabel         = new FLabel("munro", "Ouch! Press to try again!");
        deathLabel.anchorX = 0.0f;
        deathLabel.anchorY = 0.0f;
        deathLabel.x       = -100.0f;
        deathLabel.y       = -50.0f;

        bgContainer = new FContainer();
        for (float x = -Futile.screen.halfWidth; x < Futile.screen.halfWidth + 56.0f; x += 56.0f)
        {
            background   = new FSprite("background");
            background.x = x;
            bgContainer.AddChild(background);
        }
        FSprite title = new FSprite("title");

        title.y = 200.0f;
        bgContainer.AddChild(title);

        playerInput = new PlayerInput();

        this.initGame();
    }
Exemplo n.º 39
0
    public void Init(FutileParams futileParams)
    {
        enabled       = true;
        _futileParams = futileParams;

        //设置游戏帧率
        Application.targetFrameRate = _futileParams.targetFrameRate;
        //设置basic shaders
        FShader.Init();
        //设置facets' types (Quads, Triangles, etc)
        FFacetType.Init();

        //初始化各引擎组件实例
        screen = new FScreen(_futileParams);

        touchManager = new FTouchManager();

        atlasManager = new FAtlasManager();

        //设置主相机参数:Setup from https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/UIToolkit/UI.cs

        _cameraHolder = new GameObject();
        _cameraHolder.transform.parent = gameObject.transform;

        _camera      = _cameraHolder.AddComponent <Camera>();
        _camera.tag  = "MainCamera";
        _camera.name = "Camera";
        //_camera.clearFlags = CameraClearFlags.Depth; //TODO: check if this is faster or not?
        _camera.clearFlags      = CameraClearFlags.SolidColor;
        _camera.nearClipPlane   = 0.0f;
        _camera.farClipPlane    = 500.0f;
        _camera.depth           = 100;
        _camera.rect            = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
        _camera.backgroundColor = _futileParams.backgroundColor;

        //we multiply this stuff by scaleInverse to make sure everything is in points, not pixels
        _camera.orthographic     = true;
        _camera.orthographicSize = screen.pixelHeight / 2 * displayScaleInverse;

        UpdateCameraPosition();

        //创建默认Atlas
        CreateDefaultAtlases();

        //初始化Stage管理
        _stages = new List <FStage>();

        stage = new FStage("Futile.stage");

        AddStage(stage);
    }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

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

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

        Futile.atlasManager.LoadAtlas("Atlases/lung_background");
        Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
        Futile.atlasManager.LoadAtlas("Atlases/lung_dust");

        Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");

        Futile.atlasManager.LoadAtlas ("Atlases/Victory-DefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        camera_.setWorldBounds (worldBounds);

        //make the camera follow the player

        camera_.setBounds(cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }
Exemplo n.º 41
0
    void Awake()
    {
        FutileParams futileParams = new FutileParams(true, true, false, false);
        futileParams.AddResolutionLevel(960f, 1.0f, 1.0f, "");
        futileParams.AddResolutionLevel(1920f, 2.0f, 2.0f, "");
        futileParams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadAtlas("UI/ui");
        Futile.atlasManager.LoadFont("kozuka14el", "kozuka14el", "UI/kozuka14el", 0f, 0f);
        Futile.atlasManager.LoadFont("kozuka30el", "kozuka30el", "UI/kozuka30el", 0f, 0f);
        Futile.atlasManager.LoadFont("kozuka72r", "kozuka72r", "UI/kozuka72r", 0f, 0f);
        Futile.atlasManager.GetFontWithName("kozuka14el").textParams.kerningOffset = 1f;
    }
Exemplo n.º 42
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Time.timeScale = 0.1f;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");

        bool shouldSupportPortraitUpsideDown = isIPad; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(true,true,true,shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = RXUtils.GetColorFromHex(0x212121);
        fparams.shouldLerpToNearestResolutionLevel = true;
        fparams.resolutionLevelPickMode = FResolutionLevelPickMode.Downwards;

        fparams.AddResolutionLevel(640.0f,	1.0f,	1.0f,	"");
        fparams.AddResolutionLevel(1280.0f,	2.0f,	1.0f,	"");
        fparams.AddResolutionLevel(1920.0f,	3.0f,	1.0f,	"");
        fparams.AddResolutionLevel(2560.0f,	4.0f,	1.0f,	"");

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);

        FFacetType.Quad.maxEmptyAmount = 100;
        FFacetType.Quad.expansionAmount = 100;
        FFacetType.Quad.initialAmount = 100;

        FAtlas mainAtlas = Futile.atlasManager.LoadAtlas("Atlases/MainAtlas");
        mainAtlas.texture.filterMode = FilterMode.Point;

        TOFonts.Load();

        Config.Setup();

        Wolf.WolfAnimation.SetupAnimations();
        Human.HumanAnimation.SetupAnimations();

        core = new Core();
        Futile.stage.AddChild(core);

        //FSoundManager.PlayMusic ("NormalMusic",0.5f);

        Futile.screen.SignalResize += HandleSignalResize;
        HandleSignalResize(false);
    }
Exemplo n.º 43
0
        // Use this for initialization
        void Start()
        {
            FutileParams fparams = new FutileParams(true, true, false, false);

            fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
            fparams.origin = new Vector2(0.5f, 0.5f);
            Futile.instance.Init(fparams);

            Futile.atlasManager.LoadAtlas("Atlases/SpriteSheets/MoveCharacterAtlas");

            InGamePage char_container = new InGamePage();

            Futile.stage.AddChild(char_container);
        }
Exemplo n.º 44
0
	public void Init(FutileParams futileParams)
	{	
		enabled = true;
		_futileParams = futileParams;
		
		Application.targetFrameRate = _futileParams.targetFrameRate;
		
		FShader.Init(); //set up the basic shaders
		FFacetType.Init(); //set up the types of facets (Quads, Triangles, etc)
		
		screen = new FScreen(_futileParams);
		
		//
		//Camera setup from https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/UIToolkit/UI.cs
		//
		
		_cameraHolder = new GameObject();
		_cameraHolder.transform.parent = gameObject.transform;
		
		_camera = _cameraHolder.AddComponent<Camera>();
		_camera.tag = "MainCamera";
		_camera.name = "Camera";
		//_camera.clearFlags = CameraClearFlags.Depth; //TODO: check if this is faster or not?
		_camera.clearFlags = CameraClearFlags.SolidColor;
		_camera.nearClipPlane = 0.0f;
		_camera.farClipPlane = 500.0f;
		_camera.depth = 100;
		_camera.rect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
		_camera.backgroundColor = _futileParams.backgroundColor;
		
		//we multiply this stuff by scaleInverse to make sure everything is in points, not pixels
		_camera.orthographic = true;
		_camera.orthographicSize = screen.pixelHeight/2 * displayScaleInverse;

		UpdateCameraPosition();
		
		touchManager = new FTouchManager();
		
		atlasManager = new FAtlasManager();
		
		CreateDefaultAtlases();
		
		
		_stages = new List<FStage>();
		
		stage = new FStage("Futile.stage");
		
		AddStage (stage);
	}
Exemplo n.º 45
0
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);
        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.0f, 0.0f);

        Futile.instance.Init(fparams);
        Futile.atlasManager.LoadAtlas("Atlases/mainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/backgroundAtlas");
        Futile.atlasManager.LoadFont("BlairMdITC", "BlairMdITC.png", "Atlases/BlairMdITC");

        FSoundManager.PlayMusic("song", 0.7f);

        SwitchToPage(PageType.Title);
    }
Exemplo n.º 46
0
    public void Init(FutileParams futileParams)
    {
        enabled       = true;
        _futileParams = futileParams;

        Application.targetFrameRate = _futileParams.targetFrameRate;

        FShader.Init();         //set up the basic shaders

        Futile.startingQuadsPerLayer  = _futileParams.startingQuadsPerLayer;
        Futile.quadsPerLayerExpansion = _futileParams.quadsPerLayerExpansion;
        Futile.maxEmptyQuadsPerLayer  = _futileParams.maxEmptyQuadsPerLayer;

        screen = new FScreen(_futileParams);

        //
        //Camera setup from https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/UIToolkit/UI.cs
        //

        _cameraHolder = new GameObject();
        _cameraHolder.transform.parent = gameObject.transform;

        _camera      = _cameraHolder.AddComponent <Camera>();
        _camera.name = "Camera";
        //_camera.clearFlags = CameraClearFlags.Depth; //TODO: check if this is faster or not?
        _camera.clearFlags      = CameraClearFlags.SolidColor;
        _camera.nearClipPlane   = -50.0f;
        _camera.farClipPlane    = 50.0f;
        _camera.depth           = 100;
        _camera.rect            = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
        _camera.backgroundColor = _futileParams.backgroundColor;

        //we multiply this stuff by scaleInverse to make sure everything is in points, not pixels
        _camera.orthographic     = true;
        _camera.orthographicSize = screen.pixelHeight / 2 * displayScaleInverse;

        UpdateCameraPosition();

        touchManager = new FTouchManager();

        atlasManager = new FAtlasManager();

        _stages = new List <FStage>();

        stage = new FStage("Futile.stage");

        AddStage(stage);
    }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

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


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

        Futile.atlasManager.LoadAtlas("Atlases/lung_background");
        Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
        Futile.atlasManager.LoadAtlas("Atlases/lung_dust");

        Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");

        Futile.atlasManager.LoadAtlas("Atlases/Victory-DefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        //camera_.setWorldBounds (worldBounds);
        //camera_.setBounds(stage.cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);
        fparams.AddResolutionLevel(480.0f, 2.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        fparams.backgroundColor = new Color(0.15f, 0.15f, 0.3f);
        Futile.instance.Init(fparams);

        // load image atlas (within Resources/Atlases folder)
        Futile.atlasManager.LoadAtlas("Atlases/Burglar");

        // Add tilemap
        FTilemap room1 = new FTilemap("Burglar Walls");
        room1.LoadCSV("CSVs/Room1Map"); // load comma separated text file (within Resources/CSVs folder)
        room1.x = -room1.width/2;
        room1.y -= 4;
        Futile.stage.AddChild(room1);

        // create burglar
        burglar = new FAnimatedSprite("Burglar");
        burglar.y = -24;
        int[] frames = { 1,1,2,1,1,1,10,1,11,1 }; // idle anim
        burglar.addAnimation(new FAnimation("idle", frames, 400, true));
        int[] frames2 = { 3,4,5,6,4,7 }; // run anim
        burglar.addAnimation(new FAnimation("run", frames2, 180, true));
        Futile.stage.AddChild(burglar); // add burglar to stage

        // load font atlas
        Futile.atlasManager.LoadAtlas("Atlases/Fonts");

        // Add large font text
        Futile.atlasManager.LoadFont("Large", "Large Font", "Atlases/Large Font");
        FLabel label1 = new FLabel("Large", "LARGE FONT");
        label1.y = 26;
        Futile.stage.AddChild(label1);

        // Add small font text
        Futile.atlasManager.LoadFont("Small", "Small Font", "Atlases/Small Font");
        FLabel label2 = new FLabel("Small", "Small Font");
        label2.y = 12;
        Futile.stage.AddChild(label2);

        // Add tiny font text
        Futile.atlasManager.LoadFont("Tiny", "Tiny Font", "Atlases/Tiny Font");
        FLabel label3 = new FLabel("Tiny", "Tiny Font");
        label3.y = 3;
        Futile.stage.AddChild(label3);
    }
Exemplo n.º 49
0
    void Start()
    {
        // Setup Futile
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparams);


        GSpineManager.LoadSpine("powerup", "spine/powerup/powerup-spine", "spine/powerup/powerup-atlas");
        sprite = new GSpineSprite("powerup");
        Futile.stage.AddChild(sprite);
        sprite.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        sprite.Play("animation");
    }
Exemplo n.º 50
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        FutileParams fparams = new FutileParams(true, false, false, false);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);
        Futile.atlasManager.LoadImage("Atlases/abstract_0");
        Futile.atlasManager.LoadFont("Abstract", "Atlases/abstract_0", "Atlases/abstract", 0, 0);

        _stage = Futile.stage;

        this.GoToPage(BPageType.InGamePage);
    }
Exemplo n.º 51
0
    // Use this for initialization
    void Start()
    {
        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.0f, 0.0f);

        Futile.instance.Init(fparams);
        Futile.atlasManager.LoadAtlas("Atlases/mainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/backgroundAtlas");
        Futile.atlasManager.LoadFont("BlairMdITC", "BlairMdITC.png", "Atlases/BlairMdITC");

        FSoundManager.PlayMusic("song", 0.7f);

        SwitchToPage(PageType.Title);
    }
Exemplo n.º 52
0
    void Start()
    {
        // Setup Futile
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparams);


        GSpineManager.LoadSpineBySkel("990001", "spine/990001/990001.skel.bytes", "spine/990001/990001.atlas");
        sprite = new GSpineSprite("990001");
        Futile.stage.AddChild(sprite);
        sprite.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        sprite.scale = 0.5f;
    }
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams =
            new FutileParams(true, true, true, true);

        futileParams.AddResolutionLevel(1024, 1, 1, "");

        futileParams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadImage("OMG");

        FSprite fSprite = new FSprite("OMG");

        Futile.stage.AddChild(fSprite);
    }
    void Start()
    {
        // Setup Futile
        FutileParams fparams = new FutileParams(true, true, true, true);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparams);


        GSpineManager.LoadSpine("spineboy-original", "spine/spineboy-original/spineboy-original-spine", "spine/spineboy-original/spineboy-original-atlas");
        sprite = new GSpineSprite("spineboy-original");
        Futile.stage.AddChild(sprite);
        sprite.SetPosition((Futile.screen.halfWidth * 0.25f), -(Futile.screen.halfHeight * 0.5f));
        sprite.Play("walk");
        sprite.SetAnimationMix("jump", "walk", 0.4f);
    }
Exemplo n.º 55
0
    // ------------------------------------------------------------------------
    // Use this for initialization
    // ------------------------------------------------------------------------
    public void Start()
    {
        // init futile
        FutileParams fparms = new FutileParams(true, true, true, true);

        fparms.AddResolutionLevel(1280.0f, 2.0f, 1.0f, "");
        fparms.origin = new Vector2(0.5f, 0.5f);
        Futile.instance.Init(fparms);
        Futile.instance.camera.clearFlags      = CameraClearFlags.SolidColor;
        Futile.instance.camera.backgroundColor = new Color(0.0f, 0.0f, 0.0f, 1.0f);

        // load main image
        Futile.atlasManager.LoadImage(ROCKS_SPRITE);

        // setup image with shader and light
        this.setupLighting();
    }
Exemplo n.º 56
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        FutileParams fparams = new FutileParams(true, false, false, false);

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0, 1);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadImage("Atlases/abstract_0");
        Futile.atlasManager.LoadFont("Abstract", "Atlases/abstract_0", "Atlases/abstract", 0, 0);

        _stage = Futile.stage;

        this.GoToPage(BPageType.InGamePage);
    }
    // Use this for initialization
    void Start()
    {
        //instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        bool landscape = true;
        bool portrait = false;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");
        bool shouldSupportPortraitUpsideDown = isIPad && portrait; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(landscape, landscape, portrait, shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = new Color(0.1f, 0.1f, 0.1f);

        fparams.AddResolutionLevel(480.0f,	1.0f,	1.0f,	"_Scale1"); //iPhone
        fparams.AddResolutionLevel(960.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone retina
        fparams.AddResolutionLevel(1024.0f,	2.0f,	2.0f,	"_Scale2"); //iPad
        fparams.AddResolutionLevel(1280.0f,	2.0f,	2.0f,	"_Scale2"); //Nexus 7
        fparams.AddResolutionLevel(2048.0f,	4.0f,	4.0f,	"_Scale4"); //iPad Retina

        fparams.origin = new Vector2(0.0f,0.0f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/UIFonts");
        Futile.atlasManager.LoadAtlas("Atlases/GameAtlas");

        FPWorld.Create(64.0f);

        FTextParams textParams;

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("Franchise","FranchiseFont"+Futile.resourceSuffix, "Atlases/FranchiseFont"+Futile.resourceSuffix, -2.0f,-5.0f,textParams);

        textParams = new FTextParams();
        textParams.kerningOffset = -0.5f;
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("CubanoInnerShadow","Cubano_InnerShadow"+Futile.resourceSuffix, "Atlases/CubanoInnerShadow"+Futile.resourceSuffix, 0.0f,2.0f,textParams);

        GoToPage(PageType.BitmaskPuzzleShapesGame);
    }
Exemplo n.º 58
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);

	}
Exemplo n.º 59
0
    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, false, false, false);
        futileParams.AddResolutionLevel(160.0f, 1.0f, 1.0f, "");

        futileParams.origin = new Vector2(0.5f, 0.5f);
        futileParams.backgroundColor = new Color(245.0f / 255.0f, 252.0f / 255.0f, 178.0f / 255.0f);
        futileParams.shouldLerpToNearestResolutionLevel = true;

        Futile.instance.Init(futileParams);

        Futile.atlasManager.LoadAtlas("Atlases/inGameAtlas");
        Futile.atlasManager.LoadFont(C.smallFontName, "smallFont_0", "Atlases/smallFont", 0, 0);
        Futile.atlasManager.LoadFont(C.largeFontName, "largeFont_0", "Atlases/largeFont", 0, 0);

        Futile.stage.AddChild(C.getCameraInstance());

        C.getCameraInstance().SetPosition(Futile.screen.halfWidth, -Futile.screen.halfHeight);
        C.getCameraInstance().AddChild(new TitleScreen());
    }
Exemplo n.º 60
0
    void Start()
    {
        FutileParams fp = new FutileParams(true, true, false, false);
        fp.AddResolutionLevel(960f, 1.0f, 1.0f, "");
        fp.origin = Vector2.zero;
        fp.backgroundColor = Color.white;

        Futile.instance.Init(fp);
        Futile.atlasManager.LoadAtlas("Atlases/MainSheet");
        Futile.atlasManager.LoadAtlas("Atlases/ExtrudersSheet");
        Futile.atlasManager.LoadFont("Burnstown", "Burnstown.png", "Atlases/Burnstown");
        Futile.atlasManager.LoadFont("Exotica", "Exotica.png", "Atlases/Exotica");
        Futile.atlasManager.LoadFont("SoftSugar", "SoftSugar.png", "Atlases/SoftSugar");
        Futile.atlasManager.LoadImage("Atlases/clouds");

        labelDisplayLayer = new TLabelDisplayLayer();
        Futile.AddStage(labelDisplayLayer);

        SwitchToScene(SceneType.PeopleSceneGoalOne);
    }