コード例 #1
0
        public void Draw(IResourceImage resource, int layer, MegaMan.Common.Geometry.Point position, MegaRect? sourceRect = null, bool flipHorizontal = false, bool flipVertical = false)
        {
            if (!IsLayerEnabled(layer)) return;

            var texture = _loadedTextures[resource.ResourceId];
            var batch = _spriteBatchLayers[layer];

            if (resource.PaletteName != null)
            {
                var palette = PaletteSystem.Get(resource.PaletteName);
                if (palette != null)
                {
                    VerifyPaletteSwaps(palette, resource.ResourceId, texture);
                    texture = this._paletteSwaps[resource.ResourceId][palette.CurrentIndex];
                }
            }

            var destination = new Vector2(position.X, position.Y);

            XnaRect? source = null;
            if (sourceRect != null)
                source = new XnaRect(sourceRect.Value.X, sourceRect.Value.Y, sourceRect.Value.Width, sourceRect.Value.Height);

            SpriteEffects effect = SpriteEffects.None;
            if (flipHorizontal) effect = SpriteEffects.FlipHorizontally;
            if (flipVertical) effect |= SpriteEffects.FlipVertically;

            batch.Draw(texture,
                destination, source,
                _opacityColor, 0,
                Vector2.Zero, 1, effect, 0);
        }
コード例 #2
0
        //public AudioClip bgMusic;

        public GameWorldState(GamePanel gamePanel, GameTime time) : base(gamePanel, time)
        {
            texts1[0] = "We are heros, and our mission is protecting our Home\nEarth....";
            texts1[1] = "There was a Monster from University on Earth in 10 years\n"
                        + "and we lived in the scare in that 10 years....";
            texts1[2]    = "Now is the time for us, kill it and get freedom!....";
            texts1[3]    = "      LET'S GO!.....";
            textTutorial = texts1[0];


            bufferedImage = new Bitmap(GameFrame.SCREEN_WIDTH, GameFrame.SCREEN_HEIGHT);
            megaMan       = new MegaMan(400, 400, this);
            physicalMap   = new PhysicalMap(0, 0, this);
            backgroundMap = new BackgroundMap(0, 0, this);
            camera        = new Camera(0, 50, GameFrame.SCREEN_WIDTH, GameFrame.SCREEN_HEIGHT, this);
            bulletManager = new BulletManager(this);

            particularObjectManager = new ParticularObjectManager(this);
            particularObjectManager.addObject(megaMan);

            initEnemies();

            //bgMusic = CacheDataLoader.getInstance().getSound("bgmusic");
            previousState = state;
        }
コード例 #3
0
ファイル: BusterGun.cs プロジェクト: Garry125/Dragon-Wars
    void Start()
    {
        mAnimator = transform.parent.GetComponent <Animator>();

        mMegaManRef  = GameObject.Find("player").GetComponent <MegaMan>();
        mBusterSound = GameObject.Find("Fire").GetComponent <AudioSource>();
    }
コード例 #4
0
    void Start()
    {
        mMegaMan = GameObject.Find("Mega Man").GetComponent <MegaMan>();
        mFilled  = transform.FindChild("Filled").GetComponentsInChildren <SpriteRenderer>();
//        mEmpty = transform.FindChild("Empty").GetComponentsInChildren<SpriteRenderer>();
        mMaxHealth = mFilled.Length;
        mIndex     = mFilled.Length - 1;
    }
コード例 #5
0
ファイル: BusterGun.cs プロジェクト: navdeep007/FinalGame
    void Start()
    {
        mAnimator = transform.parent.GetComponent <Animator>();


        mMegaManRef  = transform.parent.GetComponent <MegaMan>();
        mBusterSound = transform.parent.GetComponent <AudioSource>();
    }
コード例 #6
0
        static void Main(string[] args)
        {
            MegaMan mega = new MegaMan();

            mega.Correr();

            Zero zero = new Zero();

            zero.Pulo();
        }
コード例 #7
0
ファイル: BusterGun.cs プロジェクト: MadReza/Demo_Add-Unity
    void Start()
    {
        mAnimator = transform.parent.GetComponent <Animator>();
        // TODO: Get a reference to the following items and store them:
        //          - MegaMan component in the "Mega Man" game object (store in "mMegaManRef")
        //          - AudioSource component in "BusterGun" game object (store in "mBusterSound")

        mMegaManRef  = transform.parent.GetComponent <MegaMan>();
        mBusterSound = GetComponent <AudioSource>();
    }
コード例 #8
0
        static void Main(string[] args)
        {
            MegaMan jogador = new MegaMan();

            Console.WriteLine($"Jogador 1 = {jogador.Correr()}");

            Zero jogador2 = new Zero();

            jogador2.Correr();
        }
コード例 #9
0
        static void Main(string[] args)
        {
            MegaMan megaMan = new MegaMan();

            Console.WriteLine($"MegaMan - {megaMan.Correr()}");

            Zero zero = new Zero();

            Console.WriteLine($"Zero - {zero.Correr()}");
        }
コード例 #10
0
        static void Main(string[] args)
        {
            MegaMan jogador1 = new MegaMan();

            Console.WriteLine($"Jogador 1 = {jogador1.Correr()} e {jogador1.Pular()}");

            Zero jogador2 = new Zero();

            Console.WriteLine($"Jogador 2 = {jogador2.Correr()} e {jogador2.Pular()}");
            //fim
        }
コード例 #11
0
        static void Main(string[] args)
        {
            Zero    z = new Zero();
            MegaMan m = new MegaMan();

            Console.WriteLine(z.Correr());
            Console.WriteLine(z.Pular());

            Console.WriteLine(m.Correr());
            Console.WriteLine(m.Pular());
        }
コード例 #12
0
        static void Main(string[] args)
        {
            MegaMan jogador = new MegaMan();

            Console.WriteLine($"MegaMan = {jogador.Correr()}");
            Console.WriteLine($"MegaMan = {jogador.Pular()}");
            Console.WriteLine($"MegaMan = habilidade: {jogador.Buster}");

            Zero jogador2 = new Zero();

            Console.WriteLine($"Zero = {jogador2.Correr()}");
            Console.WriteLine($"Zero = {jogador2.Pular()}");
            Console.WriteLine($"Zero = habilidade: {jogador2.Sword}");
        }
コード例 #13
0
 void Start()
 {
     mMegaMan = GameObject.Find("Mega Man").GetComponent <MegaMan>();
 }
コード例 #14
0
ファイル: StageDocument.cs プロジェクト: laazer/cs_megaman
 private ScreenDocument WrapScreen(MegaMan.Common.ScreenInfo screen)
 {
     ScreenDocument doc = new ScreenDocument(screen, this);
     screens.Add(screen.Name, doc);
     doc.Renamed += ScreenRenamed;
     doc.TileChanged += () => Dirty = true;
     doc.Resized += (w, h) => OnScreenResized(doc, w, h);
     return doc;
 }
コード例 #15
0
 private void SetCanvasLocation(ScreenCanvas surface, MegaMan.Common.Geometry.Point location)
 {
     surface.Margin = new Thickness(location.X, location.Y, 0, 0);
 }
コード例 #16
0
 public static void Draw(IRenderingContext renderContext, int layer, string font, string text, MegaMan.Common.Geometry.Point position)
 {
     fonts[font].Draw(renderContext, layer, text, position);
 }
コード例 #17
0
        static void Main(string[] args)
        {
            MegaMan mega = new MegaMan();

            mega.Correr();
        }
コード例 #18
0
 private void Awake()
 {
     m_Character = GetComponent <MegaMan>();
 }
コード例 #19
0
ファイル: BusterGun.cs プロジェクト: Guralap/Zombie-war
    void Start()
    {
        mAnimator = transform.parent.GetComponent <Animator>();

        mMegaManRef = transform.parent.GetComponent <MegaMan>();
    }