Exemplo n.º 1
0
        public MainScene()
        {
            this.ScheduleUpdate ();

            SceneCamera = (Camera2D)Camera;
            SceneCamera.SetViewFromHeightAndCenter (_screenSize.Y, _screenSize / 2.0f);
            //_background = new Layer (SceneCamera, 0.1f, 0.1f);
            //_main = new Layer (SceneCamera);
            _main = new Node ();
            /*
            _physics = new PhysicsScene();
            _physics.InitScene();
            */

            _playerCreature = new PlayerCreature ();
            _playerCreature.sprite.Position = Camera.CalcBounds ().Center;
            //		_player.PositionAll = SceneCamera.CalcBounds().Center;

            /*
            _block = new PhysicalSpriteUV(new TextureInfo("/Application/assets/floor.png"), _physics);
            _block.PositionAll = new Vector2(SceneCamera.CalcBounds().Center.X + 10, SceneCamera.CalcBounds().Center.Y - 100);
            _physics.sceneBodies[_block.BodyIndex].SetBodyStatic();

            _physics.restitutionCoeff = 0.9f;
            _physics.sceneMax = new Vector2(10000, 10000);
            _physics.sceneMin = new Vector2(-10000, -10000);
            */
            //AddChild (new SpriteUV(new TextureInfo("/Application/king_water_drop.png")));
            //_main.AddChild (_player);

            var background = new SpriteUV (new TextureInfo ("/Application/assets/background.png"));
            background.Quad.S = background.TextureInfo.TextureSizef;
            background.CenterSprite ();
            //_physics.Gravity = new Vector2(0.0f, -98f);
            background.Position = SceneCamera.CalcBounds ().Center;
            //_background.AddChild(background);
            //AddChild(_background);
            //AddChild(_block);
            AddChild (_main);
            _main.AddChild (background);
            _main.AddChild (_playerCreature.sprite);

            _enemies = new ArrayList ();

            // enemy sprite test code
            var fish0 = new FishEnemy (new Vector2 (30.0f, 30.0f), _playerCreature);
            var fish1 = new FishEnemy (new Vector2 (15.0f, 15.0f), _playerCreature);
            var fish2 = new FishEnemy (new Vector2 (100.0f, 70.0f), _playerCreature);

            _enemies.Add (fish0);
            _enemies.Add (fish1);
            _enemies.Add (fish2);

            //	_main.AddChild (FishEnemy.spriteList);
        }
Exemplo n.º 2
0
 private static Node Initialize()
 {
     _instance = new Node();
     SpriteTile[] pieces = {
         Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2),
         Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2),
         Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2)
     };
     pieces[0].Position = new Vector2(-2.0f, 19.0f);
     pieces[1].Position = new Vector2(23.0f, -21.0f);
     pieces[2].Position = new Vector2(-25.0f, -21.0f);
     for (int i = 0; i < pieces.Length; i++) {
         pieces[i].TileIndex1D = 1;
         pieces[i].RegisterPalette(i);
         _instance.AddChild(pieces[i]);
     }
     return _instance;
 }
Exemplo n.º 3
0
        private void Initialize()
        {
            FontMap map = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") );
            FontMap bigMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 44, "Bold") );

            // CREATE PAUSE MENU
            pausePanel = new PausePanel(_scene);
            _scene.DialogLayer.AddChild(pausePanel);
            pausePanel.Hide();

            // CREATE THE HUD BAR AT THE TOP OF THE SCREEN
            GameHudBar = new Node(){
                Position = new Vector2(0.0f, 473.0f)
            };
            this.AddChild(GameHudBar);

            HudBarMask = Support.UnicolorSprite("white", 255, 255, 255, 255);
            HudBarMask.Color = LevelManager.Instance.BackgroundColor;
            HudBarMask.Scale = new Vector2(60.0f, 4.4375f);
            GameHudBar.AddChild(HudBarMask);

            // CREATE THE LEVEL TITLE HUD
            levelTitle = new LevelTitleMkTwo() {
                SlideInDirection = SlideDirection.RIGHT,
                SlideOutDirection = SlideDirection.LEFT,
                Offset = new Vector2(0.0f, 0.0f),
            //				Lifetime = 4.0f
            };
            this.AddChild(levelTitle, -1);

            // CREATE THE END-OF-LEVEL DROP-DOWN PANEL
            if (GameScene.currentLevel == 999) {
                // INFINITE MODE VERSION
                _nextLevelPanel = new InfiniteModeEndPanel(){
                    Offset = new Vector2(Director.Instance.GL.Context.Screen.Width-248.0f, 0.0f),

                };
            } else {
                // PUZZLE/TUTORIAL MODE VERSION
                _nextLevelPanel = new NextLevelPanel(){
                    Offset = new Vector2(510.0f, 0.0f),

                };
            }
            GameHudBar.AddChild(_nextLevelPanel, -1);

            // CREATE MESSAGE PANEL
            _messagePanel = new MessagePanel(920.0f, 148.0f ){
                SourceObject = this,
                Offset = new Vector2(20.0f, 0.0f),
                Position = new Vector2(0.0f, -148.0f),
                Lifetime = 0.0f
            };
            this.AddChild(_messagePanel);
            _messagePanel.body = GamePhysics.Instance.RegisterPhysicsBody(GamePhysics.Instance.SceneShapes[4], float.MaxValue, 0.0f, _messagePanel.Position / GamePhysics.PtoM);
            _messagePanel.AdHocDraw += () => {
                _messagePanel.body.Position = _messagePanel.Position / GamePhysics.PtoM;
            };

            // SCORE STUFF
            //			ScoreIcon = Support.SpriteFromFile("/Application/assets/images/handIcon.png");
            ScoreIcon = Support.SpriteFromAtlas("crystallonUI", "handIcon.png");
            ScoreIcon.Position = new Vector2(184.0f, 16.0f);
            ScoreIcon.RegisterPalette(1);
            GameHudBar.AddChild(ScoreIcon);

            ScoreTitleText = new Label("score", map);
            ScoreTitleText.Position = new Vector2(287, 25.0f);
            ScoreTitleText.RegisterPalette(1);

            BlueBox = Support.UnicolorSprite("white", 255,255,255,255);
            BlueBox.Scale = new Vector2(6.25f, 4.4375f);
            BlueBox.Position = new Vector2(354.0f, 0.0f);
            BlueBox.RegisterPalette(2);

            ScoreText = new Label("", bigMap) {
                Position = SCORE_TEXT_POS
            };
            ScoreText.RegisterPalette(1);
            GameHudBar.AddChild(ScoreText);

            // CUBE STUFF
            //			CubeIcon = Support.SpriteFromFile("/Application/assets/images/stopIcon.png");
            CubeIcon = Support.SpriteFromAtlas("crystallonUI", "stopIcon.png");
            CubeIcon.Position = new Vector2(20.0f,16.0f);
            CubeIcon.RegisterPalette(2);
            GameHudBar.AddChild(CubeIcon);

            CubesTitleText = new Label("cubes", map);
            CubesTitleText.Position = new Vector2(63.0f, 25.0f);
            CubesTitleText.RegisterPalette(2);

            RedBox = Support.UnicolorSprite("white", 255,255,255,255);
            RedBox.Position = new Vector2(130.0f, 0.0f);
            RedBox.Scale = new Vector2(6.25f, 4.4375f);
            RedBox.RegisterPalette(1);

            CubeText = new Label("", bigMap){
                Position = CUBES_TEXT_POS
            };
            CubeText.RegisterPalette(2);
            GameHudBar.AddChild(CubeText);

            // TIMER & STRIKES STUFF
            GameTimer = new TimerEntity();
            if (GameScene.currentLevel == 999) {	// ------------------- IF CHALLENGE MODE
                if(GameScene.gameTimeLimit > 0.0f) {
                    GameTimer.Position = new Vector2(348.0f, 16.0f);	// ----- ADD THE TIME BAR
                    GameHudBar.AddChild(GameTimer);
                } else {
                    BonusBar = new BonusTimer() {
            //						Position = new Vector2(348.0f, 44.0f)
                        Position = new Vector2(348.0f, 16.0f)
                    };
                    GameHudBar.AddChild(BonusBar);
                }

                Strikes = new StrikeHud() {
                    Position = new Vector2(395.0f, 44.0f)
                };
                GameHudBar.AddChild(Strikes);
            }

            // PAUSE BUTTON
            PauseButton = new BetterButton("/Application/assets/images/UI/BetterButtonTransparent.png", 115.0f, 71.0f) {
                Text = "",
            //				Icon = Support.SpriteFromFile("Application/assets/images/UI/pause.png"),
                Icon = Support.SpriteFromAtlas("crystallonUI", "pause.png"),
            //				Position = new Vector2(845.0f, 473.0f),
                Position = new Vector2(845.0f, 0.0f)
            };
            //			this.AddChild(PauseButton);
            GameHudBar.AddChild(PauseButton);
            PauseButton.background.RegisterPalette(2);
            PauseButton.background.Scale = new Vector2(115.0f/32.0f, 71.0f/16.0f);
            PauseButton.Icon.RegisterPalette(2);
            PauseButton.ButtonUpAction += HandlePauseButtonButtonUpAction;

            // HIT ME BUTTON
            HitMeButton = new BetterButton("/Application/assets/images/UI/BetterButtonTransparent.png", 115.0f, 71.0f) {
                Text = "",
            //				Icon = Support.SpriteFromFile("Application/assets/images/UI/plus.png"),
                Icon = Support.SpriteFromAtlas("crystallonUI", "plus.png"),
            //				Position = new Vector2(720.0f, 473.0f),
                Position = new Vector2(720.0f, 0.0f)
            };
            HitMeButton.On(!LevelManager.Instance.HitMeDisabled);
            //			this.AddChild(HitMeButton);
            GameHudBar.AddChild(HitMeButton);
            HitMeButton.background.RegisterPalette(1);
            HitMeButton.background.Scale = new Vector2(115.0f/32.0f, 71.0f/16.0f);
            HitMeButton.Icon.RegisterPalette(1);
            HitMeButton.ButtonUpAction += HandleHitMeButtonButtonUpAction;

            HudBarLine = Support.UnicolorSprite("white", 255, 255, 255, 255);
            HudBarLine.RegisterPalette(0);
            HudBarLine.Scale = new Vector2(60.0f, 0.125f);
            GameHudBar.AddChild(HudBarLine);

            _initialized = true;
        }
Exemplo n.º 4
0
        // 初期化
        public void Initialize()
        {
            // GameEngine2D 画面クリアー色の設定
            Director.Instance.GL.Context.SetClearColor (Colors.Grey20);

            // 画面解像度情報
            //			ScreenSize = new Vector2i (854, 480);
            ScreenSize = new Vector2i (960, 544);

            // 効果音の設定
            var soundObj = new Sound ("/Application/assets/se.wav");
            Sound = soundObj.CreatePlayer ();

            // BGMの設定
            bgm = new Bgm ("/Application/assets/bgm.mp3");
            player = bgm.CreatePlayer ();
            player.Loop = true; // リピート再生する
            // BGMの再生
            player.Play ();

            // シーン生成(ノードのルートになる)
            var scene = new Sce.PlayStation.HighLevel.GameEngine2D.Scene ();

            // 2Dゲーム向けにカメラを設定
            scene.Camera.SetViewFromViewport ();

            // GameEngine2Dを実行
            Director.Instance.RunWithScene (scene, true);

            Pause = false;

            World = new Node ();
            //	Interface = new Node ();
            // シーンにWorldを追加する
            scene.AddChild (World);
            // シーンにInterface(UIで利用する)を追加する
            //	scene.AddChild (Interface);

            // 背景登録
            for (int y = 0; y < 7; y++) {
                for (int x = 0; x < 6; x++) {
                    var backGround = new BackGround (new Vector2 (x * 192, y * 128));
                    World.AddChild (backGround);
                }
            }

            // 自機(プレイヤー)登録
            Player = new Player (new Vector2 (Game.Instance.ScreenSize.X/2, 100));
            World.AddChild (Player);
            // 敵機(ボス)登録
            Boss = new Boss (new Vector2 (Game.Instance.ScreenSize.X/2, 250));
            World.AddChild (Boss);
            // UI登録
            UI = new UI ();
            //Interface.AddChild (UI);
            scene.AddChild (UI);
            // 当たり判定処理の生成
            HitTest = new HitTest ();
            // 登録キュー
            AddQueue = new List<GameEntity> ();
            // 削除キュー
            RemoveQueue = new List<GameEntity> ();
        }
Exemplo n.º 5
0
        //初期化 ・・・AppMainから呼ばれる
        public void Initialize()
        {
            flg = false;
            var width = Director.Instance.GL.Context.GetViewport().Width;
            var height = Director.Instance.GL.Context.GetViewport().Height;

            Director.Instance.GL.Context.SetClearColor(Colors.Grey20);
            ScreenSize = new Vector2i(width,height);

            //sceneの作成
            Sce.PlayStation.HighLevel.GameEngine2D.Scene scene = new Sce.PlayStation.HighLevel.GameEngine2D.Scene();
            scene.Camera.SetViewFromViewport();

            //GameEngine2Dの設定・実行
            Director.Instance.RunWithScene(scene,true);

            World = new Node();
            scene.AddChild(World);

            //自弾敵弾はキューで管理
            AddQueue = new List<BulletEntity>();
            RemoveQueue = new List<BulletEntity>();

            HitTest = new HitTest();

            //背景登録
            for (int y = 0; y < 3; y++) {
                for (int x = 0; x < 3; x++) {
                    var backGround = new BackGround (new Vector2 (x * 416f*2.5f, y * 232f * 2.5f),Const.BACKGROUND_PATH,2.5f);
                    World.AddChild (backGround);
                }
            }

            //敵機登録
            Boss = new Boss(new Vector2(Game.Instance.ScreenSize.X-Game.Instance.ScreenSize.X/8,0),Const.BOSS_SHIP_PATH);
            World.AddChild (Boss);

            //自機登録・・・(初期位置,自機画像path)で自機ノードを作成してworldに登録
            Player = new Player(new Vector2(50,Game.Instance.ScreenSize.Y/2),Const.PLAYER_SHIP_PATH);
            World.AddChild(Player);

            HpBar = new hpDialog();
        }
Exemplo n.º 6
0
        public static void Main(string[] args)
        {
            Sce.PlayStation.Core.Graphics.GraphicsContext
             		context = new Sce.PlayStation.Core.Graphics.GraphicsContext();
                        uint sprites_capacity = 500;
            uint draw_helpers_capacity=400;

            System.Random rand = new System.Random();
                Director.Initialize(sprites_capacity,
                                draw_helpers_capacity, context);
            Director.Instance.GL.Context.SetClearColor(Colors.Grey20);

            var scene = new Scene();
            scene.Camera.SetViewFromViewport();

            Director.Instance.RunWithScene(scene,true);
            _physics = new GamePhysics();
            holder = new Node();

            var _screenWidth = Director.Instance.GL.Context.GetViewport().Width;
            var _screenHeight = Director.Instance.GL.Context.GetViewport().Height;
            currentLevelData = LevelData.LEVEL_DATA[0];
            cards = new Card[currentLevelData.Length];
            for (int i = 0; i < cards.Length; i++) {
                Vector2 start_pos = new Vector2(50f + 0.75f * _screenWidth * (float)rand.NextDouble(), 50f + 0.75f * _screenHeight * (float)rand.NextDouble ());
                cards[i] = new Card(_physics.addCardPhysics(start_pos), currentLevelData[i]);

                holder.AddChild (cards[i]);
            }

            scene.AddChild(holder);

            //cubeFaces = new SpriteSingleton();
            cubeFaces = SpriteSingleton.getInstance();
            sprite = cubeFaces.Get("topSide");
            sprite.Name = "topSide";
            sprite2 = cubeFaces.Get ("leftSide");
            sprite2.Name = "leftSide";
            sprite3 = cubeFaces.Get("rightSide");
            sprite3.Name = "rightSide";

            Vector2 vectHolder = sprite2.CalcSizeInPixels();
            sprite3.Position = new Vector2(vectHolder.X-84, sprite3.Position.Y);
            sprite.Position = new Vector2(vectHolder.X/4, (sprite.Position.Y + vectHolder.X/2)-12);
            //sprite3.Position = new Vector2(sprite2.Position.Length,
            //                               sprite2.Position.Y);
            //sprite.Position = scene.Camera.CalcBounds().Center;
            //sprite.CenterSprite();
            //sprite.Scale = new Vector2(1,1);

            cube3 = new Node();
            cube3.AddChild(sprite);
            cube3.AddChild(sprite2);
            cube3.AddChild(sprite3);
            scene.AddChild(cube3);

            //pink
            //sprite.RunAction(new TintTo (new Vector4(0.96f,0.88f,0.88f,1.0f),0.1f));
            //red
            //sprite.RunAction(new TintTo (new Vector4(0.90f,0.075f,0.075f,1.0f),0.1f));

            var spriteName="topSide";
            sprite.TileIndex2D = cubeFaces.Get (spriteName).TileIndex2D;
            Console.WriteLine(sprite.TileIndex2D);
            //teal
            //sprite.RunAction(new TintTo (new Vector4(0.16f,0.88f,0.88f,1.0f),0.1f));

            var cube = new Cube();
            cube.card1("red");
            cube.card2 ("blue");
            cube.card3("blue");

                while(!Input2.GamePad0.Cross.Press)
            {
                var vect = new Vector2(cube3.Position.X +10, cube3.Position.Y +3);
                cube3.Position = vect;
                Sce.PlayStation.Core.Environment.SystemEvents.CheckEvents();
                Director.Instance.Update();
                Director.Instance.Render();
                Director.Instance.GL.Context.SwapBuffers();
                Director.Instance.PostSwap();
                    cube.testCube();

            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public void Initialize()
        {
            // リールより後ろにある画像をロード
            _reelBg = new SpriteUV(new TextureInfo("/Application/resources/SlotReelBg.png"));
            _reelBg.Scale = new Vector2(1.0f);
            _reelBg.Quad.S = _reelBg.TextureInfo.TextureSizef;
            _reelBg.CenterSprite();
            _reelBg.Position = new Vector2(_root.Camera.CalcBounds().Size.X * 0.5f, _root.Camera.CalcBounds().Size.Y * 0.5f);

            // リールより前にある画像をロード
            _reelFg = new SpriteUV(new TextureInfo("/Application/resources/SlotReelFg.png"));
            _reelFg.Scale = new Vector2(1.0f);
            _reelFg.Quad.S = _reelBg.TextureInfo.TextureSizef;
            _reelFg.CenterSprite();
            _reelFg.Position = new Vector2(_root.Camera.CalcBounds().Size.X * 0.5f, _root.Camera.CalcBounds().Size.Y * 0.5f);

            // 各リールを表示するためのノードを作成する
            _nodeLeft = new Node();
            _nodeCenter = new Node();
            _nodeRight = new Node();

            // 各シンボルは辞書に保存しておく
            _symbolDic = new Dictionary<Symbol.SymbolType, Symbol>();
            _symbolDic.Add(Symbol.SymbolType.Bar, new Symbol("/Application/resources/Bar.png",Symbol.SymbolType.Bar));
            _symbolDic.Add(Symbol.SymbolType.Bell, new Symbol("/Application/resources/Bell.png",Symbol.SymbolType.Bell));
            _symbolDic.Add(Symbol.SymbolType.BlueSeven, new Symbol("/Application/resources/BlueSeven.png",Symbol.SymbolType.BlueSeven));
            _symbolDic.Add(Symbol.SymbolType.Cherry, new Symbol("/Application/resources/Cherry.png",Symbol.SymbolType.Cherry));
            _symbolDic.Add(Symbol.SymbolType.Orange, new Symbol("/Application/resources/Orange.png",Symbol.SymbolType.Orange));
            _symbolDic.Add(Symbol.SymbolType.RedSeven, new Symbol("/Application/resources/RedSeven.png",Symbol.SymbolType.RedSeven));
            _symbolDic.Add(Symbol.SymbolType.Reply, new Symbol("/Application/resources/Reply.png",Symbol.SymbolType.Reply));
            _symbolDic.Add(Symbol.SymbolType.Watermelon, new Symbol("/Application/resources/Watermelon.png",Symbol.SymbolType.Watermelon));

            // 図柄コンテナクラスを作成。引数は図柄のWidthとHeight
            _symbolsLeft = new SymbolCollection(128, 128);
            _symbolsCenter = new SymbolCollection(128, 128);
            _symbolsRight = new SymbolCollection(128, 128);

            #if true
            // 左側リールの図柄設定
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.BlueSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);

            // 中央リールの図柄設定
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.BlueSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.BlueSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);

            // 右側リールの図柄設定
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.BlueSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.BlueSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bell]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Watermelon]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            #else
            // 左側リールの図柄設定
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsLeft.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);

            // 中央リールの図柄設定
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsCenter.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);

            // 右側リールの図柄設定
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Reply]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Cherry]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.Bar]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);
            _symbolsRight.AddSymbol(_symbolDic[Symbol.SymbolType.RedSeven]);

            #endif

            // リールインスタンス作成
            _reelLeft = new Reel(_symbolsLeft);
            _reelCenter = new Reel(_symbolsCenter);
            _reelRight = new Reel(_symbolsRight);

            // 停止イベントハンドラ設定
            _reelLeft.Stopped += OnStopped;
            _reelCenter.Stopped += OnStopped;
            _reelRight.Stopped += OnStopped;

            // リールリストに各リールを設定
            ReelList.Add(_reelLeft);
            ReelList.Add(_reelCenter);
            ReelList.Add(_reelRight);

            // 表示位置設定
            // 左側のリール
            _nodeLeft.Position = new Vector2(
                _root.Camera.CalcBounds().Size.X * 0.5f - _symbolsLeft.Width - 32,
                _root.Camera.CalcBounds().Size.Y * 0.5f);

            // 中央のリール
            _nodeCenter.Position = new Vector2(
                _root.Camera.CalcBounds().Size.X * 0.5f,
                _root.Camera.CalcBounds().Size.Y * 0.5f);

            // 右側のリール
            _nodeRight.Position = new Vector2(
                _root.Camera.CalcBounds().Size.X * 0.5f + _symbolsLeft.Width + 32,
                _root.Camera.CalcBounds().Size.Y * 0.5f);

            // 図柄を各リールの子ノードとして追加する
            foreach(var symbol in _symbolsLeft)
            {
                _nodeLeft.AddChild(symbol.Image);
            }

            foreach(var symbol in _symbolsCenter)
            {
                _nodeCenter.AddChild(symbol.Image);
            }

            foreach(var symbol in _symbolsRight)
            {
                _nodeRight.AddChild(symbol.Image);
            }

            // ReelViewの子ノードとして追加
            AddChild(_reelBg);
            AddChild(_reelFg, 100);	// 前面に表示するため、優先順位を上げる
            AddChild(_nodeLeft);
            AddChild(_nodeCenter);
            AddChild(_nodeRight);
        }
Exemplo n.º 8
0
        // CONSTRUCTOR ---------------------------------------------------------------------------------------
        public LoadingScene(string pDestination, GameSceneData pData = null)
        {
            if(pData==null) {
                pData = DEFAULT_GAME_SCENE_DATA;
                GAME_SCENE_DATA = pData;
            }

            this.Camera.SetViewFromViewport();

            stopwatch = Stopwatch.StartNew();

            _levelNumber = pData.level;
            _gameTimer = pData.timeLimit;
            _angle = 0.0f;
            _timer = 0.0f;
            _loadIndex = 0;

            Hub = new Node();
            Hub.Position = new Vector2(480.0f, 272.0f);
            this.AddChild(Hub);

            //			LoadingSpinner = Support.SpriteFromFile("/Application/assets/images/UI/loading.png");
            LoadingSpinner = Support.SpriteFromAtlas("crystallonUI", "loading.png");
            LoadingSpinner.Pivot = new Vector2(0.5f, 0.5f);
            LoadingSpinner.Position = new Vector2(-145.0f, -119.0f);
            LoadingSpinner.RegisterPalette(1);
            Hub.AddChild(LoadingSpinner);

            LoadingText = new Label("loading", UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold")));
            LoadingText.Position = new Vector2(445.0f, 257.0f);
            LoadingText.RegisterPalette(2);
            this.AddChild(LoadingText);

            // LOADING PROCEDURE HEADER
            loadProc = new List<Action>{
                () => {
                    ;//dummy
                },
                () => {
                    InputManager.Instance.enabled = false;
                },
                // PRE-LOAD LEVEL DATA
                () => {
                    LevelManager.Instance.LoadGameData();
                }
            };

            switch(pDestination) {
            case("Level Select"):
                AddLevelSelectProcs();
                break;
            case("Menu"):
                AddMenuProcs();
                break;
            case("Game"):
            default:
                AddGameProcs();
                break;
            }

            loadProc.AddRange( new List<Action> {
                () => {
                    InputManager.Instance.enabled = true;
                }
            } );

            Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
        }
 /// <summary>
 /// Attach this entity to a <c>Node</c>-descended entity after removing it from its current <c>Parent</c>.
 /// </summary>
 /// <param name='pNewParent'>
 /// <see cref="Sce.PlayStation.HighLevel.GameEngine2D.Node"/>
 /// </param>
 public void attachTo( Node pNewParent )
 {
     Node node = getNode();
     if (node.Parent == pNewParent ) {
         return;
     }
     if (getBody() != null) {
         removePhysicsBody();
     }
     if (node.Parent != null) {
         if (node.Parent is Layer) {
             removeFromScene(false);
         } else {
             node.Parent.RemoveChild(node, false);
         }
     }
     pNewParent.AddChild(node);
 }