コード例 #1
0
        public void Init()
        {
            spriteList = new SpriteList(spriteBatch);
            textDict = new TextureDict();

            textDict.Add("box_debug", contentManager.Load<Texture2D>("Image/Debug/box_debug"));
            textDict.Add("block_face", contentManager.Load<Texture2D>("Image/Debug/block_face"));
            textDict.Add("bar", contentManager.Load<Texture2D>("Image/bar/bar"));
            touchPointInput = new TouchPointInput(150, 100);
            StartGame();
        }
コード例 #2
0
ファイル: Sprite.cs プロジェクト: cikidot/game-xna-herobot
 public virtual bool EventTap(TouchPointInput touch)
 {
     if (touch.OnReleased && this.RecArea.Contains((int) touch.releaseLocation.X, (int) touch.releaseLocation.Y)) {
         return true;
     }
     return false;
 }
コード例 #3
0
        public void InitResources()
        {
            // Init SpriteList //
            spriteList = new SpriteList(spriteBatch);
            // Init All Texture //
            textDict = new TextureDict();

            textDict.Add("box_debug", contentManager.Load<Texture2D>("Image/Debug/box_debug"));
            textDict.Add("block_face", contentManager.Load<Texture2D>("Image/Debug/block_face"));
            textDict.Add("bar", contentManager.Load<Texture2D>("Image/Bar/bar"));
            textDict.Add("Enemy_Ball", contentManager.Load<Texture2D>("Image/Character/Enemy_Ball"));
            textDict.Add("Enemy_Tube", contentManager.Load<Texture2D>("Image/Character/Enemy_Tube"));
            textDict.Add("hero", contentManager.Load<Texture2D>("Image/Character/hero"));
            textDict.Add("plane", contentManager.Load<Texture2D>("Image/Character/baseplane"));
            textDict.Add("nut", contentManager.Load<Texture2D>("Image/Other/nut_real"));
            textDict.Add("background", contentManager.Load<Texture2D>("Image/Background/BG_play_witP"));

            textDict.Add("pause_bg", contentManager.Load<Texture2D>("Image/Background/pause-bg"));
            textDict.Add("pausebtn_close", contentManager.Load<Texture2D>("Image/Button/pausebtn_close"));
            textDict.Add("pausebtn_restart", contentManager.Load<Texture2D>("Image/Button/pausebtn_restart"));
            textDict.Add("pausebtn_resume",contentManager.Load<Texture2D>("Image/Button/pausebtn_resume"));
            textDict.Add("pausebtn_button", contentManager.Load<Texture2D>("Image/Button/pausebtn_button"));
            touchPointInput = new TouchPointInput(150, 100);

            // Init Pause Sprite List //
            pauseSpriteList = new SpriteList(spriteBatch);

            pauseSpriteList.AddSprite(new Sprite(textDict.Get("pause_bg"), Vector2.Zero,new Color(255,255,255,128)));

            //pauseSpriteList.AddSprite(new Sprite(textDict.Get("pausebtn_button"), new Vector2(360, 10), Color.White));

            // Generate enemy spawn time //
            EnemySpawnTime = DataRandom.GetEnemySpawnAtLevel(1);
        }