public void draw(SpriteBatch spriteBatch, EvilChopper e) { foreach (particle value in particles) { value.draw(spriteBatch,e,transparency); } }
public void update(EvilChopper e) { position += e.Velocity; if(e.alive==false){ position += velocity; transparency -= 0.02f; scale += 0.05f; } }
public void genWave(int amount, Crosshair crosshair, VIP vip, ContentManager Content, Viewport viewport, int incDistance) { for (int i = 0; i < amount; i++) { if (waveNumber == 1) { genericDude = new EvilChopper(new Vector2((float)(vip.Position.X + 400 + ((double)distance * Math.PI)), RandomNumber(200, 700)), Content); genericDude.LoadContent(Content, viewport); WaveEnemies.Add(genericDude); } if (waveNumber >= 2) { for (float time = 0; time <= 8; time += .15f) { if (time >= 7) { genericDude = new EvilChopper(new Vector2((float)(vip.Position.X + 400 + ((double)distance * Math.PI)), RandomNumber(200, 700)), Content); genericDude.LoadContent(Content, viewport); WaveEnemies.Add(genericDude); } } } distance+=incDistance; } // heli.position.y=Random(0,200);//randomise its y value }
public void update(EvilChopper e) { this.Position += e.Velocity; if(e.alive==false){ foreach (particle value in particles) { value.update(); transparency = value.transparency; } } }
public void draw(SpriteBatch spriteBatch, EvilChopper e,float transparency) { transparency = this.transparency; spriteBatch.Draw(image, e.Position, null, Color.White * transparency, 0f, Vector2.Zero, scale, SpriteEffects.None, 1f); }
public void Veloc(EvilChopper chopper) { if (chopper.Position.X > Position.X) { Velocity.X += 0.1f; if (Velocity.X > 5) { Velocity.X = 5; } } if (chopper.Position.X <Position.X) { Velocity.X -= 0.1f; if (Velocity.X < -5) { Velocity.X = -5; } } if (chopper.Position.X == Position.X) { Velocity.X = 0; } if (chopper.Position.Y > Position.Y) { Velocity.Y += 0.1f; if (Velocity.Y > 5) { Velocity.Y = 5; } } if (chopper.Position.Y < Position.Y) { Velocity.Y -= 0.1f; if (Velocity.Y < -5) { Velocity.Y = -5; } } if (chopper.Position.Y == Position.Y) { Velocity.Y = 0; } }
public void Move(EvilChopper command) { prePosition = Position; Position.X += Velocity.X ; Position.Y += Velocity.Y; Veloc(command); trail.update(this); }
public void DrawEvilChopper(SpriteBatch spriteBatch, Texture2D texture, EvilChopper c, SpriteEffects flip) { spriteBatch.Draw(texture, c.Position, sourceBounds, Color.White, 0f, Origin, 1.0f, flip, .2f); }