public CPot() : base() { _hitBox = new Collision.CHitBox(this, 16, 32, 16, 16); swapImage("PotChillinLikeaVillain"); }
protected override void shoot() { startTimer0(60); _followRoot = false; CMasterControl.audioPlayer.addSfx(CMasterControl.audioPlayer.soundBank["Items:arrowShoot"]); switch (_direction) { case DIRECTION.DOWN: swapImage(PROJ_DOWN); _hitBox = new Collision.CHitBox(this, 15, 20, 5, 5); _velocity.Y = 4; break; case DIRECTION.RIGHT: swapImage(PROJ_RIGHT); _hitBox = new Collision.CHitBox(this, 24, 12, 5, 5); _velocity.X = 4; break; case DIRECTION.LEFT: swapImage(PROJ_LEFT); _hitBox = new Collision.CHitBox(this, 6, 12, 5, 5); _velocity.X = -4; break; case DIRECTION.UP: swapImage(PROJ_UP); _hitBox = new Collision.CHitBox(this, 15, 10, 5, 5); _velocity.Y = -4; break; } }
public COvergrownKeese() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(_SPRITE_NAMESPACE, "sprites/npc/overgownKeese"); Graphics.CTextures.addTexture(_IDLE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 52, 47, 1, "1:2", "1:2", 0)); Graphics.CTextures.addTexture(_IDLE_STARE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 52, 47, 1, "0:2", "0:2", 0)); Graphics.CTextures.addTexture(_FLY, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 52, 47, 1, "0:0", "3:1", 20)); Graphics.CTextures.addTexture(_KNOCKED_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 52, 47, 1, "2:2", "2:2", 0)); Graphics.CTextures.addTexture(_SWOOP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 52, 47, 1, "0:1", "0:1", 0)); } _imageIndex.Add(_MAP_ICON, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_IDLE, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_IDLE_STARE, new Graphics.CSprite(_IDLE_STARE)); _imageIndex.Add(_FLY, new Graphics.CSprite(_FLY)); _imageIndex.Add(_KNOCKED_DOWN, new Graphics.CSprite(_KNOCKED_DOWN)); _imageIndex.Add(_SWOOP, new Graphics.CSprite(_SWOOP)); _overgrownKeeseCount++; _hearingRadius = 150; _state = ACTOR_STATES.IDLE; _direction = DIRECTION.DOWN; _angle = 270; swapImage(_IDLE); _hitBox = new Collision.CHitBox(this, 19, 15, 15, 23); }
public override void update(Microsoft.Xna.Framework.GameTime gameTime) { base.update(gameTime); switch (_state) { case ACTOR_STATES.IDLE: Vector2 playerPos = new Vector2(Player.CPlayer.glblX, Player.CPlayer.glblY); if (isPointInHearingRange(playerPos)) { _state = ACTOR_STATES.POPUP; swapImage(_POPUP); _hitBox = new Collision.CHitBox(this, 0, 10, 15, 15); } break; case ACTOR_STATES.MOVING: moveInDirection(_velocity); break; case ACTOR_STATES.SHOOK_OFF: _shakeOff(); break; } }
public CArmoredCrab() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(SPRITE_NAMESPACE, @"sprites/npc/armoredCrabNew"); Graphics.CTextures.addTexture(_IDLE, new Graphics.CTextureAtlas(SPRITE_NAMESPACE, 32, 32, 0, "0:0", "0:0", 0)); Graphics.CTextures.addTexture(_WALK, new Graphics.CTextureAtlas(SPRITE_NAMESPACE, 32, 32, 0, "0:0", "3:0", 10)); Graphics.CTextures.addTexture(_IDLE_NOSHELL, new Graphics.CTextureAtlas(SPRITE_NAMESPACE, 32, 32, 0, "0:3", "0:3", 0)); Graphics.CTextures.addTexture(_WALK_NOSHELL, new Graphics.CTextureAtlas(SPRITE_NAMESPACE, 32, 32, 0, "0:3", "3:3", 10)); } _imageIndex.Add(_MAP_ICON, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_IDLE, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_WALK, new Graphics.CSprite(_WALK)); _imageIndex.Add(_IDLE_NOSHELL, new Graphics.CSprite(_IDLE_NOSHELL)); _imageIndex.Add(_WALK_NOSHELL, new Graphics.CSprite(_WALK_NOSHELL)); _armoredCrabCount++; _hearingRadius = 50; _lineOfSight = 120; _visionRange = 60; //always looks down _direction = DIRECTION.DOWN; _angle = 270; _chooseNewPoint(); swapImage(_WALK); _hitBox = new Collision.CHitBox(this, 7, 5, 20, 20); }
public CRump() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(_SPRITE_NAMESPACE, "sprites/npc/rump"); Graphics.CTextures.addTexture(_RUMP_IDLE_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:0", "0:0")); Graphics.CTextures.addTexture(_RUMP_GESTURE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "1:0", "6:0", 15)); Graphics.CTextures.addTexture(_RUMP_GESTURE_IDLE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "7:0", "7:0")); Graphics.CTextures.addTexture(_RUMP_THROW_FIREBALL_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:3", "10:3", 15)); Graphics.CTextures.addTexture(_RUMP_THROW_FIREBALL_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:1", "10:1", 15)); Graphics.CTextures.addTexture(_RUMP_THROW_FIREBALL_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:2", "10:2", 15)); } _imageIndex.Add(_RUMP_IDLE_DOWN, new Graphics.CSprite(_RUMP_IDLE_DOWN)); _imageIndex.Add(_RUMP_GESTURE_IDLE, new Graphics.CSprite(_RUMP_GESTURE_IDLE)); _imageIndex.Add(_RUMP_GESTURE, new Graphics.CSprite(_RUMP_GESTURE)); _imageIndex.Add(_RUMP_THROW_FIREBALL_UP, new Graphics.CSprite(_RUMP_THROW_FIREBALL_UP)); _imageIndex.Add(_RUMP_THROW_FIREBALL_DOWN, new Graphics.CSprite(_RUMP_THROW_FIREBALL_DOWN)); _imageIndex.Add(_RUMP_THROW_FIREBALL_LEFT, new Graphics.CSprite(_RUMP_THROW_FIREBALL_LEFT)); _imageIndex.Add(_RUMP_THROW_FIREBALL_RIGHT, new Graphics.CSprite(_RUMP_THROW_FIREBALL_LEFT, true)); _hitBox = new Collision.CHitBox(this, 10, 18, 12, 15); _followRoot = false; _hp = 2; }
public CBaseRope() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.rawTextures.Add(_SPRITE_NAMESPACE, CMasterControl.glblContent.Load <Texture2D>(@"sprites/npc/rope")); Graphics.CTextures.addTexture(_SLITHER_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:1", "3:1", 10)); Graphics.CTextures.addTexture(_SLITHER_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:2", "3:2", 10)); Graphics.CTextures.addTexture(_SLITHER_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:0", "3:0", 10)); Graphics.CTextures.addTexture(_FAST_SLITHER_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:1", "3:1", 30)); Graphics.CTextures.addTexture(_FAST_SLITHER_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:2", "3:2", 30)); Graphics.CTextures.addTexture(_FAST_SLITHER_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:0", "3:0", 30)); } _imageIndex.Add(_MAP_ICON, new Graphics.CSprite(_SLITHER_DOWN)); _imageIndex.Add(_SLITHER_DOWN, new Graphics.CSprite(_SLITHER_DOWN)); _imageIndex.Add(_SLITHER_UP, new Graphics.CSprite(_SLITHER_UP)); _imageIndex.Add(_SLITHER_LEFT, new Graphics.CSprite(_SLITHER_LEFT)); _imageIndex.Add(_SLITHER_RIGHT, new Graphics.CSprite(_SLITHER_LEFT, true)); _imageIndex.Add(_FAST_SLITHER_DOWN, new Graphics.CSprite(_FAST_SLITHER_DOWN)); _imageIndex.Add(_FAST_SLITHER_UP, new Graphics.CSprite(_FAST_SLITHER_UP)); _imageIndex.Add(_FAST_SLITHER_LEFT, new Graphics.CSprite(_FAST_SLITHER_LEFT)); _imageIndex.Add(_FAST_SLITHER_RIGHT, new Graphics.CSprite(_FAST_SLITHER_LEFT, true)); _ropeCount += 1; _hitBox = new Collision.CHitBox(this, 10, 10, 10, 15); _itemDrop.Add(new Items.Drops.CArrowDrop(), 100); _hp = 1; }
public CShockStick() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_PARENT_SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(_PARENT_SPRITE_NAMESPACE, "sprites/npc/bokoblin"); } if (_shockStickCount <= 0) { Graphics.CTextures.addTexture(_WALK_DOWN, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:0", "7:0", 20)); Graphics.CTextures.addTexture(_WALK_UP, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:4", "7:4", 20)); Graphics.CTextures.addTexture(_WALK_RIGHT, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:2", "7:2", 20)); Graphics.CTextures.addTexture(_IDLE_DOWN, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:0", "4:0", 0)); Graphics.CTextures.addTexture(_IDLE_UP, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:4", "4:4", 0)); Graphics.CTextures.addTexture(_IDLE_RIGHT, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:2", "4:2", 0)); Graphics.CTextures.addTexture(_ATTACK_DOWN, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:1", "6:1", 0)); Graphics.CTextures.addTexture(_ATTACK_UP, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:5", "6:5", 0)); Graphics.CTextures.addTexture(_ATTACK_RIGHT, new Graphics.CTextureAtlas(_PARENT_SPRITE_NAMESPACE, 41, 41, 1, "4:3", "6:3", 0)); } _imageIndex.Add(_WALK_DOWN, new Graphics.CSprite(_WALK_DOWN)); _imageIndex.Add(_WALK_UP, new Graphics.CSprite(_WALK_UP)); _imageIndex.Add(_WALK_RIGHT, new Graphics.CSprite(_WALK_RIGHT)); _imageIndex.Add(_WALK_LEFT, new Graphics.CSprite(_WALK_RIGHT, true)); _imageIndex.Add(_IDLE_DOWN, new Graphics.CSprite(_IDLE_DOWN)); _imageIndex.Add(_IDLE_UP, new Graphics.CSprite(_IDLE_UP)); _imageIndex.Add(_IDLE_RIGHT, new Graphics.CSprite(_IDLE_RIGHT)); _imageIndex.Add(_IDLE_LEFT, new Graphics.CSprite(_IDLE_RIGHT, true)); _imageIndex.Add(_ATTACK_DOWN, new Graphics.CSprite(_ATTACK_DOWN)); _imageIndex.Add(_ATTACK_UP, new Graphics.CSprite(_ATTACK_UP)); _imageIndex.Add(_ATTACK_RIGHT, new Graphics.CSprite(_ATTACK_RIGHT)); _imageIndex.Add(_ATTACK_LEFT, new Graphics.CSprite(_ATTACK_RIGHT, true)); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _IDLE_DOWN.Replace(_SPRITE_NAMESPACE, ""), _IDLE_DOWN); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _IDLE_UP.Replace(_SPRITE_NAMESPACE, ""), _IDLE_UP); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _IDLE_LEFT.Replace(_SPRITE_NAMESPACE, ""), _IDLE_LEFT); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _IDLE_RIGHT.Replace(_SPRITE_NAMESPACE, ""), _IDLE_RIGHT); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _WALK_DOWN.Replace(_SPRITE_NAMESPACE, ""), _WALK_DOWN); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _WALK_UP.Replace(_SPRITE_NAMESPACE, ""), _WALK_UP); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _WALK_LEFT.Replace(_SPRITE_NAMESPACE, ""), _WALK_LEFT); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _WALK_RIGHT.Replace(_SPRITE_NAMESPACE, ""), _WALK_RIGHT); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _ATTACK_DOWN.Replace(_SPRITE_NAMESPACE, ""), _ATTACK_DOWN); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _ATTACK_UP.Replace(_SPRITE_NAMESPACE, ""), _ATTACK_UP); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _ATTACK_LEFT.Replace(_SPRITE_NAMESPACE, ""), _ATTACK_LEFT); _spriteMap.Add(_PARENT_SPRITE_NAMESPACE + _ATTACK_RIGHT.Replace(_SPRITE_NAMESPACE, ""), _ATTACK_RIGHT); _sideBox = new Collision.CHitBox(this, 0, 0, 12, 7); _downBox = new Collision.CHitBox(this, 0, 0, 7, 12); _shockStickCount += 1; _state = ACTOR_STATES.IDLE; }
public CEditorNew() { _imageIndex.Add("iconNew", new Graphics.CSprite("editor:icons")); _position = new Vector2(5, 5); swapImage("iconNew", false); _hitBox = new Collision.CHitBox(this, 0, 0, 16, 16); }
public CEditorOpen() { _imageIndex.Add("iconOpen", new Graphics.CSprite("editor:icons:open")); _position = new Vector2(25, 4); swapImage("iconOpen", false); _hitBox = new Collision.CHitBox(this, 0, 0, 16, 16); }
public CEditorSave() { _imageIndex.Add("iconSave", new Graphics.CSprite("editor:icons:save", Graphics.CTextures.textures["editor:icons:save"])); _position = new Vector2(45, 4); swapImage("iconSave", false); _hitBox = new Collision.CHitBox(45, 4, 16, 16); }
public CEditorNew() { _imageIndex.Add("iconNew", new Graphics.CSprite("editor:icons", Graphics.CTextures.textures["editor:icons"])); _position = new Vector2(5, 5); swapImage("iconNew", false); _hitBox = new Collision.CHitBox(5, 5, 16, 16); }
public CArrowDrop() : base(false) { _followRoot = false; _hitBox = new Collision.CHitBox(this, 4, 3, 6, 10); _imageIndex.Add(Graphics.CTextures.DROPS_ARROW, new Graphics.CSprite(Graphics.CTextures.DROPS_ARROW)); swapImage(Graphics.CTextures.DROPS_ARROW); _hitBox = new Collision.CHitBox(this, 0, 0, 16, 16); }
public CLantern() : base() { _imageIndex.Add(_IDLE, new Graphics.CSprite("tileset:smallLantern")); swapImage(_IDLE); _velocity.Y = 1.0f; _state = ACTOR_STATES.IDLE; _hitBox = new Collision.CHitBox(this, 3, 3, 10, 10); }
public CWaterPuddle() : base() { _imageIndex.Add(Graphics.CTextures.PLAYER_PUDDLE, new Graphics.CSprite(Graphics.CTextures.PLAYER_PUDDLE)); _followRoot = true; _state = ACTOR_STATES.INVISIBLE; swapImage(Graphics.CTextures.PLAYER_PUDDLE); _hitBox = new Collision.CHitBox(this, 12, 25, 10, 10); startTimer0(30); }
public CIceBall(DIRECTION direction, Vector2 velocity, Vector2 position) : base(direction, velocity, position) { name = "iceBallSmall"; _imageIndex.Add(PROJ_DOWN, new Graphics.CSprite(Graphics.CTextures.EFFECT_ICE_BALL_SMALL)); _hitBox = new Collision.CHitBox(this, 6, 9, 14, 16); shoot(); startTimer0(60); }
public CTownsFolk() : base() { _SPRITE_NAMESPACE = "npc:townsfolk01"; _WALK_UP = _SPRITE_NAMESPACE + _WALK_UP; _WALK_DOWN = _SPRITE_NAMESPACE + _WALK_DOWN; _WALK_LEFT = _SPRITE_NAMESPACE + _WALK_LEFT; _WALK_RIGHT = _SPRITE_NAMESPACE + _WALK_RIGHT; _IDLE_UP = _SPRITE_NAMESPACE + _IDLE_UP; _IDLE_DOWN = _SPRITE_NAMESPACE + _IDLE_DOWN; _IDLE_LEFT = _SPRITE_NAMESPACE + _IDLE_LEFT; _IDLE_RIGHT = _SPRITE_NAMESPACE + _IDLE_RIGHT; if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.rawTextures.Add(_SPRITE_NAMESPACE, CMasterControl.glblContent.Load <Texture2D>(_SHEET01)); Graphics.CTextures.addTexture(_WALK_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:2", "2:2", 4)); Graphics.CTextures.addTexture(_WALK_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:0", "3:0", 4)); Graphics.CTextures.addTexture(_WALK_RIGHT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:1", "2:1", 4)); Graphics.CTextures.addTexture(_IDLE_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:2", "0:2", 0)); Graphics.CTextures.addTexture(_IDLE_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:0", "0:0", 0)); Graphics.CTextures.addTexture(_IDLE_RIGHT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 30, 36, 1, "0:1", "0:1", 0)); } _imageIndex.Add(_IDLE_DOWN, new Graphics.CSprite(_IDLE_DOWN)); _imageIndex.Add(_IDLE_UP, new Graphics.CSprite(_IDLE_UP)); _imageIndex.Add(_IDLE_LEFT, new Graphics.CSprite(_IDLE_RIGHT, true)); _imageIndex.Add(_IDLE_RIGHT, new Graphics.CSprite(_IDLE_RIGHT)); _imageIndex.Add(_WALK_DOWN, new Graphics.CSprite(_WALK_DOWN)); _imageIndex.Add(_WALK_UP, new Graphics.CSprite(_WALK_UP)); _imageIndex.Add(_WALK_LEFT, new Graphics.CSprite(_WALK_RIGHT, true)); _imageIndex.Add(_WALK_RIGHT, new Graphics.CSprite(_WALK_RIGHT)); _direction = DIRECTION.DOWN; _angle = 270; _backAngle = 90; _state = ACTOR_STATES.IDLE; swapImage(_WALK_DOWN); _lineOfSight = 50; _visionRange = 60; _hearingRadius = 30; _backLineOfSight = 20; _backVisionRange = 50; _hitBox = new Collision.CHitBox(this, 10, 20, 16, 16); startTimer1(120); }
private void _blowUp() { _state = ACTOR_STATES.EXPLODE; swapImage(_EXPLOSION, false); CMasterControl.audioPlayer.addSfx(CMasterControl.audioPlayer.soundBank["Items:explosionSmall"]); _position.X -= 13; _position.Y -= 13; _hitBox.destroy(); _hitBox = null; _hitBox = new Collision.CHitBox(this, 16, 20, 30, 30); _velocity = Vector2.Zero; }
public static readonly Vector2 carrySpot = new Vector2(-6, -10); //will need to be played with public CPlayer() : base() { _name = "Player"; _position = Vector2.Zero; //resource init _hitBox = new Collision.CHitBox(this, 10, 18, 12, 15); image = _imageIndex["PlayerWalkDown"]; _velocity = new Vector2(1, 1); }
public CShadowClone() { _imageIndex.Add(Graphics.CTextures.PLAYER_SHADOWUP, new Graphics.CSprite(Graphics.CTextures.PLAYER_SHADOWUP)); _imageIndex.Add(Graphics.CTextures.PLAYER_SHADOWDOWN, new Graphics.CSprite(Graphics.CTextures.PLAYER_SHADOWDOWN)); _imageIndex.Add(Graphics.CTextures.PLAYER_SHADOWLEFT, new Graphics.CSprite(Graphics.CTextures.PLAYER_SHADOWLEFT)); _imageIndex.Add(Graphics.CTextures.PLAYER_SHADOWRIGHT, new Graphics.CSprite(Graphics.CTextures.PLAYER_SHADOWLEFT, true)); _hitBox = new Collision.CHitBox(this, 10, 18, 12, 15); startTimer0(18000); _followRoot = false; _drawDepth = 7; }
public CWoodShield() : base() { _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_DOWN, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_DOWN)); _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_ENGAGE_DOWN, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_ENGAGE_DOWN)); _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_DISENGAGE_DOWN, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_DISENGAGE_DOWN)); _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_LEFT, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_LEFT)); _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_RIGHT, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_LEFT, true)); _imageIndex.Add(Graphics.CTextures.WOOD_SHIELD_UP, new Graphics.CSprite(Graphics.CTextures.WOOD_SHIELD_UP)); _downBox = new Collision.CHitBox(this, 0, 0, 16, 7); _sideBox = new Collision.CHitBox(this, 0, 0, 4, 16); }
public CBernice() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(_SPRITE_NAMESPACE, "sprites/npc/friendly/friendlyNPCs"); } Graphics.CTextures.addTexture(_BERNICE_IDLE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:2", "8:2", 15)); _imageIndex.Add(_BERNICE_IDLE, new Graphics.CSprite(_BERNICE_IDLE)); _state = ACTOR_STATES.IDLE; swapImage(_BERNICE_IDLE); _hearingRadius = 30; _MAP_ICON = _BERNICE_IDLE; _hitBox = new Collision.CHitBox(this, 10, 10, 16, 16); }
public CBoomerang(Vector2 velocity, Vector2 position, DIRECTION direction, int damage) : base(DIRECTION.DOWN, velocity, position) { _damage = damage; _imageIndex.Add(_SPIN, new Graphics.CSprite(Graphics.CTextures.EFFECT_BOOMERANG)); swapImage(_SPIN); _followRoot = false; _state = ACTOR_STATES.MOVING; _name = "boomerang"; startTimer0(60); _hitBox = new Collision.CHitBox(this, 9, 9, 10, 10); //direction calculation _calculateDirection(velocity, direction); CMasterControl.audioPlayer.soundBank["Items:boomerang"].sfxInstance.IsLooped = true; CMasterControl.audioPlayer.addSfx(CMasterControl.audioPlayer.soundBank["Items:boomerang"]); }
public CGibdo() : base() { _state = ACTOR_STATES.MOVING; _damagePerSec = 2; _health = 16; if (_gibdoCount <= 0) { Graphics.CTextures.addTexture(_WALK_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:1", "6:1", 5)); Graphics.CTextures.addTexture(_WALK_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:0", "6:0", 5)); Graphics.CTextures.addTexture(_WALK_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:2", "6:2", 5)); Graphics.CTextures.addTexture(_GRAB_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:4", "5:4", 2)); Graphics.CTextures.addTexture(_GRAB_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:3", "5:3", 2)); Graphics.CTextures.addTexture(_GRAB_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "0:5", "5:5", 2)); Graphics.CTextures.addTexture(_HOLD_DOWN, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "5:4", "5:4", 0)); Graphics.CTextures.addTexture(_HOLD_UP, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "5:3", "5:3", 0)); Graphics.CTextures.addTexture(_HOLD_LEFT, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 64, 48, 1, "5:5", "5:5", 0)); } _imageIndex.Add(_WALK_DOWN, new Graphics.CSprite(_WALK_DOWN)); _imageIndex.Add(_WALK_UP, new Graphics.CSprite(_WALK_UP)); _imageIndex.Add(_WALK_LEFT, new Graphics.CSprite(_WALK_LEFT)); _imageIndex.Add(_WALK_RIGHT, new Graphics.CSprite(_WALK_LEFT, true)); _imageIndex.Add(_GRAB_DOWN, new Graphics.CSprite(_GRAB_DOWN)); _imageIndex.Add(_GRAB_UP, new Graphics.CSprite(_GRAB_UP)); _imageIndex.Add(_GRAB_LEFT, new Graphics.CSprite(_GRAB_LEFT)); _imageIndex.Add(_GRAB_RIGHT, new Graphics.CSprite(_GRAB_LEFT, true)); _imageIndex.Add(_HOLD_DOWN, new Graphics.CSprite(_HOLD_DOWN)); _imageIndex.Add(_HOLD_UP, new Graphics.CSprite(_HOLD_UP)); _imageIndex.Add(_HOLD_LEFT, new Graphics.CSprite(_HOLD_LEFT)); _imageIndex.Add(_HOLD_RIGHT, new Graphics.CSprite(_HOLD_LEFT, true)); startTimer0(_TURN_TIME); _direction = DIRECTION.DOWN; _state = ACTOR_STATES.MOVING; swapImage(_WALK_DOWN); _angle = 270; _lineOfSight = 90; _visionRange = 30; _hitBox = new Collision.CHitBox(this, 20, 25, 25, 25); _shakeOffThreshold = 10; }
public CBarrel() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.rawTextures.Add(_SPRITE_NAMESPACE, CMasterControl.glblContent.Load <Texture2D>("sprites/items/liftables")); Graphics.CTextures.addTexture(_IDLE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 32, 32, 1, "0:0", "0:0")); } _imageIndex.Add(_IDLE, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_MAP_ICON, new Graphics.CSprite(_IDLE)); _barrelCount++; swapImage(_IDLE); _state = ACTOR_STATES.IDLE; _drawDepth = 8; _hitBox = new Collision.CHitBox(this, 8, 5, 16, 24); }
public override void init(string name, Vector2 position, string dataType, int compAddress, params string[] additional) { base.init(name, position, dataType, compAddress, additional); _hitBox = new Collision.CHitBox(this, 12, 8, 8, 12); //Initialize effect depending on type CActor effect = null; switch (_type) { case KEESETYPE.NORMAL: //Do Nothing return; //Skip effects case KEESETYPE.FIRE: effect = new Effects.CFire(); break; case KEESETYPE.ICE: effect = new Effects.CIce(); break; case KEESETYPE.SHADOW: effect = new Effects.CShadow(); break; case KEESETYPE.THUNDER: effect = new Effects.CThunder(); break; } if (component != null) { component.addActor(effect, "keeseEffect"); } effect.init("keeseEffect", new Vector2(_position.X, _position.Y), "", compAddress); effect.layer = layer; component.rootDrawHeight = 1; //Draw effect behind }
public CFloorTile() : base() { if (!Graphics.CTextures.rawTextures.ContainsKey(_SPRITE_NAMESPACE)) { Graphics.CTextures.addRawTexture(_SPRITE_NAMESPACE, "sprites/npc/floorTile"); Graphics.CTextures.addTexture(_IDLE, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 16, 16, 0, "0:0", "0:0")); Graphics.CTextures.addTexture(_SPINNING, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 16, 16, 0, "0:0", "0:1", 10)); Graphics.CTextures.addTexture(_BREAKING, new Graphics.CTextureAtlas(_SPRITE_NAMESPACE, 16, 16, 0, "1:0", "1:1", 30)); } _imageIndex.Add(_IDLE, new Graphics.CSprite(_IDLE)); _imageIndex.Add(_SPINNING, new Graphics.CSprite(_SPINNING)); _imageIndex.Add(_BREAKING, new Graphics.CSprite(_BREAKING)); _floorTileCount++; _state = ACTOR_STATES.IDLE; swapImage(_IDLE); _hitBox = new Collision.CHitBox(this, 0, 0, 16, 16); }
public CEnergyWave(DIRECTION direction, Vector2 velocity, Vector2 position) : base(direction, velocity, position) { name = "energyWaveSmall"; _imageIndex.Add(PROJ_DOWN, new Graphics.CSprite(Graphics.CTextures.EFFECT_ENERGY_WAVE_SMALL)); _imageIndex.Add(PROJ_LEFT, new Graphics.CSprite(Graphics.CTextures.EFFECT_ENERGY_WAVE_SMALL_LEFT)); _imageIndex.Add(PROJ_RIGHT, new Graphics.CSprite(Graphics.CTextures.EFFECT_ENERGY_WAVE_SMALL_LEFT, true, false)); _imageIndex.Add(PROJ_UP, new Graphics.CSprite(Graphics.CTextures.EFFECT_ENERGY_WAVE_SMALL, false, true)); if (_direction == DIRECTION.UP || _direction == DIRECTION.DOWN) { _hitBox = new Collision.CHitBox(this, 6, 9, 14, 10); } else { _hitBox = new Collision.CHitBox(this, 6, 9, 10, 14); } shoot(); startTimer0(60); }
//PARAMETERS //0: ChestType //1: ChestState //2: Item Inside public override void init(string name, Microsoft.Xna.Framework.Vector2 position, string dataType, int compAddress, params string[] additional) { short chestState, chestType, item; chestState = Convert.ToInt16(additional[0]); chestType = Convert.ToInt16(additional[1]); item = Convert.ToInt16(additional[2]); _chestState = (CHEST_STATES)chestState; _chestType = (CHEST_TYPES)chestType; _itemInside = (ITEMS_INSIDE)item; _imageIndex.Add(_CHESTS_SMALL, new Graphics.CSprite("tileset:items:chests-small")); _hitBox = new Collision.CHitBox(this, 0, 0, 16, 16); _openBox = new Collision.CHitBox(this, 0, 16, 16, 16); switch (_chestType) { case CHEST_TYPES.BIG_CHEST: break; case CHEST_TYPES.SMALL_CHEST: swapImage(_CHESTS_SMALL); if (_chestState == CHEST_STATES.LOCKED) { image.setFrame(0, 0); } else if (_chestState == CHEST_STATES.UNLOCKED) { image.setFrame(0, 1); } break; } base.init(name, position, dataType, compAddress, additional); }
public CBomb(DIRECTION direction, Vector2 velocity, Vector2 position, int damage) : base(direction, velocity, position) { _bombCount += 1; _damage = damage; _imageIndex.Add(_TICK, new Graphics.CSprite(Graphics.CTextures.EFFECT_BOMB)); _imageIndex.Add(_FAST_TICK, new Graphics.CSprite(Graphics.CTextures.EFFECT_BOMB_FAST_TICK)); _imageIndex.Add(_EXPLOSION, new Graphics.CSprite(Graphics.CTextures.EFFECT_EXPLOSION)); _name = "bomb" + _bombCount; _followRoot = false; _hitBox = new Collision.CHitBox(this, 13, 11, 10, 10); swapImage(_TICK); shoot(); startTimer0(120); MathExt.CPathNode[] _pathPositions = null; switch (direction) { case DIRECTION.DOWN: _pathPositions = _createDownPath(); break; case DIRECTION.LEFT: _pathPositions = _createLeftPath(); break; case DIRECTION.RIGHT: _pathPositions = _createRightPath(); break; case DIRECTION.UP: _pathPositions = _createUpPath(); break; } _followPath(_pathPositions); }