public Avalanche(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 610, 768), //Source sprite Vector2.Zero, //Speed Vector2.One, //Scale null //Weapon ) { //Stats this.hp = Int32.MaxValue; this.points = 0; this.Difficulty = 0; this.Background = false; this.Removable = false; this.UseAnimation = true; //Will change later this.totalFrameNumber = 3; this.frameCooldown = 75f; this.spriteBox = new Vector2(613, 768); this.firstStepPassed = false; this.endLevel = false; this.hitbox = new PositionedCircleHitbox(this, new Vector2(-450, 730), 900, false, 1); this.ttl = InfiniteTimeToLive; }
public PoulpiMarin(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 320, 320); this.dRect = ComputeDstRect(sRect); this.spriteBox = new Vector2(320, 320); }
public override void Update(GameTime gameTime) { if (!targetFound) { Pattern = null; //Chasing the player : build a move pattern on him MovePattern mp = new MovePattern(); int rand = RandomMachine.GetRandomInt(0, 1); Player p = TGPAContext.Instance.Player1; if ((rand == 0) && (TGPAContext.Instance.Player2 != null)) { p = TGPAContext.Instance.Player2; } mp.AddPoint(p.DstRect.Center); if (location.X > (int)p.Location.X) { mp.AddPoint(new Point(-50, (int)p.Location.Y)); } else { mp.AddPoint(new Point(TGPAContext.Instance.ScreenWidth + 100, (int)p.Location.Y)); } Pattern = mp; targetFound = true; } base.Update(gameTime); }
public PoulpiMexico(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip,flags) { this.sRect = new Rectangle(0, 0, 320, 320); this.dRect = ComputeDstRect(sRect); this.spriteBox = new Vector2(320, 320); }
public McBernick(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 634, 600), //Source sprite new Vector2(75.0f, 15.0f), //Speed new Vector2(0.25f, 0.25f), new McBernikWeapon() ) { //Common stats hp = 35; points = 10000; Difficulty = 6; //Weapon sprite armSrc = new Rectangle(720, 0, 230, 430); armDst = new Rectangle(); armDst.Width = (int)(armSrc.Width * Scale.X); armDst.Height = (int)(armSrc.Height * Scale.Y); armAnchor = new Vector2(armSrc.Width / 2, armSrc.Height - (armSrc.Height / 8)); //Special property ((McBernikWeapon)this.Weapon).Parent = this; }
public Canon(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 136, 104), //Source sprite Vector2.Zero, //Speed Vector2.One, new CanonWeapon() ) { this.canonSrc = new Rectangle(135, 0, 121, 78); this.canonCenter = new Vector2(80, 42); this.structureLinkPoint = new Vector2(84, 38); //Canon center has to be on this point //Stats this.hp = 150; this.Difficulty = 50; this.points = 2500; this.ttl = Entity.InfiniteTimeToLive; this.Background = true; this.firstReactorRelativeLoc = new Vector2(41, 98); this.secondReactorRelativeLoc = new Vector2(107, 98); this.Hitbox = new CircleHitbox(this, true); ((CanonWeapon)this.wpn).Parent = this; this.UseRotationWhenDrawing = false; }
public override void TodoOnDeath() { //Free a PoulpiSnow MovePattern mp = new MovePattern(); switch (this.Flip) { case SpriteEffects.FlipHorizontally: mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2); mp.AddPoint((int)TGPAContext.Instance.ScreenWidth + 1, (int)TGPAContext.Instance.ScreenHeight / 2); break; case SpriteEffects.None: mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2); mp.AddPoint(-500, (int)TGPAContext.Instance.ScreenHeight / 2); break; } Snow s = new Snow(this.location, RandomMachine.GetRandomVector2(-100f, 20f, 50f, -300f), 800f, RandomMachine.GetRandomInt(0, 4)); TGPAContext.Instance.ParticleManager.AddParticle(s, false); PoulpiSnow ps = new PoulpiSnow(this.location, this.scrollValue, null, mp, this.Flip, this.flagsOnDeath); TGPAContext.Instance.AddEnemy(ps); //base.TodoOnDeath(); }
public Rock(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, null ) { //Stats hp = 3; points = 1000; this.icon = RandomMachine.GetRandomInt(0, 3); if (this.icon == 3) { this.icon = 1; //HACK } sRect = new Rectangle(0 + (128 * icon), 0, 128, 128); dRect = ComputeDstRect(sRect); speedYBis = 0f; if (this.icon != 2) { visualRotation = 0f; } UseRotationWhenDrawing = true; UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true, 2f); this.Background = true; }
public Avalanche(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 610, 768), //Source sprite Vector2.Zero, //Speed Vector2.One, //Scale null //Weapon) { //Stats this.hp = Int32.MaxValue; this.points = 0; this.Difficulty = 0; this.Background = false; this.Removable = false; this.UseAnimation = true; //Will change later this.totalFrameNumber = 3; this.frameCooldown = 75f; this.spriteBox = new Vector2(613, 768); this.firstStepPassed = false; this.endLevel = false; this.hitbox = new PositionedCircleHitbox(this, new Vector2(-450, 730), 900, false, 1); this.ttl = InfiniteTimeToLive; }
public IEnumerator Duration() { yield return(new WaitForSeconds(PowerUpTime)); Current = Back; FastParticles.SetActive(false); }
static Knight() { int[] dRows = new int[] { -2, -2, -1, -1, 1, 1, 2, 2 }; int[] dCols = new int[] { -1, 1, -2, 2, -2, 2, -1, 1 }; Knight.MovePattern = new MovePattern(dRows, dCols, false); }
public static void Start() { DirectoryInfo di = new DirectoryInfo(LuaConst.luaDir); files = di.GetFiles("*.lua", SearchOption.AllDirectories); foreach (var lFile in files) { LuaManager.LoadFile(lFile.FullName); } double MoveMax = (double)LuaManager.Lua["MovePatternMax"]; for (int lIndex = 0; lIndex < (int)MoveMax; lIndex++) { string methodName = "MovePattern" + lIndex; MovePattern.Add(LuaManager.GetFunction(methodName)); } double ShotMax = (double)LuaManager.Lua["ShotPatternMax"]; for (int lIndex = 0; lIndex < (int)ShotMax; lIndex++) { string methodName = "ShotPattern" + lIndex; ShotPattern.Add(LuaManager.GetFunction(methodName)); } }
private void NextPattern() { moveIsFinished = false; patternIndex++; currentPattern = patternData[patternIndex]; Debug.Log("Pattern " + patternIndex + " set for " + transformToMove.gameObject.name + " : " + currentPattern.name); }
void Update() { if (_HP <= 0) { movepattern = MovePattern._Death; } switch (movepattern) { case MovePattern._Search: Search(); break; case MovePattern._Atack: Atack(); break; case MovePattern._Death: //Death(); break; } //if (Vector3.Distance(Vector3.zero, transform.position) > 50) //{ // Destroy(gameObject); //} }
public Rock(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, null) { //Stats hp = 3; points = 1000; this.icon = RandomMachine.GetRandomInt(0, 3); if (this.icon == 3) this.icon = 1; //HACK sRect = new Rectangle(0 + (128 * icon), 0, 128, 128); dRect = ComputeDstRect(sRect); speedYBis = 0f; if (this.icon != 2) { visualRotation = 0f; } UseRotationWhenDrawing = true; UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true,2f); this.Background = true; }
public Canon(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 136, 104), //Source sprite Vector2.Zero, //Speed Vector2.One, new CanonWeapon()) { this.canonSrc = new Rectangle(135, 0, 121, 78); this.canonCenter = new Vector2(80, 42); this.structureLinkPoint = new Vector2(84, 38); //Canon center has to be on this point //Stats this.hp = 150; this.Difficulty = 50; this.points = 2500; this.ttl = Entity.InfiniteTimeToLive; this.Background = true; this.firstReactorRelativeLoc = new Vector2(41, 98); this.secondReactorRelativeLoc = new Vector2(107, 98); this.Hitbox = new CircleHitbox(this, true); ((CanonWeapon)this.wpn).Parent = this; this.UseRotationWhenDrawing = false; }
public PingouinLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 192), //Source sprite Vector2.Zero, //Speed Vector2.One, null ) { //Stats hp = 251; points = 5000; Difficulty = 20; this.Background = true; shotlocation = new Vector2(105, 180); this.ttl = InfiniteTimeToLive; this.hitbox = new SquareHitbox(this, new Vector2(0.25f, 0.25f)); base.Weapon = new PingouinLauncherWeapon(this); bunker1Rect = new Rectangle(220, 0, 580, 240); soliRect = new Rectangle(8, 500, 57, 100); bunker2Rect = new Rectangle(220, 240, 580, 240); bumper1Rect = new Rectangle(0, 0, 225, 240); bumper2Rect = new Rectangle(0, 240, 225, 240); }
void Wait() { wai = false; NMA.ResetPath(); NMA.isStopped = false; movepattern = MovePattern._Search; }
// #DEPRECATED public Hazard LaunchMissile(GridBlock currentGrid, Vector2Int facingDirection) { if (weaponAmmunition > 0) { Vector3 currentWorldLocation = new Vector3(currentGrid.location.x, currentGrid.location.y, 0); GameObject missile = Instantiate(onGridWeaponPrefab, currentWorldLocation, transform.rotation); MovePattern movement = missile.GetComponent <MovePattern>(); if (facingDirection == Vector2Int.up) { movement.SetMovePatternUp(); } else if (facingDirection == Vector2Int.down) { movement.SetMovePatternDown(); } else if (facingDirection == Vector2Int.left) { movement.SetMovePatternLeft(); } else if (facingDirection == Vector2Int.right) { movement.SetMovePatternRight(); } weaponAmmunition -= 1; launchedMissile = missile.GetComponent <Hazard>(); return(launchedMissile); } else { return(null); } }
private void setFollowingPlayerParamsByMoveResult(MoveResult moveResult) { _lastFollowingPlayerBlockMode = _followingPlayerBlockMode; SetMovePosition(MovePattern.FollowingPlayer); switch (moveResult) { case MoveResult.RowBlock: FollowingPlayerBlockMode = BlockMode.Row; _movePattern = MovePattern.Straight; _moveDirection.setHorizontalDirection(Position.Col, _movePosition.Col); break; case MoveResult.ColumnBlock: FollowingPlayerBlockMode = BlockMode.Column; _movePattern = MovePattern.Straight; _moveDirection.setVerticalDirection(Position.Row, _movePosition.Row); break; case MoveResult.TotalBlock: FollowingPlayerBlockMode = BlockMode.Total; _movePattern = MovePattern.Diagonal; _moveDirection.setHorizontalDirection(Position.Col, _movePosition.Col, isDiagonal: true); _moveDirection.setVerticalDirection(Position.Row, _movePosition.Row, isDiagonal: true); _moveDirection.Divert(moveResult); break; default: break; } }
public PingouinLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 192), //Source sprite Vector2.Zero, //Speed Vector2.One, null) { //Stats hp = 251; points = 5000; Difficulty = 20; this.Background = true; shotlocation = new Vector2(105, 180); this.ttl = InfiniteTimeToLive; this.hitbox = new SquareHitbox(this, new Vector2(0.25f, 0.25f)); base.Weapon = new PingouinLauncherWeapon(this); bunker1Rect = new Rectangle(220, 0, 580, 240); soliRect = new Rectangle(8, 500, 57, 100); bunker2Rect = new Rectangle(220, 240, 580, 240); bumper1Rect = new Rectangle(0, 0, 225, 240); bumper2Rect = new Rectangle(0, 240, 225, 240); }
private void OnTriggerEnter(Collider obj) { prevMovePattern = obj.GetComponent <Ball>().MovePattern; obj.GetComponent <Ball>().MovePattern = PowerUpTransfer.Transfer(); gameObject.SetActive(false); }
public RandomCow(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { //Randomize scale for fun float scale = RandomMachine.GetRandomFloat(0.35f, 1.3f); this.Scale = new Vector2(scale, scale); }
public void makeNariMovePattern(int x, int y, int extendNum) { MovePattern m = new MovePattern(); m.x = x; m.y = y; m.ableExtend = extendNum; nariMovePatterns.Add(m); }
public PoulpiSnow(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 350, 300); this.spriteBox = new Vector2(350, 300); this.hp *= 2; this.Difficulty *= 2; this.Scale = new Vector2(0.3f, 0.3f); this.Weapon = new PoulpiSnowWeapon(); }
void OnTriggerEnter(Collider col) { if (col.tag == "Enemy") { NMA.isStopped = true; movepattern = MovePattern._Wait; col.GetComponent <EnemyMove>()._HP--; _HP -= 0.5f; } }
public override void Initialize() { Init(); startingCoordinates.Add(new Vector3(-11.5f, 0.4f, 1)); // starting coordinate for enemies // startingCoordinates.Add (new Vector3 (x, y, 1)); // you can add more starting coordinate based on the routes on your map // startingCoordinates.Add (new Vector3 (x, y, 1)); // monster factory will be generated based on the number of starting coordinates MovePattern.setInstance(LEVEL); ig = new ItemGenerator(0.8f); // items spawn rate SetUp(); }
private void Start() { controller = GetComponent <CharacterController>(); Current = Back; FastParticles.SetActive(false); audioManager = AudioManager.instance; if (audioManager == null) { Debug.LogError("FREAK OUT! No AudioManager found in the scene."); } }
/// <summary> /// Convert a move pattern in a list of nodes /// </summary> /// <param name="mp"></param> /// <returns></returns> public static List <Node> ConvertToNodeList(MovePattern mp) { List <Node> list = new List <Node>(); foreach (Point point in mp.Points) { list.Add(new Node(point)); } return(list); }
/// <summary> /// Convert nodes in a move pattern /// </summary> /// <param name="nodes"></param> /// <returns></returns> public static MovePattern ConvertToMovePattern(Node[] nodes) { MovePattern mp = new MovePattern(); foreach (Node n in nodes) { mp.AddPoint(n.Point); } return(mp); }
public void UpdateMovePatternForMissingTarget() { if (CharAttention.GetPlayersInAttentionRange().Count <= 0) { ActiveMovePattern = BaseMovePattern; } else { DecideMovePattern(); } }
public void Move() { if (m == null) { m = MovePattern.getInstance(); } else { m.Move(this); } }
public Pepito(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 310, 218), //Source sprite new Vector2(100.0f, 100.0f), //Speed new Vector2(0.35f, 0.35f), new PepitoWeapon()) { hp = 12; points = 3000; Difficulty = 20; }
private void OnTriggerEnter(Collider obj) { prevMoveCharacter = obj.GetComponent <MoveCharacter>(); prevMovePattern = prevMoveCharacter.MovePattern; obj.GetComponent <MoveCharacter>().MovePattern = PowerUp.MovePattern; Invoke("RestoreMovePattern", TimeToRestore); gameObject.SetActive(false); }
public SapinLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, null) { cooldown = 1500; ttl = InfiniteTimeToLive; hitbox = new Hitbox.EmptyHitbox(this); hp = Int32.MaxValue; }
public PoulpiKnight(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 350, 320); this.dRect = ComputeDstRect(sRect); this.spriteBox = new Vector2(350, 320); this.speed.Y = 250; this.wpn = new PoulpiKnightWeapon(); this.hp *= 3; }
public Pepito(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 310, 218), //Source sprite new Vector2(100.0f, 100.0f), //Speed new Vector2(0.35f, 0.35f), new PepitoWeapon() ) { hp = 12; points = 3000; Difficulty = 20; }
public Pirate(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 520, 390), //Source sprite new Vector2(100.0f, 100.0f), //Speed Vector2.One, new PirateWeapon()) { //Stats hp = 50; points = 1000; Difficulty = 100; }
private void OnEnable() { fonts = new GameObject[num]; pos = new Vector3[num]; vel = new Vector3[num]; stepDegree = 2.0f * Mathf.PI / num; rootPos = new Vector3[num]; movePattern = new MovePattern(true, false); AlignmentSelect = new int[2] { 0, 0 }; }
public McBernickZombie(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 634, 600), //Source sprite new Vector2(75.0f, 15.0f), //Speed new Vector2(0.25f, 0.25f), null) { //Common stats hp = 50; points = 10000; Difficulty = 6; this.ttl = 60000; this.hitbox = new CircleHitbox(this, false, 1.75f); }
public PoulpiFrozen(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 198 ,170), //Source sprite Vector2.Zero, //Speed new Vector2(0.75f,0.75f), null) { //Stats hp = 30; points = 1500; Difficulty = 3; this.Background = true; this.hitbox = new SquareHitbox(this, new Vector2(0.2f, 0.1f)); }
public Pumpkin(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite Vector2.Zero, //Speed new Vector2(0.5f,0.5f), null) { //Stats hp = 60; points = 1200; Difficulty = 10; hitCooldown = 0f; this.hitbox = new SquareHitbox(this, new Vector2(0.25f,0.25f)); this.bombed = false; this.Background = true; }
public Trainee(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 512, 1024), //Source sprite new Vector2(150.0f, 150.0f), //Speed new Vector2(0.25f, 0.25f), null) { //Stats hp = 30; points = 2000; Difficulty = 1; this.InfiniteMovePattern = true; this.hitbox = new SquareHitbox(this,new Vector2(0.3f,0.1f)); this.cooldown = 0f; }
public EtoileMer(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite new Vector2(300, 300), //Speed new Vector2(0.25f,0.25f), null) { hp = 10; points = 1500; Difficulty = 20; this.UseRotationWhenDrawing = true; this.visualRotation = 0f; this.UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true); }
public CowLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, new CowLauncherWeapon()) { //Stats hp = Int32.MaxValue; points = 0; ttl = 10000f; Difficulty = 50; this.hitbox = new EmptyHitbox(this); this.Removable = false; this.Background = true; }
void Start () { movePattern = GetComponent<MovePattern>(); beatManager = GetComponent<BeatManager>(); MovePattern.OnPatternFrameChange += OnPatternFrameChange; MovePattern.OnPatternPlayerTurnStart += OnPatternPlayerTurnStart; MovePattern.OnPatternComplete += OnPatternComplete; MovePattern.OnPatternFailed += OnPatternFailed; MovePattern.OnCorrectMove += OnCorrectMove; BeatManager.OnBeat += OnBeat; ChangeSpeed(1.0f); UpdateScore(0); round = 0; StageStart(); }
public PoulpElite(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 327, 251); this.dRect = ComputeDstRect(sRect); this.UseAnimation = true; this.totalFrameNumber = 2; this.frameCooldown = 200; this.spriteBox = new Vector2(327, 251); this.speed.Y = 250; this.speed.Y = 250; this.wpn = null; this.hp *= 3; }
public Bird(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 128), //Source sprite new Vector2(350, 350.0f), //Speed new Vector2(0.3f, 0.3f), null) { //Stats hp = 3; points = 1000; Difficulty = 5; targetFound = false; this.UseSpriteOrigin(); UseRotationWhenDrawing = flip == SpriteEffects.None; Hitbox = new CircleHitbox(this, true, 3f); }
public CactusMan(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 9, 97, 120), //Source sprite Vector2.Zero, //Speed Vector2.One, null) { //Stats hp = 10; speed = new Vector2(0.0f, 0.0f); points = 1500; Difficulty = 30; Background = true; step = 0; }
public LittleUndergroundCreature(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite new Vector2(150, 0), //Speed new Vector2(0.25f,0.25f), null) { hp = 12; points = 1000; Difficulty = 5; fall = false; UseAnimation = true; this.totalFrameNumber = 2; this.frameCooldown = 250; this.spriteBox = new Vector2(256, 256); }
public Caca(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 128, 128), //Source sprite Vector2.Zero, //Speed new Vector2(0.25f,0.25f), null) { //Stats hp = 1; points = 1000; Difficulty = 10; this.Background = true; speedBis = 0f; launching = false; }
public Pingouin(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 77, 119), //Source sprite new Vector2(300, 300), //Speed Vector2.One, null) { //Stats hp = 9; points = 2000; Difficulty = 2; visualRotation = RandomMachine.GetRandomFloat(0.0f,Math.PI); this.UseRotationWhenDrawing = true; this.visualRotation = 0f; this.UseSpriteOrigin(); this.hitbox = new CircleHitbox(this,true,1.2f); }
public FlipperZombie(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite new Vector2(100, 0), //Speed new Vector2(0.75f, 0.75f), null) { hp = 31; points = 5000; Difficulty = 20; this.ttl = 60000; this.UseAnimation = false; //Change it later this.totalFrameNumber = 2; this.frameCooldown = 100; this.spriteBox = new Vector2(256, 256); this.hitbox = new CircleHitbox(this, false, 2f); }
public ElFeroCactae(Vector2 scroll, String[] flags) : base(scroll) { //Source sprite sRect = new Rectangle(0, 0, 512, 512); Scale = new Vector2(1.3f, 1.3f); location = new Vector2(TGPAContext.Instance.TitleSafeArea.Right - this.dRect.Width, TGPAContext.Instance.ScreenHeight + 1); etat = CactusStateBoss.Attack; frametime = 400; ttl = InfiniteTimeToLive; //Stats wpn = new ElFeroCactaeWPN1(); wpn2 = new ElFeroCactaeWPN2(); wpn3 = new ElFeroCactaeWPN3(); wpn4 = new ElFeroCactaeWPN4(); attackDuration = 0.0f; hp = basicHP; maxLifebarValue = hp; speed = new Vector2(0f, 70.0f); Pattern = new MovePattern(); Pattern.AddPoint((int)location.X + dRect.Width / 2, 0); frametime = 0f; points = 125000; go = false; deltaX = -1; attacks = AttackBoss2.Circluar; this.hitbox = new EmptyHitbox(this); this.flagsOnDeath = flags; panel = new BackgroundActiveElement.ElFeroPanel(new Vector2(150, TGPAContext.Instance.ScreenHeight + 1)); TGPAContext.Instance.AddEnemy(panel); this.DrawLifebar = true; this.DrawWarning = true; }
public Yeti(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 400, 300), //Source sprite new Vector2(150,150), //Speed new Vector2(0.6f,0.6f), null) { //Stats hp = 32; points = 3000; Difficulty = 5; this.UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true, 2f); this.UseAnimation = true; this.totalFrameNumber = 2; this.frameCooldown = 150; this.spriteBox = new Vector2(400, 300); }
public PoulpiZombie(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 322, 251), //Source sprite new Vector2(35.0f, 35.0f), //Speed new Vector2(0.25f, 0.25f), null //No weapon, it's a zombie) { //Stats hp = 12; points = 200; Difficulty = 10; this.ttl = 60000; UseAnimation = true; this.totalFrameNumber = 2; this.frameCooldown = 500; this.spriteBox = new Vector2(320, 256); this.currentFrame = RandomMachine.GetRandomInt(0, 1); this.hitbox = new CircleHitbox(this, false, 2f); }
/// <summary> /// This method instanciates a new enemey. /// </summary> /// <param name="x">The x start positon.</param> /// <param name="startPosition">The start position on the level map.</param> /// <param name="speed">The speed of the enemey</param> /// <param name="movePattern">Which move pattern the enemy uses.</param> /// <param name="enemyType">Which type of enemey this is.</param> /// <param name="bulletType">Which type of bullets the enemy fires.</param> /// <param name="bulletPower">How powerfull the enemy bullets are.</param> /// <param name="bulletSpeed">How fast the enemey bullets are.</param> /// <param name="bulletReloadTime">How long it takes for the plane to reload.</param> /// <param name="shieldThicknes">How thick the shiled of the enemy is.</param> /// <param name="score">The score the player recives by killing this enemey.</param> public Enemy(int x, int startPosition, double speed, MovePattern movePattern, EnemyType enemyType, BulletType bulletType, int bulletPower, double bulletSpeed, double bulletReloadTime, int power, int score) { this.x = x; this.y = -32; this.tempY = this.y; this.speed = speed; this.score = score; this.startPosition = startPosition; this.movePattern = movePattern; this.enemyType = enemyType; this.bulletType = bulletType; this.bulletPower = bulletPower; this.bulletSpeed = bulletSpeed; this.bulletReloadTime = bulletReloadTime; this.bulletTick = (int)(bulletReloadTime - (bulletReloadTime / 4)); //Making the plane able to fire the first bullet after one fourth of the bullet reload time. this.power = power; this.spriteTick = 0; this.collitionRectangle = new Rectangle(x, y, spriteSize.Width, spriteSize.Height); this.Status = EnemyStatus.Idle; SetEnemySpesific(); }
public Moustik(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(23, 0, 204, 256), //Source sprite new Vector2(220.0f, 220.0f), //Speed new Vector2(0.25f, 0.25f), new MoustikWeapon()) { //Stats hp = 3; Difficulty = 30; points = 1000; UseAnimation = true; this.totalFrameNumber = 2; this.frameCooldown = 250; this.spriteBox = new Vector2(256, 256); this.hitbox = new CircleHitbox(this, true, 1.5f); UseSpriteOrigin(); }