public static GameObject Find(GameObjectName goName, int index = 0) { GameObjectManager goMan = GameObjectManager.GetInstance(); GameObjectNode pRoot = (GameObjectNode)goMan.pActive; GameObject pGameObj = null; bool found = false; while (pRoot != null && found == false) { PCSTreeForwardIterator iter = new PCSTreeForwardIterator(pRoot.pGameObject); pGameObj = (GameObject)iter.First(); while (!iter.IsDone()) { if ((pGameObj.gameObjectName == goName) && (pGameObj.index == index)) { found = true; break; } pGameObj = (GameObject)iter.Next(); } pRoot = (GameObjectNode)pRoot.pDNext; } return(pGameObj); }
public ShieldBrick(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, ShieldType.Brick, idx) { this.x = x; this.y = y; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.White).pAzulColor; }
public WallTop(GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, float x, float y, float width, float height, Wall.WallType walltype) : base(mGameObjectName, index, mSpriteName, walltype) { this.setCollisionRect(x, y, width, height); this.x = x; this.y = y; this.cCollisionObj.cSpriteBox.setColor(Unit.redColor); }
public static void UpdateScore(GameObject go) { ScoreManager scoreMan = ScoreManager.GetInstance(); CurrentPlayer player = GetCurrentPlayer(); GameObjectName goName = go.gameObjectName; int scoreValue = 0; switch (goName) { case GameObjectName.Crab: scoreValue = 20; break; case GameObjectName.Squid: scoreValue = 30; break; case GameObjectName.Octopus: scoreValue = 10; break; case GameObjectName.UFO: scoreValue = GenerateUFOScore(); break; default: Debug.Assert(false); break; } UpdateCurrentPlayerScore(scoreValue); }
public MissileRoot(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, MissileType.MissileRoot, idx) { this.x = x; this.y = y; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Red).pAzulColor; }
public WallRight(GameObjectName goName, SpriteBaseName sName, float x, float y, float w, float h, int idx) : base(goName, sName, WallType.Right, idx) { this.pCollisionObject.pCollisionRect.Set(x, y, w, h); this.x = x; this.y = y; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Yellow).pAzulColor; }
public void wash() { this.cGameObjectName = GameObject.GameObjectName.Uninitialized; this.x = 0.0f; this.y = 0.0f; //dunno what to do this.index = 0; }
public Column(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx, Random pRandom) : base(goName, sName, AlienType.Column, idx) { this.x = x; this.y = y; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Green).pAzulColor; this.alienCount = 0; }
public Missile(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, MissileType.Missile, idx) { this.x = x; this.y = y; this.enabled = false; this.speed = 10.0f; }
public UFO(GameObjectName goName, SpriteBaseName sName, UFOStrategy strat, float x, float y) : base(goName, sName, UFOType.UFO, 0) { this.x = x; this.y = y; this.speed = 4.0f; this.pStrategy = strat; this.pProxySprite.pSprite.pColor = ColorFactory.Create(ColorName.Red).pAzulColor; }
public Splat(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, AlienType.Splat, idx) { this.x = x; this.y = y; this.pProxySprite.x = x; this.pProxySprite.y = y; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Black).pAzulColor; }
public Explosion(GameObjectName goName, SpriteBaseName sName, AlienType alienType, GameObject go, ColorName color, int idx) : base(goName, sName, alienType, idx) { this.x = go.x; this.y = go.y; this.pProxySprite.x = x; this.pProxySprite.y = y; this.pProxySprite.pSprite.SetColor(ColorFactory.Create(color).pAzulColor); }
public Ship(GameObjectName goName, SpriteBaseName sName, float x, float y) : base(goName, sName, ShipType.Ship, 0) { this.x = x; this.y = y; this.state = null; this.speed = 5.0f; this.pProxySprite.pSprite.pColor = ColorFactory.Create(ColorName.Green).pAzulColor; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Blue).pAzulColor; }
public Bomb(GameObjectName goName, SpriteBaseName sName, FallStrategy strat, float x, float y, int idx) : base(goName, sName, BombType.Bomb, idx) { this.x = x; this.y = y; this.speed = 5.0f; Debug.Assert(strat != null); this.fallStrategy = strat; this.fallStrategy.Reset(this.y); this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Orange).pAzulColor; }
public BombRoot(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, BombType.BombRoot, idx) { this.x = x; this.y = y; SpriteBatch sb = new SpriteBatch(); SpriteBatchNode sbNode = new SpriteBatchNode(); sbNode.Set(SpriteManager.Find(SpriteBaseName.Null), sb); this.pProxySprite.SetSpriteBatchNode(sbNode); this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.White).pAzulColor; }
protected GameObject(GameObjectName goName, SpriteBaseName spriteName, int idx) { this.gameObjectName = goName; this.index = idx; this.markedForDeath = false; this.x = 0.0f; this.y = 0.0f; this.pProxySprite = ProxySpriteManager.Add(spriteName); Debug.Assert(this.pProxySprite != null); this.pCollisionObject = new CollisionObject(this.pProxySprite); Debug.Assert(this.pCollisionObject != null); }
protected GameObject(GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName) { this.cGameObjectName = mGameObjectName; this.x = 0.0f; this.y = 0.0f; this.index = index; this.cProxySprite = ProxySpriteManager.add(mSpriteName); Debug.Assert(cProxySprite != null); this.cCollisionObj = new CollisionObject(cProxySprite); Debug.Assert(cCollisionObj != null); this.death = false; }
public Grid(GameObjectName goName, SpriteBaseName sbName, float x, float y, int goIdx) : base(goName, sbName, AlienType.Grid, goIdx) { this.x = x; this.y = y; this.movementXDirection = 20.0f; this.movementYDirection = 0.0f; this.movementXDistance = 20.0f; this.movementYDistance = 5.0f; this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Yellow).pAzulColor; this.alienCount = 0; this.colCount = 0; this.marchSpeed = 0.75f; this.bombFrequency = 1.0f; this.decayFactor = 0.0125f; this.bombDecayFactor = 0.01f; this.pRandom = new Random(); }
public Alien Create(GameObjectName goName, float x, float y) { Alien pAlien = null; switch (goName) { case GameObjectName.Ship: pAlien = new Ship(goName, SpriteBaseName.Ship, x, y); break; case GameObjectName.Missile: pAlien = new Missile(x, y); break; } Debug.Assert(pAlien != null); //this.pTree.dumpTree(); this.pTree.Insert(pAlien, this.pParent); //this.pTree.dumpTree(); pAlien.ActivateGameSprite(this.pSpriteBatch); this.pSpriteBoxBatch.Attach(pAlien.pCollisionObject.pCollisionSpriteBox); return(pAlien); }
public Alien Create(AlienType alienType, GameObjectName goName, int goIdx = 0, float x = 0.0f, float y = 0.0f) { Alien pAlien = null; switch (alienType) { case AlienType.Crab: pAlien = new Crab(goName, SpriteBaseName.Crab, x, y, goIdx); break; case AlienType.Squid: pAlien = new Squid(goName, SpriteBaseName.Squid, x, y, goIdx); break; case AlienType.Octopus: pAlien = new Octopus(goName, SpriteBaseName.Octopus, x, y, goIdx); break; case AlienType.Grid: pAlien = new Grid(goName, SpriteBaseName.Null, x, y, goIdx); GameObjectManager.AttachTree(pAlien); break; case AlienType.Column: pAlien = new Column(goName, SpriteBaseName.Null, x, y, goIdx, this.pRandom); break; default: Debug.Assert(pAlien != null); break; } this.pTree.Insert(pAlien, this.pParent); pAlien.ActivateGameSprite(this.pSpriteBatch); pAlien.ActivateCollisionSprite(this.pSpriteBatch); return(pAlien); }
public ShieldGrid(GameObjectName goName, SpriteBaseName sName, float x, float y, int idx) : base(goName, sName, ShieldType.Grid, idx) { this.x = x; this.y = y; }
public Wall(GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, Wall.WallType walltype) : base(mGameObjectName, index, mSpriteName) { type = walltype; }
public RemoveExplosionObserver(GameObject go) { this.pGameObject = go; this.goName = go.gameObjectName; }
public Alien(GameObjectName goName, SpriteBaseName spriteName, AlienType alienType, float x, float y) : base(goName, GameObjectType.Alien, spriteName, x, y) { this.alienType = alienType; }
public Alien(GameObjectName goName, SpriteBaseName spriteName, AlienType alienType, int idx) : base(goName, spriteName, idx) { this.alienType = alienType; }
protected ShieldCategory(GameObjectName goName, SpriteBaseName sName, ShieldType type, int idx) : base(goName, sName, idx) { this.type = type; }
public Octopus(GameObjectName goName, SpriteBaseName spriteName, float x, float y, int idx) : base(goName, spriteName, AlienType.Octopus, idx) { this.x = x; this.y = y; }
public WallRoot(GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, Wall.WallType walltype) : base(mGameObjectName, index, mSpriteName, walltype) { // this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor); }
protected Wall(GameObjectName goName, SpriteBaseName spriteName, WallType wallType, int idx) : base(goName, spriteName, idx) { this.type = wallType; }
public GameObjectNode(GameObjectName goName, int index) { this.pGameObject = new NullGameObject(); this.pGameObject.gameObjectName = goName; this.pGameObject.index = index; }