public Player(PlayerID _id) { lives = 4; id = _id; createLives(id); state = PlayerState.alive; emptySprite = (Sprite)DisplayManager.Instance().getDisplayObj(SpriteEnum.box); if (_id == PlayerID.one) { bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0, ImageManager.Instance().getImage(ImageEnum.bluebomb1), false); missileType = GameObjType.p1missiles; } else { bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0, ImageManager.Instance().getImage(ImageEnum.greenbomb1), false); missileType = GameObjType.p2missiles; } bombSpriteIndex = 5; numMissiles = 0; }
public void Set(GameObject _obj) { base.Initialize(); this.gameObj = _obj; this.type = _obj.type; }
public Player(PlayerID _id) { lives = 4; id = _id; createLives(id); state = PlayerState.alive; emptySprite = (Sprite)DisplayManager.Instance().getDisplayObj(SpriteEnum.box); if (_id == PlayerID.one) { bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0, ImageManager.Instance().getImage(ImageEnum.bluebomb1), false); missileType = GameObjType.p1missiles; } else { bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0, ImageManager.Instance().getImage(ImageEnum.greenbomb1), false); missileType = GameObjType.p2missiles; } bombSpriteIndex = 5; numMissiles = 3; }
public Ship(GameObjType _type, Sprite_Proxy _spriteRef) { type = _type; spriteRef = _spriteRef; waveBank = WaveBankManager.WaveBank(); soundBank = SoundBankManager.SoundBank(); }
public Wall(GameObjType _type, Sprite_Proxy _spriteRef) { type = _type; spriteRef = _spriteRef; anim = new Animation(spriteRef.sprite); setUpAnimation(); soundBank = SoundBankManager.SoundBank(); waveBank = WaveBankManager.WaveBank(); }
public void pushPhysics(float rot, Vector2 loc, GameObjType type) { GameObjType goType = type; LocationHdr hdr; hdr.goIndex = this.indexNum; hdr.position = loc; hdr.rotation = rot; hdr.networked = false; OutputQueue.pushHeader(ref hdr); //rotation = rot; //location = loc; }
public Bomb(GameObjType _type, PlayerID _owner, Ship s) { type = _type; createBomb(_owner, s); owner = _owner; soundBank = SoundBankManager.SoundBank(); waveBank = WaveBankManager.WaveBank(); playBombLaySound(); armBomb(); }
public Missile(GameObjType _type, Sprite_Proxy _spriteRef, PlayerID _owner) { type = _type; spriteRef = _spriteRef; objSpeed = new Vector2(0, -15); soundBank = SoundBankManager.SoundBank(); waveBank = WaveBankManager.WaveBank(); owner = _owner; playFireSound(); }
// --------------------------------------------------------------- IsInHazard bool IsInHazard(Ball ball, GameObjType hazard) { bool result = false; Array.ForEach(holeGeometry.Hazards, (Hazard h) => { var d = GetDistance(new Point(ball.X, ball.Y), new Point(h.X, h.Y)); if ((d < h.Radius) && h.Type == hazard) { result = true; } ; }); return(result); }
public GameObject find(GameObjType type) { ManLink mLink = this.active; while (mLink != null) { if (mLink.getName().Equals(type)) { break; } mLink = mLink.next; } if (mLink != null) return ((GameObjNode)mLink).gameObj; else return null; }
public FencePost(GameObjType _type, Sprite_Proxy _spriteRef) { type = _type; spriteRef = _spriteRef; }
/// <summary> /// Create a game object and add it to the object registry /// </summary> /// <param name="type">Type of object to be created</param> /// <param name="args">Args for object constructor. Refer to comments</param> public GameObject CreateGameObject(GameObjType type, params object[] args) { // Untyped resultant variable GameObject result = null; switch (type) { case GameObjType.pc: result = new Actor(ActorType.pc); // ActorType player character break; // Reserved case GameObjType.npc: result = new Actor(ActorType.npc); // ActorType bot character break; case GameObjType.bullet: result = new Bullet( (Vector2)args[0], // Vector2 source position (float)args[1] // float rotation ); Shoot = result as Bullet; // One bullet exists at a time break; case GameObjType.celestialObj: result = new CelestialObject( (CelesObjType)args[0], // CelesObjectType type of star (float)args[1], // float mass (float)args[2] // float size ); break; // Params: case GameObjType.orbital: result = new Orbital( (Vector2)args[0], // Vector2 position (float)args[1], // float rotation (float)args[2], // float angular velocity (ParticleBase)args[3], // ParticleBase base for type of orbital (int)args[4] // int Orbital rotation rate ); Orbs.Add(result as Orbital); break; case GameObjType.particle: result = new Particle( (Vector2)args[0], // Vector2 position (Vector2)args[1], // Vector2 velocity (float)args[2], // float rotation (float)args[3], // float angular velocity (int)args[4], // int time to live (ParticleBase)args[5] // ParticleBase base for type of particle ); break; case GameObjType.galaxy: // Params: nil result = new Galaxy(); break; } // Add to object registry CreationQueue.Add(result); return(result); }