コード例 #1
0
ファイル: GameScreen.cs プロジェクト: otnemarcas/amude
        private GameScreen()
        {
            handlers  = new Stack <IInputHandler>();
            mapCursor = new MapCursor();

            titleFont   = IO.LoadFont("Data/Global/TitleFont");
            actionFont  = IO.LoadFont("Data/Global/ActionFont");
            messageFont = IO.LoadFont("Data/Global/MessageFont");

            topEdgePosition    = Vector2.Zero;
            bottomEdgePosition = new Vector2(0, 788);
            leftEdgePosition   = new Vector2(0, 12);
            midleEdgePosition  = new Vector2(980, 12);
            rightEdgePosition  = new Vector2(1268, 12);

            hEdgeTexture = IO.LoadSingleTexture(GAME_ROOT_DIRECTORY + "horizontaledge");
            vEdgeTexture = IO.LoadSingleTexture(GAME_ROOT_DIRECTORY + "verticaledge");

            tacticsTitlePosition = new Vector2(183, 339);
            battleTitlePosition  = new Vector2(137, 339);
            titleColor           = new Color(0, 0, 0, 255);

            actionBoxTexture = IO.LoadSingleTexture(GAME_ROOT_DIRECTORY + "actionbox");
            actionBox        = new ActionBox(actionFont, actionBoxTexture);
            infoBox          = new InfoBox();
            chatBox          = new ChatBox();
        }
コード例 #2
0
        private void Button_Click(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            ActionBox.Text += button.Text;
            ActionBox.Focus();
            ActionBox.SelectionStart = ActionBox.Text.Length;
        }
コード例 #3
0
        public Playfield(Texture2D[] accordianTexture, Texture2D[] noteTexture, Texture2D[] banjoTexture, Texture2D[] explosionTexture, Texture2D pixelTexture,
                         Vector2 defaultPlayerLocation, Vector2[] banjoSpawnLocation,
                         SoundEffect accordianFireSound, SoundEffect explosionSound, int maxSprites = 100)
        {
            AccordianTexture = accordianTexture;
            BanjoTexture     = banjoTexture;
            NoteTexture      = noteTexture;
            ExplosionTexture = explosionTexture;

            AccordianFireSound = accordianFireSound;
            ExplosionSound     = explosionSound;

            Banjos        = new List <Banjo>();
            Notes         = new List <Note>();
            GarbageBanjos = new List <int>();
            GarbageNotes  = new List <int>();

            // Set up color array sizes
            AccordianColorData = new Color[accordianTexture[0].Width * accordianTexture[0].Height];
            BanjoColorData     = new Color[3][];
            BanjoColorData[0]  = new Color[banjoTexture[0].Width * banjoTexture[0].Height];
            BanjoColorData[1]  = new Color[banjoTexture[1].Width * banjoTexture[1].Height];
            BanjoColorData[2]  = new Color[banjoTexture[2].Width * banjoTexture[2].Height];
            NoteColorData      = new Color[3][];
            NoteColorData[0]   = new Color[noteTexture[0].Width * noteTexture[0].Height];
            NoteColorData[1]   = new Color[noteTexture[1].Width * noteTexture[1].Height];
            NoteColorData[2]   = new Color[noteTexture[2].Width * noteTexture[2].Height];

            // Give color arrays data accordingly
            AccordianTexture[0].GetData(AccordianColorData);
            BanjoTexture[0].GetData(BanjoColorData[0]);
            BanjoTexture[1].GetData(BanjoColorData[1]);
            BanjoTexture[2].GetData(BanjoColorData[2]);
            NoteTexture[0].GetData(NoteColorData[0]);
            NoteTexture[1].GetData(NoteColorData[1]);
            NoteTexture[2].GetData(NoteColorData[2]);

            BanjoSpawnPoint    = new SpawnPoint[5];
            BanjoSpawnPoint[0] = new SpawnPoint(banjoSpawnLocation[0], pixelTexture);
            BanjoSpawnPoint[1] = new SpawnPoint(banjoSpawnLocation[1], pixelTexture);
            BanjoSpawnPoint[2] = new SpawnPoint(banjoSpawnLocation[2], pixelTexture);
            BanjoSpawnPoint[3] = new SpawnPoint(banjoSpawnLocation[3], pixelTexture);
            BanjoSpawnPoint[4] = new SpawnPoint(banjoSpawnLocation[4], pixelTexture);

            CollisionDetector = new CollisionDetector(this, pixelTexture);

            ObjectBox = new ActionBox(pixelTexture, Color.Blue, 0, 0);

            _defaultPlayerLocation = defaultPlayerLocation;
            _explosionLocations    = new Vector2[4];

            // Set maximum number of sprites
            _maxSprites = maxSprites;

            _noteLayerPoint  = 0.719f;
            _banjoLayerPoint = 0.799f;
            _randGen         = new Random();
        }
コード例 #4
0
//#7------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        private void Threadhandler()
        {
            try
            {
                BenchTimer.Start();
                ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Minimum = s; }), 0);
                ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Maximum = s; }), 1);
                ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Value = s; }), 0);
                AllFilesToConvert.Clear();
                AllActionMessages.Clear();
                if (FilePath.Length > 0)
                {
                    ConvertString(FilePath);
                    ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Value = s; }), 1);
                }
                if (FolderPath.Length > 0)
                {
                    CheckSubFolders(FolderPath);
                    ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Maximum = s; }), AllFilesToConvert.Count - 1);
                    for (int i = 0; i < AllFilesToConvert.Count; i++)
                    {
                        ConvertString(AllFilesToConvert[i]);
                        ProgressBar1.Invoke(new Action <int>(s => { ProgressBar1.Value = s; }), i);
                    }
                }
                MethodInvoker AddItems = delegate
                {
                    for (int i = 0; i < AllActionMessages.Count; i++)
                    {
                        ActionBox.Items.Add(AllActionMessages[i]);
                    }
                };
                ActionBox.BeginInvoke(AddItems);
                BenchTimer.Stop();
                MessageBox.Show(string.Format(FinalMessage, ChangeCount, ChangedFileCount, BenchTimer.ElapsedMilliseconds.ToString()));
                BenchTimer.Reset();
                FileBrowse.Invoke(new Action <bool>(s => { FileBrowse.Enabled = s; }), true);
                FolderBrowse.Invoke(new Action <bool>(s => { FolderBrowse.Enabled = s; }), true);
                ConvertButton.Invoke(new Action <bool>(s => { ConvertButton.Enabled = s; }), true);
                OldStringTextBox.Invoke(new Action <bool>(s => { OldStringTextBox.Enabled = s; }), true);
                NewStringTextBox.Invoke(new Action <bool>(s => { NewStringTextBox.Enabled = s; }), true);
                CaseSensitiveCheckBox.Invoke(new Action <bool>(s => { CaseSensitiveCheckBox.Enabled = s; }), true);
                WholeWordCheckBox.Invoke(new Action <bool>(s => { WholeWordCheckBox.Enabled = s; }), true);
                if (!SourceFilePathBox.Text.Equals(TempPath))
                {
                    SourceBrowse.Invoke(new Action <bool>(s => { SourceBrowse.Enabled = s; }), true);
                    DownloadSourceButton.Invoke(new Action <bool>(s => { DownloadSourceButton.Enabled = s; }), true);
                }
            }
            catch
            {
            }
        }
コード例 #5
0
 public Accordian(int identityNo, ActionBox box, Texture2D[] texture, Color[] textureColorData, Explosion[] explosions, Random explosionPointGen, SoundEffect explodeSound, SoundEffect noteFireSound, Vector2 location, int lives, int score)
 {
     ID               = identityNo;
     Texture          = texture[0];
     TextureGlow      = texture[1];
     TextureColorData = textureColorData;
     Location         = location;
     Lives            = lives;
     Score            = new ScoreHandler();
     Score.Value      = score;
     Box              = new ActionBox(box.PixelTexture, box.Color, (int)Location.X, (int)Location.Y, (int)(Texture.Width * _scale), (int)(Texture.Height * _scale));
     _noteSpawnPoint  = new Vector2(0, location.Y);
     _noteFireSound   = noteFireSound;
     base.SetupExplosions(explosions, explosionPointGen, explodeSound);
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: koonath/mwp
        public Form1()
        {
            InitializeComponent();

            filePathsList  = new List <string>();
            files          = null;
            actionSelected = (int)features.None;

            currentUser         = System.Environment.UserName;
            now                 = ProvideDateTimeNow();
            destinationFilePath = @"C:\Users\" + currentUser + @"\Desktop\" + now + ".pdf";

            HideAll();

            ActionBox.Show();
        }
コード例 #7
0
ファイル: GameScreen.cs プロジェクト: otnemarcas/amude
        public void ChangeMode(GameScreenMode mode)
        {
            ActionBox.ClearOptions();
            ClearTileMarks();
            this.mode    = mode;
            showTitle    = true;
            titleColor.A = 255;
            handlers.Clear();

            if (mode == GameScreenMode.TacticsMode)
            {
                handlers.Push(new TacticsInputHandler(this));
            }
            else if (mode == GameScreenMode.BattleMode)
            {
                handlers.Push(new BattleInputHandler(this));
            }
        }
コード例 #8
0
        public Note(int identityNo, int parentIdentityNo, ActionBox box, Texture2D[] textures, Color[][] textureColorData, Vector2 location, Playfield playfield, float layerPoint, bool targetPlayer = false, float xVelocity = 0, float yVelocity = 0)
        {
            ID                = identityNo;
            ParentID          = parentIdentityNo;
            Textures          = textures;
            Texture           = textures[0];
            TexturesColorData = textureColorData;
            TextureColorData  = textureColorData[0];
            Location          = location;
            Box               = new ActionBox(box.PixelTexture, box.Color, (int)Location.X, (int)Location.Y, (int)(Texture.Width * _scale), (int)(Texture.Height * _scale));
            LayerPoint        = layerPoint;

            TargetPlayer = targetPlayer;
            if (targetPlayer == true && xVelocity == 0 && yVelocity == 0)
            {
                GetBidirectionalVelocity(playfield.Player.Location);
            }
            else
            {
                _xVelocity = xVelocity;
                _yVelocity = yVelocity;
            }
        }
コード例 #9
0
        public Banjo(int identityNo, ActionBox box, BanjoType type, Texture2D[] textures, Color[][] textureColorData, Explosion[] explosions, Random explosionPointGen, SoundEffect explodeSound, Vector2 location, float layerPoint, int ageInMilliseconds = 0)
        {
            ID   = identityNo;
            Type = type;
            if (Type == BanjoType.Normal)
            {
                Texture          = textures[0];
                TextureColorData = textureColorData[0];
                Velocity         = 1;
                HitPoints        = 1;
                ScoreValue       = 10;
            }
            else if (Type == BanjoType.Hunter)
            {
                Texture          = textures[1];
                TextureColorData = textureColorData[1];
                Velocity         = 1;
                HitPoints        = 1;
                ScoreValue       = 20;
            }
            else
            {
                Texture          = textures[2];
                TextureColorData = textureColorData[2];
                Velocity         = 3;
                HitPoints        = 2;
                ScoreValue       = 50;
            }

            Location          = location;
            Box               = new ActionBox(box.PixelTexture, box.Color, (int)Location.X, (int)Location.Y, (int)(Texture.Width * _scale), (int)(Texture.Height * _scale));
            LayerPoint        = layerPoint;
            AgeInMilliseconds = ageInMilliseconds;
            _random           = explosionPointGen;
            base.SetupExplosions(explosions, explosionPointGen, explodeSound);
        }
コード例 #10
0
 public void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
 }
コード例 #11
0
 public SpawnPoint(Vector2 location, Texture2D pixelTexture)
 {
     Location = location;
     Box      = new ActionBox(pixelTexture, Color.Yellow, (int)location.X, (int)location.Y, 20, 20);
     Box.UpdateDraw();
 }