static ProjectileType() { //AssaultRifle AssaultRifleBullet._damage = 2.0f; AssaultRifleBullet._speed = 20.0f; AssaultRifleBullet._range = 50.0f; AssaultRifleBullet._radius = 0.075f; AssaultRifleBullet.VisibleEntitySize = AssaultRifleBullet._radius * 2; AssaultRifleBullet._density = 10.0f; AssaultRifleBullet.AnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/AssaultRifleBullet", 1, 1, AssaultRifleBullet.VisibleEntitySize); AssaultRifleBullet.AnimationDuration = 1.0f; AssaultRifleBullet.DrawLayer = DrawLayers.GameElements.UpperParticles; AssaultRifleBullet.DeathParticle = ParticleType.AssaultRifleBulletDeath; //EnergyShot EnergyShot._damage = 15.0f; EnergyShot._speed = 12.0f; EnergyShot._range = 25.0f; EnergyShot._radius = 0.5f; EnergyShot.VisibleEntitySize = EnergyShot._radius * 2; EnergyShot._density = 100.0f; EnergyShot.AnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/EnergyBall", 4, 1, EnergyShot.VisibleEntitySize); EnergyShot.AnimationDuration = 0.15f; EnergyShot.GlowEntitySize = EnergyShot.VisibleEntitySize * 2; EnergyShot.GlowSpriteSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/EnergyBallGlow", 4, 1, EnergyShot.GlowEntitySize); EnergyShot.DrawLayer = DrawLayers.GameElements.UpperParticles; EnergyShot.DeathParticle = ParticleType.EnergyRifleBulletDeath; }
public AnimatedSprite(SpriteAnimationSequence spriteAnimationSequence, float entitySize, float animationDuration, float drawLayer, bool shouldRepeat) { _animationSequence = spriteAnimationSequence; this._entitySize = entitySize; _animationDuration = animationDuration; _shouldRepeat = shouldRepeat; DrawLayer = drawLayer; }
public AnimatedSprite(String spriteResource, int xFrames, int yFrames, float entitySize, float animationDuration, float drawLayer) { _animationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence(spriteResource, xFrames, yFrames, entitySize); _animationDuration = animationDuration; _entitySize = entitySize; _shouldRepeat = true; DrawLayer = drawLayer; }
public DrawableGameObject(Vector2 startingPosition, SpriteAnimationSequence spriteSequence, float entitySize, float animationDuration, float drawLayer) : base(startingPosition) { if (spriteSequence != null) { _sprite = new AnimatedSprite(spriteSequence, entitySize, animationDuration, drawLayer); _sprite.RandomizeFrame(); } }
static CollectibleType() { //ObjectiveType ObjectiveType._radius = 1f; ObjectiveType.VisibleEntitySize = ObjectiveType._radius * 8; ObjectiveType.AnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Collectables/Collectable", 1, 1, ObjectiveType.VisibleEntitySize); ObjectiveType.AnimationDuration = 3.0f; ObjectiveType.DrawLayer = DrawLayers.GameElements.Collectibles; ObjectiveType._miniMapSprite = new AnimatedSprite("Minimap/CollectableMinimap", 1, 1, MapTile.TileSideLength / 2, 1.0f, DrawLayers.HUD.Minimap_important_elements); }
public static SpriteAnimationSequence newOrExistingSpriteAnimationSequence(String spriteResource, int xFrames, int yFrames, float entitySize) { SpriteAnimationSequence sequence; if (ExisitingSequences.ContainsKey(spriteResource)) { sequence = ExisitingSequences[spriteResource]; } else { sequence = new SpriteAnimationSequence(spriteResource, xFrames, yFrames, entitySize); ExisitingSequences[spriteResource] = sequence; } return(sequence); }
public static void Initialize() { //ParasiteType Death ParasiteDeath._spriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Enemies/ParasiteDeath", 4, 1, CharacterType.ParasiteType.VisibleEntitySize); ParasiteDeath._animationDuration = 0.3f; ParasiteDeath.DrawLayer = DrawLayers.GameElements.LowerParticles; ParasiteDeath._entitySize = CharacterType.ParasiteType.VisibleEntitySize; ParasiteDeath.Lifespan = 4.0f; //SwarmerType Death SwarmerDeath._spriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Enemies/SwarmerDeath", 4, 1, CharacterType.SwarmerType.VisibleEntitySize); SwarmerDeath._animationDuration = 0.3f; SwarmerDeath.DrawLayer = DrawLayers.GameElements.LowerParticles; SwarmerDeath._entitySize = CharacterType.SwarmerType.VisibleEntitySize; SwarmerDeath.Lifespan = 4.0f; //Assault Rifle Bullet Death AssaultRifleBulletDeath._entitySize = ProjectileType.AssaultRifleBullet.VisibleEntitySize * 1.5f; AssaultRifleBulletDeath._spriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/AssaultRifleBulletDeath", 3, 1, AssaultRifleBulletDeath._entitySize); AssaultRifleBulletDeath._animationDuration = 0.25f; AssaultRifleBulletDeath.DrawLayer = DrawLayers.GameElements.UpperParticles; AssaultRifleBulletDeath.Lifespan = AssaultRifleBulletDeath._animationDuration; //Energy Rifle Bullet Death EnergyRifleBulletDeath._entitySize = ProjectileType.EnergyShot.VisibleEntitySize * 2f; EnergyRifleBulletDeath._spriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/EnergyBallDeath", 4, 1, EnergyRifleBulletDeath._entitySize); EnergyRifleBulletDeath._animationDuration = 0.15f; EnergyRifleBulletDeath.GlowSpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/EnergyBallDeathGlow", 4, 1, EnergyRifleBulletDeath._entitySize); EnergyRifleBulletDeath.DrawLayer = DrawLayers.GameElements.UpperParticles; EnergyRifleBulletDeath.Lifespan = EnergyRifleBulletDeath._animationDuration; //SwarmerType Attack SwarmerAttack._entitySize = Swarmer.AttackRange / 7f; SwarmerAttack._spriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/SwarmerBolt", 4, 1, SwarmerAttack._entitySize); SwarmerAttack.GlowSpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Projectiles/SwarmerBoltGlow", 4, 1, SwarmerAttack._entitySize); SwarmerAttack._animationDuration = 0.3f; SwarmerAttack.DrawLayer = DrawLayers.GameElements.UpperParticles; SwarmerAttack.Lifespan = 0.3f; }
public static void Initialize() { //PlayerType PlayerType = new CharacterType(); PlayerType._physicalEntitySize = 1.0f; PlayerType.SpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Player", 1, 1, PlayerType._physicalEntitySize * 1.3f); PlayerType.AnimationDuration = 1.0f; PlayerType.DrawLayer = DrawLayers.GameElements.Characters; PlayerType._objectShape = ObjectShapes.CIRCLE; PlayerType._density = 1.0f; PlayerType._maxTurningTorque = 1.0f; PlayerType._maxMovementForce = 80.0f; PlayerType._health = 150; PlayerType._linearDampening = 10f; PlayerType.MinimapSprite = new StaticSprite("Minimap/PlayerMinimap", MapTile.TileSideLength / 2, DrawLayers.HUD.Minimap_important_elements); //SillyBoxType SillyBoxType = new CharacterType(); SillyBoxType._physicalEntitySize = 1.0f; SillyBoxType.SpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("TestImages/Box", 17, 1, SillyBoxType._physicalEntitySize); SillyBoxType.AnimationDuration = 1.0f; SillyBoxType.DrawLayer = DrawLayers.GameElements.Characters; SillyBoxType._objectShape = ObjectShapes.RECTANGLE; SillyBoxType._density = 1.0f; SillyBoxType._maxTurningTorque = 1.0f; SillyBoxType._maxMovementForce = 300.0f; SillyBoxType._linearDampening = 0.0f; SillyBoxType._health = 10; //ParasiteType ParasiteType = new CharacterType(); ParasiteType._physicalEntitySize = 0.8f; ParasiteType.VisibleEntitySize = ParasiteType._physicalEntitySize * 6f / 4f; ParasiteType.SpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Enemies/Parasite", 5, 1, ParasiteType._physicalEntitySize * 6f / 4f); ParasiteType.AnimationDuration = 0.23f; ParasiteType.DrawLayer = DrawLayers.GameElements.Characters; ParasiteType._objectShape = ObjectShapes.CIRCLE; ParasiteType._density = 1.0f; ParasiteType._maxTurningTorque = 1.0f; ParasiteType._maxMovementForce = 100.0f; ParasiteType._health = 20; ParasiteType.MainAttackDamage = 5.0f; ParasiteType._linearDampening = 10f; ParasiteType.MinimapSprite = new StaticSprite("Minimap/EnemyMinimap", MapTile.TileSideLength / 5, DrawLayers.HUD.Minimap_normal_elements); ParasiteType.DeathParticle = ParticleType.ParasiteDeath; ParasiteType.DeathSound = "squish"; //SwarmerType SwarmerType = new CharacterType(); SwarmerType._physicalEntitySize = 1.3f; SwarmerType.VisibleEntitySize = SwarmerType._physicalEntitySize * 5.0f / 4.0f; SwarmerType.SpriteAnimationSequence = SpriteAnimationSequence.newOrExistingSpriteAnimationSequence("Enemies/Swarmer", 7, 1, SwarmerType.VisibleEntitySize); SwarmerType.AnimationDuration = 0.5f; SwarmerType.DrawLayer = DrawLayers.GameElements.Characters; SwarmerType._objectShape = ObjectShapes.CIRCLE; SwarmerType._density = 1.0f; SwarmerType._maxTurningTorque = 1.0f; SwarmerType._maxMovementForce = 140.0f; SwarmerType._health = 29; SwarmerType.MainAttackDamage = 8.0f; SwarmerType._linearDampening = 10f; SwarmerType.MinimapSprite = new StaticSprite("Minimap/EnemyMinimap", MapTile.TileSideLength / 4, DrawLayers.HUD.Minimap_normal_elements); SwarmerType.DeathParticle = ParticleType.SwarmerDeath; SwarmerType.DeathSound = "squish"; }
public AnimatedSprite(SpriteAnimationSequence spriteAnimationSequence, float entitySize, float animationDuration, float drawLayer) : this(spriteAnimationSequence, entitySize, animationDuration, drawLayer, true) { }