コード例 #1
0
ファイル: Player.cs プロジェクト: Gewf/SpongeGame
 public Player(Vector2 startPos, Vector2 gravity)
 {
     facingRight = true;
     //fireflower = false;
     isInvincible         = true;
     this.gravity         = gravity;
     this.position        = startPos;
     this.velocity        = Vector2.Zero;
     this.size            = new Vector2(38, 64);
     walkAnimation        = new Texture2D[4];
     walkAnimation[0]     = ContentPipe.LoadTexture("sponge.png");
     walkAnimation[1]     = ContentPipe.LoadTexture("sponge1.png");
     walkAnimation[2]     = ContentPipe.LoadTexture("sponge2.png");
     walkAnimation[3]     = ContentPipe.LoadTexture("sponge3.png");
     firewalkAnimation    = new Texture2D[4];
     firewalkAnimation[0] = ContentPipe.LoadTexture("firesponge.png");
     firewalkAnimation[1] = ContentPipe.LoadTexture("firesponge1.png");
     firewalkAnimation[2] = ContentPipe.LoadTexture("firesponge2.png");
     firewalkAnimation[3] = ContentPipe.LoadTexture("firesponge3.png");
     this.spriteJump      = ContentPipe.LoadTexture("spongeJump.png");
     this.spriteFall      = ContentPipe.LoadTexture("spongeFall.png");
     this.firespriteJump  = ContentPipe.LoadTexture("firespongeJump.png");
     this.firespriteFall  = ContentPipe.LoadTexture("firespongeFall.png");
     this.firespriteShoot = ContentPipe.LoadTexture("firespongeshoot.png");
     this.dead            = ContentPipe.LoadTexture("spongeDead.png");
     this.spriteClimb     = ContentPipe.LoadTexture("spongeClimb.png");
     this.firespriteClimb = ContentPipe.LoadTexture("firespongeClimb.png");
     sprite = walkAnimation[index];
 }
コード例 #2
0
ファイル: Snail.cs プロジェクト: Gewf/SpongeGame
 public static void Load()
 {
     walkAnimation    = new Texture2D[2];
     walkAnimation[0] = ContentPipe.LoadTexture("snailWalk1.png");
     walkAnimation[1] = ContentPipe.LoadTexture("snailWalk2.png");
     shells           = ContentPipe.LoadTexture("snailShell.png");
 }
コード例 #3
0
ファイル: GrassBlock.cs プロジェクト: Gewf/SpongeGame
 public static void Load()
 {
     walkAnimation    = new Texture2D[2];
     walkAnimation[0] = ContentPipe.LoadTexture("grassBlock.png");
     walkAnimation[1] = ContentPipe.LoadTexture("grassBlock_jump.png");
     dead             = ContentPipe.LoadTexture("grassBlock_dead.png");
 }
コード例 #4
0
ファイル: Slime.cs プロジェクト: Gewf/SpongeGame
 public static void Load()
 {
     walkAnimation    = new Texture2D[2];
     walkAnimation[0] = ContentPipe.LoadTexture("slimeGreen.png");
     walkAnimation[1] = ContentPipe.LoadTexture("slimeGreen_walk.png");
     dead             = ContentPipe.LoadTexture("slimeGreen_squashed.png");
 }
コード例 #5
0
ファイル: View.cs プロジェクト: Gewf/SpongeGame
 public View(Vector2 startPosition, float startZoom = 1f, double rotation = 0.0)
 {
     this.position     = startPosition;
     this.positionGoto = startPosition;
     this.positionFrom = startPosition;
     this.zoom         = startZoom;
     this.rotation     = rotation;
     this.head         = ContentPipe.LoadTexture("livemeter.png");
     this.coin         = ContentPipe.LoadTexture("hudcoin.png");
     //DialogBox.LoadString("Hello world");
 }
コード例 #6
0
ファイル: ObjectHandler.cs プロジェクト: Gewf/SpongeGame
 public static void Load()
 {
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("coinGold.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("fireball.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("fireflower.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("coinGold.png"))); //Load it twice to avoid adding more code - Lazyness at its finest! :)
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("door.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("logo.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("cursor.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("play.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("options.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("spongesad.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("thebones.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("mysterious_man.png")));
     definedSprites.Add(new Sprite(ContentPipe.LoadTexture("shadow.png")));
 }
コード例 #7
0
        //Load - is called once per game execution. Load textures and stuff here.
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            //Load certain classes
            DialogBox.Load();
            //Load enemies
            Slime.Load();
            Snail.Load();
            GrassBlock.Load();
            Ghost.Load();
            EventGhost.Load();
            Piranha.Load();
            //Load the texture
            tileSet = ContentPipe.LoadTexture("TileSet1.png");
            level   = new Level("Content/Levels/Menu.xml");

            music.PlayLooping();
            player     = new Player(new Vector2(level.playerStartPos.X + 0.5f, level.playerStartPos.Y + 0.5f) * GRIDSIZE, new Vector2(0, 0.8f)); //Player object
            view.width = level[0, 0].posX + Width / 2 + 35;
            #region Create dot texture
            {
                int id = GL.GenTexture();
                GL.BindTexture(TextureTarget.Texture2D, id);

                Bitmap bmp = new Bitmap(1, 1);
                bmp.SetPixel(0, 0, Color.White);
                BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, 1, 1), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

                GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba,
                              1, 1, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra,
                              PixelType.UnsignedByte, bmpData.Scan0);

                dot = new Texture2D(id, 1, 1);

                bmp.UnlockBits(bmpData);

                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMinFilter.Linear);
            }
            #endregion
        }
コード例 #8
0
ファイル: Ghost.cs プロジェクト: Gewf/SpongeGame
 public static void Load()
 {
     chase = ContentPipe.LoadTexture("ghost.png");
     stand = ContentPipe.LoadTexture("ghost_normal.png");
 }
コード例 #9
0
 public static void Load()
 {
     charset = ContentPipe.LoadTexture("charset.png");
 }
コード例 #10
0
 public static void Load()
 {
     p_down = ContentPipe.LoadTexture("piranha_down.png");
     p_up   = ContentPipe.LoadTexture("piranha.png");
     p_dead = ContentPipe.LoadTexture("piranha_dead.png");
 }
コード例 #11
0
 public static void Load()
 {
     chill  = ContentPipe.LoadTexture("ghost_normal.png");
     savage = ContentPipe.LoadTexture("ghost.png");
 }