コード例 #1
0
ファイル: GameSprite.cs プロジェクト: Smybarr/space_invaders
        // Constructors/Destructors: -------------------------------------------
        public GameSprite()
        {
            //SPRITE COLOR!
            //set the default color to white
            this.poColor = new Azul.Color(defaultSpriteColor_White);
            Debug.Assert(this.poColor != null);

            //default field values
            this.name = Name.Blank;

            //create a NullObject image by default to avoid breaking find;
            this.pImage = ImageManager.Find(Image.Name.NullObject);
            Debug.Assert(this.pImage != null);

            Debug.Assert(pPrivScreenRect != null);
            Debug.Assert(defaultSpriteColor_White != null);

            this.poScreenRect = new Azul.Rect(pPrivScreenRect);
            Debug.Assert(poScreenRect != null);

            this.poAzulSprite = new Azul.Sprite(pImage.GetAzulTexture(), pImage.GetAzulRect(), pPrivScreenRect, this.poColor);
            Debug.Assert(this.poAzulSprite != null);

            this.x     = poAzulSprite.x;
            this.y     = poAzulSprite.y;
            this.sx    = poAzulSprite.sx;
            this.sy    = poAzulSprite.sy;
            this.angle = poAzulSprite.angle;
        }
コード例 #2
0
        //static Azul.Rect poRect = new Azul.Rect();


        public GameSprite()
            : base()
        {
            this.name = GameSprite.Name.Unitialized;

            //use the default for now and replace later in the Set
            this.pImage = ImageMan.Find(Image.Name.Default);
            Debug.Assert(this.pImage != null);

            this.poScreenRect = new Azul.Rect();
            Debug.Assert(this.pImage != null);

            //make sure nothing is there already?
            this.poScreenRect.Clear();

            Debug.Assert(GameSprite.psTempColor != null);
            GameSprite.psTempColor.Set(1, 1, 1);

            this.poAzulSprite = new Azul.Sprite(pImage.GetAzulTexture(), pImage.GetAzulRect(), this.poScreenRect, psTempColor);
            Debug.Assert(this.poAzulSprite != null);

            this.poAzulColor = new Azul.Color(1, 1, 1);
            Debug.Assert(this.poAzulColor != null);

            this.x     = poAzulSprite.x;
            this.y     = poAzulSprite.y;
            this.sx    = poAzulSprite.sx;
            this.sy    = poAzulSprite.sy;
            this.angle = poAzulSprite.angle;
        }
コード例 #3
0
ファイル: Sprite.cs プロジェクト: xNeophyte/Space_Invaders
        public Sprite()
        {
            this.name = Sprite.Name.Uninitialized;

            this.pImage = ImageManager.Find(Image.Name.Uninitialized);
            Debug.Assert(this.pImage != null);

            this.poScreenRect = new Azul.Rect();
            Debug.Assert(this.poScreenRect != null);
            this.poScreenRect.Clear();

            this.poColor = new Azul.Color(1, 1, 1);
            Debug.Assert(this.poColor != null);

            this.poSprite = new Azul.Sprite(pImage.GetAzulTexture(), pImage.GetAzulRect(), poScreenRect, poColor);
            Debug.Assert(this.poSprite != null);

            this.x     = poSprite.x;
            this.y     = poSprite.y;
            this.sx    = poSprite.sx;
            this.sy    = poSprite.sy;
            this.angle = poSprite.angle;

            this.speedX = 0;
            this.speedY = 0;
        }
コード例 #4
0
        //---------------------------------------------------------------------------------------------------------
        // Constructor
        //---------------------------------------------------------------------------------------------------------
        public GameSprite()
            : base()
        {
            this.name = GameSprite.Name.Uninitialized;

            // Use the default - it will be replaced in the Set
            this.pImage = ImageManager.Find(Image.Name.Default);
            Debug.Assert(this.pImage != null);

            this.poScreenRect = new Azul.Rect();
            Debug.Assert(this.poScreenRect != null);
            this.poScreenRect.Clear();

            // here is the actual new
            this.poAzulColor = new Azul.Color(1, 1, 1);
            Debug.Assert(this.poAzulColor != null);

            // here is the actual new
            this.poAzulSprite = new Azul.Sprite(pImage.GetAzulTexture(), pImage.GetAzulRect(), this.poScreenRect, psTmpColor);
            Debug.Assert(this.poAzulSprite != null);

            this.x     = poAzulSprite.x;
            this.y     = poAzulSprite.y;
            this.sx    = poAzulSprite.sx;
            this.sy    = poAzulSprite.sy;
            this.angle = poAzulSprite.angle;
        }
コード例 #5
0
        public override void Execute(float deltaTime)
        {
            GhostManager       pGhostManager       = GameStateManager.GetGame().GetStateGhostManager();
            GameObjectManager  pGameObjectManager  = GameStateManager.GetGame().GetStateGameObjectManager();
            SpriteBatchManager pSpriteBatchManager = GameStateManager.GetGame().GetStateSpriteBatchManager();


            Composite  pCoreCannonGroup = GameStateManager.GetGame().GetStateCompositeManager().Find(Composite.CompositeName.CoreCannonGroup);
            GameObject pGameObj         = pGhostManager.Find(GameObject.Name.CoreCannon);

            // Remove game object from ghost manager
            pGhostManager.Detach(pGameObj);

            // Reset position
            pGameObj.SetX(200);
            pGameObj.SetY(100);

            // Reset Collision Object
            Azul.Rect       pSpriteProxyScreenRect = pGameObj.GetSpriteProxy().GetSpriteScreenRect();
            CollisionObject pCollisionObject       = pGameObj.GetCollisionObject();

            pCollisionObject.GetCollisionRect().Set(pSpriteProxyScreenRect);
            pCollisionObject.GetCollisionSpriteBox().Set(SpriteBox.Name.Box, 200, 100, pSpriteProxyScreenRect.width, pSpriteProxyScreenRect.height);

            // Add to GameObjectManager
            Debug.Assert(pGameObj != null);
            pGameObjectManager.Attach(pGameObj);

            // Add to Composite
            pCoreCannonGroup.Add(pGameObj);

            // Attach to SpriteBatch
            pGameObj.ActivateSprite(pSpriteBatchManager.Find(SpriteBatch.Name.CoreCannon));
            pGameObj.ActivateCollisionSprite(pSpriteBatchManager.Find(SpriteBatch.Name.CollisionBox));
        }
コード例 #6
0
ファイル: BoxSprite.cs プロジェクト: Smybarr/space_invaders
        public void Set(GameSprite.Name boxName, Azul.Rect pScreenRect)
        {
            //null checks
            Debug.Assert(pScreenRect != null);
            Debug.Assert(defaultBoxColor_Red != null);
            Debug.Assert(this.poAzulSpriteBox != null);
            Debug.Assert(this.poScreenRect != null);

            //set the name
            this.name = boxName;

            Debug.Assert(pPrivScreenRect != null);

            //set either a default color or a color input;
            //if (pColor == null)
            //{
            //    //set to static red (default)
            //    this.poLineColor.Set(defaultBoxColor_Red);
            //}
            //else
            //{
            //    this.poLineColor.Set(pColor);
            //}

            this.poAzulSpriteBox.Swap(pScreenRect, this.poLineColor);
            Debug.Assert(this.poAzulSpriteBox != null);

            this.x     = poAzulSpriteBox.x;
            this.y     = poAzulSpriteBox.y;
            this.sx    = poAzulSpriteBox.sx;
            this.sy    = poAzulSpriteBox.sy;
            this.angle = poAzulSpriteBox.angle;
        }
コード例 #7
0
        public Mine(Azul.Rect destRect, int owner, Azul.Color color)
            : base(GAMEOBJECT_TYPE.MINE, new Azul.Rect(0, 0, 12, 12), destRect, GameObject.mineTexture, color)
        {
            PhysicBody_Data data = new PhysicBody_Data();

            data.position = new Vec2(destRect.x, destRect.y);
            data.size     = new Vec2(destRect.width, destRect.height);
            //data.radius = 25f;
            data.isSensor   = true;
            data.angle      = 0;
            data.shape_type = PHYSICBODY_SHAPE_TYPE.DYNAMIC_BOX;

            ownerID = owner;

            lifeTime = 5.0f;

            armDelay = 2.0f;

            mine1 = pSprite;
            mine2 = new Azul.Sprite(GameObject.mineTexture2, new Azul.Rect(0, 0, 12, 12), destRect, new Azul.Color(1, 0, 0));

            drawMine2 = false;

            CreatePhysicBody(data);
            lifeTimer = new Stopwatch();

            animTimer = new Stopwatch();
            animTimer.Start();
            armedTimer = new Stopwatch();
            armedTimer.Start();


            state = MINE_STATE.LAYED;
        }
コード例 #8
0
 public Glyph() : base()
 {
     this.glyphName = Name.Uninitialized;
     this.glyphTex  = null;
     this.glyphRect = new Azul.Rect();
     this.key       = 0;
 }
コード例 #9
0
ファイル: BoxSprite.cs プロジェクト: Smybarr/space_invaders
        public BoxSprite()
        {
            //set the name;
            this.name = GameSprite.Name.Blank;

            Debug.Assert(pPrivScreenRect != null);
            Debug.Assert(defaultBoxColor_Red != null);

            //initialize default line color of all sprite box objects
            this.poLineColor = new Azul.Color(defaultBoxColor_Red);

            Debug.Assert(this.poLineColor != null);

            //initialize screen coordinates
            this.poScreenRect = new Azul.Rect(pPrivScreenRect);
            Debug.Assert(this.poScreenRect != null);

            //initialize azul sprite box
            this.poAzulSpriteBox = new Azul.SpriteBox(pPrivScreenRect, this.poLineColor);
            Debug.Assert(this.poAzulSpriteBox != null);

            //pull the coordinates
            this.x     = poAzulSpriteBox.x;
            this.y     = poAzulSpriteBox.y;
            this.sx    = poAzulSpriteBox.sx;
            this.sy    = poAzulSpriteBox.sy;
            this.angle = poAzulSpriteBox.angle;
        }
コード例 #10
0
ファイル: Ship.cs プロジェクト: Danielg686/DataDriven
        public Ship(Azul.Rect screenRect, Azul.Color color)
            : base(GAMEOBJECT_TYPE.SHIP, new Azul.Rect(0, 0, 32, 32), screenRect, GameObject.shipTexture, color)
        {
            PhysicBody_Data data = new PhysicBody_Data();

            data.position   = new Vec2(screenRect.x, screenRect.y);
            data.size       = new Vec2(screenRect.width, screenRect.height);
            data.active     = true;
            data.angle      = 0;
            data.shape_type = PHYSICBODY_SHAPE_TYPE.SHIP_MANIFOLD;
            //data.isSensor = true;
            CreatePhysicBody(data);

            // maxSpeed is m/s
            maxSpeed = 150.0f;

            maxForce    = 20f;
            rotateSpeed = 5.0f;
            heading     = new Vec2((float)System.Math.Cos(pBody.GetAngleDegs()), (float)System.Math.Sin(pBody.GetAngleDegs()));

            mineCount    = 5;
            missileCount = 3;
            shipColor    = color;

            respawnPos = new Vec2(screenRect.x, screenRect.y);
        }
コード例 #11
0
        public static Azul.Rect[] GetRects(CharacterEnum typeIn)
        {
            Azul.Rect[] arrayOut = new Azul.Rect[2];
            switch (typeIn)
            {
            case CharacterEnum.octopus:
                arrayOut[0] = GetRect(RectType.Octopus1);
                arrayOut[1] = GetRect(RectType.Octopus2);
                break;

            case CharacterEnum.crab:
                arrayOut[0] = GetRect(RectType.Crab1);
                arrayOut[1] = GetRect(RectType.Crab2);
                break;

            case CharacterEnum.squid:
                arrayOut[0] = GetRect(RectType.Squid1);
                arrayOut[1] = GetRect(RectType.Squid2);
                break;

            case CharacterEnum.corecannon:
                arrayOut[0] = GetRect(RectType.CoreCannon1);
                break;

            case CharacterEnum.missle:
                arrayOut = GetCCMissles();
                break;

            default:
                break;
            }
            return(arrayOut);
        }
コード例 #12
0
        public Ship(Azul.Rect screenRect, Azul.Color color)
            : base(GAMEOBJECT_TYPE.SHIP, new Azul.Rect(0, 0, 32, 32), screenRect, GameObject.shipTexture, color)
        {
            //PhysicBody_Data data = new PhysicBody_Data();

            //data.position = new Vec2(screenRect.x, screenRect.y);
            //data.size = new Vec2(screenRect.width, screenRect.height);

            //data.angle = 0;
            //data.shape_type = PHYSICBODY_SHAPE_TYPE.SHIP_MANIFOLD;
            //CreatePhysicBody(data);

            //maxSpeed is pixels / sec
            maxSpeed = 150.0f;

            maxForce    = 20f;
            rotateSpeed = 5.0f;
            // heading = new Vec2((float)System.Math.Cos(pBody.GetAngleDegs()), (float)System.Math.Sin(pBody.GetAngleDegs()));
            prevPos = new Vec2(screenRect.x, screenRect.y);
            curPos  = prevPos;


            //prevTime = GetTime();
            //curTime = prevTime;

            curVelocity = new Vec2(0.0f, 0.0f);


            missileCount = 3;
            shipColor    = color;

            respawnPos = new Vec2(screenRect.x, screenRect.y);
        }
コード例 #13
0
ファイル: Glyph.cs プロジェクト: mrfleming/Space-Invaders
 //----------------------------------------------------------------------------------
 // Constructor
 //----------------------------------------------------------------------------------
 public Glyph() : base()
 {
     this.name     = Glyph.Name.Uninitialized;
     this.pTexture = null;
     this.pSubRect = new Azul.Rect();
     this.key      = 0;
 }
コード例 #14
0
        public GameSprite() : base()
        {
            // resets to default parameters
            this.Wash();

            // Use Default Values
            this.pImage = ImageManager.Find(Image.Name.Default);
            Debug.Assert(pImage != null);

            // Prep Rect
            this.poScreenRect = new Azul.Rect();
            Debug.Assert(this.poScreenRect != null);
            this.poScreenRect.Clear();

            // Prep Color
            this.poAzulColor = new Azul.Color(1, 1, 1);
            Debug.Assert(this.poAzulColor != null);

            // Prep Sprite
            this.poAzulSprite = new Azul.Sprite(pImage.GetAzulTexture(), pImage.GetAzulRect(), this.poScreenRect, this.poAzulColor);
            Debug.Assert(this.poAzulSprite != null);

            //grab data from the Azul Sprite
            this.x     = poAzulSprite.x;
            this.y     = poAzulSprite.y;
            this.sx    = poAzulSprite.sx;
            this.sy    = poAzulSprite.sy;
            this.angle = poAzulSprite.angle;
        }
コード例 #15
0
 //private Name colName;
 public CollisionSprite()
     : base()
 {
     lineWidth = 1.0f;
     line = null;
     rect = null;
 }
コード例 #16
0
ファイル: Image.cs プロジェクト: xNeophyte/Space_Invaders
 public Image()
 {
     this.name        = Name.Uninitialized;
     this.pTexture    = null;
     this.poImageRect = new Azul.Rect();
     Debug.Assert(poImageRect != null);
 }
コード例 #17
0
        public override void Execute(float deltaTime)
        {
            // TODO add parameters for border edges [Left, Right, Top, Bottom] for when to reset movement
            // TODO Probably need to create sub-commands for different types of movement?

            spriteProxyRect      = this.pGameObject.GetSpriteProxy().GetSpriteScreenRect();
            spriteProxyHalfWidth = spriteProxyRect.width / 2.0f;

            // + ( (deltaX > 0.0f) ? spriteProxyHalfWidth : (-1.0f * spriteProxyHalfWidth))
            this.currX = this.pGameObject.GetX() + this.deltaX;
            this.currY = this.pGameObject.GetY() + this.deltaY;

            // If past window edge, change directions
            if ((this.currX + spriteProxyHalfWidth) > 896.0f)
            {
                deltaX = (-1.0f * deltaX);
                currX  = 896.0f - spriteProxyHalfWidth;
            }
            else if ((this.currX + -(spriteProxyHalfWidth)) < 0.0f)
            {
                deltaX = (-1.0f * deltaX);
                currX  = 0.0f + spriteProxyHalfWidth;
            }

            // Update X, Y in Sprite
            this.pGameObject.SetX(this.currX);
            this.pGameObject.SetY(this.currY);

            // Add itself back to timer
            TimerManager.Add(TimeEvent.Name.SpriteMovement, this, deltaTime);
        }
コード例 #18
0
        //
        // Constructor
        //

        public Collider()
        {
            this.collisionSprite  = null;
            this.colliderBoundary = new Azul.Rect();
            this.gameObjectId     = 0u;
            this.color            = Colors.Green;
        }
コード例 #19
0
ファイル: Image.cs プロジェクト: beelandc/SpaceInvaders
        //---------------------------------------------------------------------------------------------------------
        // Constructor
        //---------------------------------------------------------------------------------------------------------

        public Image()
            : base()
        {
            this.pTextureRect = new Azul.Rect();
            Debug.Assert(this.pTextureRect != null);

            this.Clean();
        }
コード例 #20
0
ファイル: Image.cs プロジェクト: frobro98/School-Projects
 public Image()
     : base()
 {
     tex = null;
     texCoords = null;
     index = Index.Index_Null;
     name = ImageEnum.Not_Initialized;
 }
コード例 #21
0
 //EDIT THE FOLLOWING METHODS---------------------
 public Glyph()
     : base()
 {
     this.name     = Name.Blank;
     this.pTexture = null;
     this.pSubRect = new Azul.Rect();
     this.key      = 0;
 }
コード例 #22
0
ファイル: Font.cs プロジェクト: ccaunca/Projects
 public Font()
     : base()
 {
     this.name      = FontName.Uninitialized;
     this.pTexture  = null;
     this.pAzulRect = new Azul.Rect();
     this.key       = 0;
 }
コード例 #23
0
        public Image()
            : base()
        {
            this.poRect = new Azul.Rect();
            Debug.Assert(this.poRect != null);

            this.Clear();
        }
コード例 #24
0
        public static Image Add(Image.Name name, Texture.Name texture, Azul.Rect poRect)
        {
            Image   image    = (Image)instance.AddToFront();
            Texture pTexture = TextureMan.Find(texture);

            image.Initialize(name, pTexture, poRect);
            return(image);
        }
コード例 #25
0
 public Sprite()
     : base()
 {
     this.pAzulSprite = new Azul.Sprite();
     this.pScreenRect = new Azul.Rect();
     this.pColor      = new Azul.Color(1.0f, 1.0f, 1.0f);
     this.pImage      = new Image();
 }
コード例 #26
0
ファイル: SpriteBoxManager.cs プロジェクト: ccaunca/Projects
        public static SpriteBox Add(SpriteBaseName name, Azul.Rect azulRect)
        {
            SpriteBoxManager spriteBoxMan = SpriteBoxManager.GetInstance();
            SpriteBox        spriteBox    = (SpriteBox)spriteBoxMan.BaseAdd();

            spriteBox.Set(name, azulRect.x, azulRect.y, azulRect.width, azulRect.height);
            return(spriteBox);
        }
コード例 #27
0
ファイル: GameObject.cs プロジェクト: Danielg686/DataDriven
 public GameObject(GAMEOBJECT_TYPE _type, Azul.Rect textureRect, Azul.Rect screenRect, Azul.Texture text, Azul.Color c)
 {
     type        = _type;
     color       = c;
     pSprite     = new Azul.Sprite(text, textureRect, screenRect, color);
     pScreenRect = screenRect;
     id          = IDNUM++;
     alive       = true;
 }
コード例 #28
0
ファイル: Image.cs プロジェクト: mrfleming/Space-Invaders
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        public Image(Name myName, Texture pSrcTexture, Azul.Rect pSubRect)
        {
            Debug.Assert(pSrcTexture != null);
            Debug.Assert(pSubRect != null);

            this.name     = myName;
            this.pTexture = pSrcTexture;
            this.poRect   = new Azul.Rect(pSubRect);
        }
コード例 #29
0
ファイル: Image.cs プロジェクト: mrfleming/Space-Invaders
        public Image() : base()
        {
            // first calls the super class constructor.

            this.name     = Name.Uninitialized;
            this.pTexture = null;
            this.poRect   = new Azul.Rect();
            Debug.Assert(this.poRect != null);
        }
コード例 #30
0
 public void setDimension(Azul.Rect r)
 {
     this.poRect.x      = r.x;
     this.poRect.y      = r.y;
     this.poRect.width  = r.width;
     this.poRect.height = r.height;
     Azul.Rect tmpRect = new Azul.Rect(r.x, r.y, r.width, r.height);
     this.poAzulSpriteBox.SwapScreenRect(tmpRect);
 }
コード例 #31
0
        // parameterized constructor
        public Image(ImageName imageName, Texture imageTex, Azul.Rect imageRect)
        {
            Debug.Assert(imageTex != null);
            Debug.Assert(imageRect != null);

            this.setImageName(imageName);
            this.setImageRect(imageRect);
            this.setImageTexture(imageTex);
        }
コード例 #32
0
        void SpawnExplosionParticle(GameObject obj)
        {
            Vec2 pos = obj.GetPixelPosition();

            Azul.Rect         dest = new Azul.Rect(pos.X, pos.Y, 30, 30);
            AnimationParticle part = new AnimationParticle(new Azul.Rect(0, 0, 86, 70), dest, explosionText, new Azul.Color(1, 1, 1));

            GameManager.AddGameObject(part);
        }
コード例 #33
0
        public void set(SpriteEnum sName, Index index, Azul.Color color, float x, float y, float width, float height)
        {
            //Debug.Assert(color != null);

            this.setBase(sName, index, 0.0f, 0.0f);
            lineWidth = 1.0f;
            this.sprColor = color;
            rect = new Azul.Rect(x, y, width, height);
            line = new Azul.Line(this.lineWidth, this.sprColor, x, y, x + width, y + height);
        }
コード例 #34
0
        public ProxyCollisionSprite(Azul.Color color, SpriteEnum name, Index index)
            : base()
        {
            Debug.Assert(color != null);
            //Debug.Assert(name.Equals(SpriteEnum.Collision));
            //Debug.Assert(index.Equals(Index.Index_Null));

            setBase(name, index, 0.0f, 0.0f);
            colSprite = CollisionSpriteManager.find(SpriteEnum.Collision, Index.Index_Null);
            grid = new Azul.Rect();
            gridColor = color;
        }
コード例 #35
0
 public CollisionObject(SpriteEnum name, Index index, Azul.Color color)
 {
     if (!name.Equals(SpriteEnum.Null))
     {
         GameSprite spr = GameSpriteManager.find(name);
         this.colSpr = new ProxyCollisionSprite(color, name, index);
         this.colBounds = new Azul.Rect(spr.Rect.x, spr.Rect.y, spr.Rect.w, spr.Rect.h);
         this.colBounds.x -= colBounds.w / 2;
         this.colBounds.y += colBounds.h / 2;
     }
     else
     {
         this.colSpr = new ProxyCollisionSprite(color, name, index);
         this.colBounds = new Azul.Rect();
     }
 }
コード例 #36
0
        public void setRect(Azul.Rect newRect)
        {
            this.colBounds = newRect;

            //this.colBounds.x = newRect.x - newRect.w / 2;
            //this.colBounds.y = newRect.y + newRect.h / 2;
            //this.colBounds.w = newRect.w;
            //this.colBounds.h = newRect.h;
        }
コード例 #37
0
 public BottomWall(Name name, Index index)
     : base(name, SpriteEnum.Null, index, new Azul.Color(0f, 0f, 0f), new Azul.Color(0f, 0f, 1f), 0f, 15f)
 {
     wallRect = new Azul.Rect(0, 15, 1024.0f, 15.0f);
 }
コード例 #38
0
ファイル: RightWall.cs プロジェクト: frobro98/School-Projects
 public RightWall(Name name, Index index)
     : base(name, SpriteEnum.Null, index, new Azul.Color(0f, 0f, 0f), new Azul.Color(0.0f, 1.0f, 0.0f), 1024.0f, 896.0f)
 {
     this.index = index;
     wallRect = new Azul.Rect(1009.0f, 896.0f, 15.0f, 896.0f);
 }
コード例 #39
0
ファイル: TopWall.cs プロジェクト: frobro98/School-Projects
 public TopWall(Name name, Index index)
     : base(name, SpriteEnum.Null, index, new Azul.Color(0f, 0f, 0f), new Azul.Color(0.0f, 0.5f, 1.0f), 0.0f, 896.0f)
 {
     wallRect = new Azul.Rect(0.0f, 896.0f, 1024.0f, 15.0f);
 }
コード例 #40
0
 public void set(SpriteEnum sName, Index index, ImageEnum iName, float x, float y, float width, float height)
 {
     base.setBase(sName, index, x, y);
     this.img = ImageManager.find(iName);
     this.sprite = new Azul.Sprite2D(this.img.getTexture(), this.img.TexCoords, new Azul.Rect(x, y, width, height));
     this.sprRect = new Azul.Rect(x, y, width, height);
     angle = 0;
     scaleX = this.sprite.sx;
     scaleY = this.sprite.sy;
 }
コード例 #41
0
ファイル: Image.cs プロジェクト: frobro98/School-Projects
 public void setImage(ImageEnum iName, TexEnum tName, float x, float y, float width, float height)
 {
     name = iName;
     tex = TextureManager.find(tName);
     texCoords = new Azul.Rect(x, y, width, height);
 }
コード例 #42
0
ファイル: LeftWall.cs プロジェクト: frobro98/School-Projects
 public LeftWall(Name name, Index index)
     : base(name, SpriteEnum.Null, index, new Azul.Color(0f, 0f, 0f), new Azul.Color(0.0f, 1.0f, 0.0f), 0.0f, 896.0f)
 {
     this.wallRect = new Azul.Rect(0.0f, 896.0f, 15.0f, 896.0f);
 }