public Character(Stage stage, float x, float y, int width, int height, Character user) : base(stage, x, y, width, height) { this.user = user; effectPos = new Vector2(); animation = new Animation(width, height); }
public Terrain(Stage stage, float x, float y, int width, int height, int type) : base(stage, x, y, width, height) { this.type = type; activeDistance = 1280; animation = new Animation(width, height); }
public Terrain(Stage stage, float x, float y, int width, int height, Object user, Vector2 localPosition) : base(stage, x, y, width, height) { this.user = user; this.localPosition = localPosition; activeDistance = 1280; animation = new Animation(width, height); }
public Weapon(Stage stage, float x, float y, int width, int height, Object user, Vector2 localPosition) : base(stage, x, y, width, height) { this.localPosition = localPosition; this.user = user; animation = new Animation(width, height); activeDistance = user is Boss ? 1280 : 640; }
public override void Load(ContentManager content, string texture_name, string texture_name2) { base.Load(content, texture_name, texture_name2); animation = new Animation(width, height); // 判定矩形 animation2 = new Animation(texture2.Width / 3, texture.Height); // sparkEffect 48,24 animations = new Animation[10]; for (int i = 0; i < animations.Length; i++) animations[i] = new Animation(texture.Width / 3, texture.Height); // beam 64,64 animation = new Animation(texture.Width, texture.Height); }
// コンストラクタ public Fuujin(Stage stage, float x, float y, int width, int height, int HP, float vx, int bulletType, int shootType) : base(stage, x, y, width, height, HP, bulletType, shootType) { bindSize = new Vector2(180, 100); bindPos = new Vector2(50, 50); defBindPos = new Vector2(95, 83); defBindPosOther = new Vector2(width - defBindPos.X - bindSize.X, 50); this.defaultPosition = position; tmpPosition = defaultPosition + new Vector2(-100, -200); attackPosition = new Vector2(defaultPosition.X - 720, defaultPosition.Y);// new Vector2(defaultPosition.X - 500, defaultPosition.Y); animation = new Animation(380, 310); resWaitTime = 240; //bindSize = new Vector2(260, 260); //animation2 = new Animation(210, 210); obstacles = new List<Obstacle>(); obstacleMeteor = new Obstacle(stage, this, x, y, 32, 64, 2, 0); obstacleIcicleRandom = new Obstacle(stage, this, x, y, 32, 64, 2, 1); //obstacleIcicleAlternate = new Obstacle(stage, this, x, y, 32, 64, 2, 1); obstacleTornadeSmall = new Obstacle(stage, this, x, y, 32, 32, 2, 3); obstacleTornadeLarge = new Obstacle(stage, this, x, y, 32, 32, 2, 4); // !reuseBullet版 //cutterTurret5Way = new Turret(stage, this, new Vector2(150, 100), 32, 32, 0, 5, 5, false, true, 0, 4); //cutterTurret1WayBurst = new Turret(stage, this, new Vector2(150, 100), 32, 32, 0, 1, 10, false, true, 0, 4, 10, 320, 10); cutterTurret5Way = new Turret(stage, this, new Vector2(150, 100), 32, 32, 0, 5, 5, false, true, 0, 4, 10, 60, 10, Vector2.Zero, false, false); cutterTurret1WayBurst = new Turret(stage, this, new Vector2(150, 100), 32, 32, 0, 1, 10, false, true, 0, 4, 10, 320, 10, Vector2.Zero, false, false); cutterTurret1WayBurst.isMarked = true; cutterTurretAlternate = new Turret(stage, this, new Vector2(150, 100), 32, 32, 0, 5, 2, false, true, 0, 4, 10, 60, 10, Vector2.Zero, false, true, new int[] { 5, 1 });// bulSpeed 5→10 // shootInterval == 120だと、連発した時にPlayerを最初しか上手く追尾しない? obstacles.Add(obstacleMeteor); obstacles.Add(obstacleIcicleRandom); obstacles.Add(obstacleTornadeSmall); obstacles.Add(obstacleTornadeLarge); foreach (Obstacle obs in obstacles) weapons.Add(obs); turrets.Add(cutterTurret5Way); weapons.Add(cutterTurret5Way); turrets.Add(cutterTurret1WayBurst); weapons.Add(cutterTurret1WayBurst); turrets.Add(cutterTurretAlternate); weapons.Add(cutterTurretAlternate); largeWind = new Weapon(stage, x, y, 64, 400, this); weapons.Add(largeWind); jumpingEnemy = new JumpingEnemy(stage, position.X, position.Y, 32, 32, 2, this); stage.characters.Add(jumpingEnemy); foreach (Weapon weapon in weapons) stage.weapons.Add(weapon); }
public Beam(Stage stage, Turret turret, int width, int height, int type, int disappearType) : base(stage, turret, width, height) { // turretに追従させるパターン this.shootPosition = turret.position; this.position = shootPosition; this.disappearPattern = disappearType; animation2 = new Animation(48, 24); animations = new Animation[10]; for (int i = 0; i < animations.Length; i++) animations[i] = new Animation(64, 64); }
/*private Rectangle rect; private int maxWidth; private int defaultWidth;*/ public Beam(Stage stage, Turret turret, int width, int height) : base(stage, turret, width, height) { // Turretに管理させるパターン // 射撃位置に合わせる this.shootPosition = turret.position; this.position.X = shootPosition.X; this.position.Y = shootPosition.Y; isShot = false; animation = new Animation(width, height); animation2 = new Animation(48, 24); // 完全にエフェクト専用にしてハードコーディング animations = new Animation[10]; // 汎用的にやるのは面倒なので。これくらいあれば十分だろう. for (int i = 0; i < animations.Length; i++) animations[i] = new Animation(64, 64); }
public Sword(Stage stage, float x, float y, int width, int height, Character user) : base(stage, x, y, width, height) { this.user = user; //if (stage.player != null) this.player = stage.player; if (user is Player) this.player = user as Player; position = new Vector2(); //criterionVector = new Vector2(this.player.position.X + player.width / 2, player.position.Y + player.height / 2); criterionVector = new Vector2(this.user.position.X + user.width / 2, user.position.Y + user.height / 2); damagedObjects = new List<Object>(); degree = 100; //swordBeam = new Bullet(stage,this,null,this.position,40,8); beamTurret = new Turret(stage, this, new Vector2(5, 5), 40, 8, 0, 1, 1); animation = new Animation(64, 96); animation2 = new Animation(128, 80); Load(); }
public virtual void Load(ContentManager content, string texture_name, string texture_name2) { texture = content.Load<Texture2D>(texture_name); texture2 = content.Load<Texture2D>(texture_name2); animation = new Animation(texture.Width, texture.Height); animation2 = new Animation(texture2.Width, texture2.Height); }
/// <summary> /// texture別用 /// </summary> public Block(Stage stage, float x, float y, int width, int height, int type, Object user, Vector2 localPosition, bool onCeiling, bool loadManually, int textureType) : base(stage, x, y, width, height, user, localPosition) { this.onCeiling = onCeiling; this.loadManually = loadManually; this.textureType = textureType; switch (type) { case 0: this.friction = defFriction; break; case 1: this.friction = .25f; break;// .18f case 2: // hardcording注意 this.friction = .18f; //loadManually = true; //Load(); break; } if (loadManually) { switch (textureType) { case 1: Load(game.Content, "Object\\Turret&Bullet\\windTurret1"); animation = new Animation(64, 48);//(width, height); break; /*case 2: Load(game.content, "Stage02\\IcicleD"); break;*/ } } Load(); }
public Player(Stage stage, float x, float y, int width, int height, int HP) : base(stage, x, y, width, height) { LoadXML("Player", "Xml\\Objects_Base.xml"); this.MAXTAS = defMAXTAS; this.TASpower = initialTAS; this.HP = HP; this.activeDistance = defActiveDistance; sword = new Sword(stage, 200, 100, 64, 8, this); turnsRight = true; animation = new Animation(width, height); syouryuuMode = true; Load(); }
// コンストラクタ public Rival(Stage stage, float x, float y, int width, int height, int HP, float vx, int bulletType, int shootType) : base(stage, x, y, width, height, HP, bulletType, shootType) { bind = new Object(stage, x, y, 16, 16); sword = new Sword(stage, 200, 100, 64, 8, this); thunderTurret = new Turret(stage, this, new Vector2(5), 64, 48, 2, 0, 3, false, true, 3, 3); cutterTurret = new Turret(stage, this, this.position, 32, 32, 0, 0, 1, false, true, 0, 4); cutterTurret.bulletSpeed = new Vector2(-20, 0); syuriken = new Turret(stage, this, new Vector2(5), 32, 32, 0, 0, 1, false, true, 0, 2, 10, 10, 5, new Vector2(-10, 0), false, false, "katana"); //syuriken = new Turret(stage, this, this.position, 32, 32, 0, 1, 1, false, true, false, 3, 0, 2, 10, 120, 30, new Vector2(-10, 0), false, false); //syuriken = new Turret(stage, this, this.position, 32, 32, 0, 0, 1, false, true, false, 3, 0, 4); //syuriken.bulletSpeed = new Vector2(-10, 0); turrets.Add(thunderTurret); turrets.Add(cutterTurret); turrets.Add(syuriken); weapons.Add(thunderTurret); obstacleWindSmall = new Obstacle(stage, this, x, y, 32, 32, 2, 3); // =MapObjectsを生成 // 2 obstacleWindLarge = new Obstacle(stage, this, x, y, 32, 32, 2, 4); weapons.Add(obstacleWindSmall); weapons.Add(obstacleWindLarge); weapons.Add(sword); foreach (Turret tur in turrets) weapons.Add(tur); foreach (Weapon weapon in weapons) stage.weapons.Add(weapon); // stageのweaponsに追加 defaultPosition = new Vector2(x, y);// 15000, 360 defPosOtherSide = new Vector2(x - 480, y); attackPosition = new Vector2(x, y - 200); // 雷撃とか用 CenterPos = new Vector2(defaultPosition.X - 240, 240); //turnsRight = true; animation = new Animation(48, 48); jumpAnimation = new Animation(48, 48); rnd = new Random(); maxSpeed = 28; //Load(); }
protected override void Load() { switch (textureType) { case 0: texture = content.Load<Texture2D>("Object\\Turret&Bullet\\Bullet_type0"); animation = new Animation(texture.Width / 3, texture.Height); break; case 1: texture = content.Load<Texture2D>("Object\\Turret&Bullet\\Bullet_type1"); animation = new Animation(texture.Width, texture.Height); break; case 2: texture = content.Load<Texture2D>("Object\\Turret&Bullet\\Bullet_type2"); animation = new Animation(texture.Width, texture.Height); break; case 3: texture = content.Load<Texture2D>("Object\\Turret&Bullet\\Bullet_type3a"); animation = new Animation(texture.Width, texture.Height); break; case 4: texture = content.Load<Texture2D>("Object\\Turret&Bullet\\airCutter"); animation = new Animation(texture.Width, texture.Height); this.width = 32; this.height = 48; break; } if (textureType == 0) { } collisionRectTexture = content.Load<Texture2D>("Debug\\debugBind"); reflectSound = content.Load<SoundEffect>("Audio\\SE\\magic"); }
// Raijin.thnderTurret, Raijin.thnderTurrets, Raijin.thnderTurret8Way public Turret(Stage stage, Object user, Vector2 defPosition, int width, int height, int bulletType, int shootPattern, int bulletNum, bool shootManually, bool isSubsidiary, int textureType, int bulletTextureType , float bulletSpeed, int shootInterval, int bulletInterval, Vector2 bulletSpeed1D, bool reuseBullet, bool customPattern, params int[] patternIndexes) : base(stage, defPosition.X, defPosition.Y, width, height, user) { // type0:bullet、type1:beam、type3:else shootPositions = new List<Vector2>(); shootPositions.Add(shootPosition); //this.shootPosition = shootPosition; isVisible = false;//true;// //reuseBullets = true; this.shootInterval = shootInterval; this.bulletInterval = bulletInterval; this.defaultPosition = defPosition; this.bulletType = bulletType; this.shootPattern = shootPattern; this.bulletNumber = bulletNum; if (isSubsidiary) { this.position = user.position + defPosition/**/; // (isSubsidiaryで呼び出すとこの時点でdefPosition = shootPositionである) } else { this.position = defPosition; } this.shootManually = shootManually; this.isSubsidiary = isSubsidiary; this.canBeDestroyed = canBeDestroyed; this.HP = HP; this.textureType = textureType; this.bulletTextureType = bulletTextureType; this.bulletSpeed1D = bulletSpeed; this.bulletSpeed = bulletSpeed1D; this.reuseBullets = reuseBullet; this.customShootPattern = customPattern; for (int i = 0; i < patternIndexes.Length; i++) this.shootPatternLoop.Add(patternIndexes[i]); bullets = new List<Bullet>(); animation = new Animation(width, height); AddBullets(); Load(); if (bullets.Count <= 0) throw new Exception("No bullets to shoot in this turret."); } // Raijin.thnderTurret, Raijin.thnderTurrets, Raijin.thnderTurret8Way public Turret(Stage stage, Object user, Vector2 defPosition, int width, int height, int bulletType, int shootPattern, int bulletNum, bool shootManually, bool isSubsidiary, int textureType, int bulletTextureType , float bulletSpeed, int shootInterval, int bulletInterval, Vector2 bulletSpeed1D, bool reuseBullet, bool customPattern, string seName, params int[] patternIndexes) : base(stage, defPosition.X, defPosition.Y, width, height, user) { // type0:bullet、type1:beam、type3:else shootPositions = new List<Vector2>(); shootPositions.Add(shootPosition); //this.shootPosition = shootPosition; isVisible = false;//true;// //reuseBullets = true; this.shootInterval = shootInterval; this.bulletInterval = bulletInterval; this.defaultPosition = defPosition; this.bulletType = bulletType; this.shootPattern = shootPattern; this.bulletNumber = bulletNum; if (isSubsidiary) { this.position = user.position + defPosition/**/; // (isSubsidiaryで呼び出すとこの時点でdefPosition = shootPositionである) } else { this.position = defPosition; } this.shootManually = shootManually; this.isSubsidiary = isSubsidiary; this.canBeDestroyed = canBeDestroyed; this.HP = HP; this.textureType = textureType; this.bulletTextureType = bulletTextureType; this.bulletSpeed1D = bulletSpeed; this.bulletSpeed = bulletSpeed1D; this.reuseBullets = reuseBullet; this.customShootPattern = customPattern; for (int i = 0; i < patternIndexes.Length; i++) this.shootPatternLoop.Add(patternIndexes[i]); bullets = new List<Bullet>(); animation = new Animation(width, height); //playSE = true; this.seName = seName; AddBullets(); Load(); if (bullets.Count <= 0) throw new Exception("No bullets to shoot in this turret."); }
protected override void Load() { base.Load(); texture = content.Load<Texture2D>("Object\\Character\\RushingOutEnemy"); splashSound = content.Load<SoundEffect>("Audio\\SE\\water"); animation = new Animation(texture.Width, texture.Height); }
/// <summary> /// Stageからtextureを読み込ませていた時に使っていたメソッド /// </summary> public virtual void Load(ContentManager content, string texture_name) { texture = content.Load <Texture2D>(texture_name); animation = new Animation(texture.Width, texture.Height); }
protected override void Load() { base.Load(); thunderSoundBig = content.Load<SoundEffect>("Audio\\SE\\thunder_big"); thunderSoundSmall = content.Load<SoundEffect>("Audio\\SE\\thunder_small"); texture = content.Load<Texture2D>("Object\\Turret&Bullet\\discharge"); texture2 = content.Load<Texture2D>("Object\\Weapon\\Beam"); // animation1は矩形、2はエフェクト //animation = new Animation(width, height); animation = new Animation(texture.Width, texture.Height); animations = new Animation[10]; for (int i = 0; i < animations.Length; i++) { animations[i] = new Animation(texture.Width / 3, texture.Height);//32, 64 } }