public void AddMeteor() { float ySpeed = rand.Next(50, 150); float xSpeed = rand.Next(0, 100); Vector2 velocity = new Vector2(xSpeed / 500, -ySpeed / 500); float xPosition = rand.Next( (int)( (CUtil.SCREEN_WIDTH / 2) - CUtil.Camera.XOffset), (int)(CUtil.SCREEN_WIDTH - CUtil.Camera.XOffset) ); float yPosition = 5; Vector2 position = new Vector2(xPosition, yPosition); Meteor meteor = new Meteor(CUtil.ResourcePool.MeteorIdle, CUtil.ResourcePool.MeteorIdle, position, velocity); meteor.Scale = 0.5f; mProjectiles.Add(meteor); }
public void AddMeteor() { float ySpeed = rand.Next(50, 150); float xSpeed = rand.Next(0, 100); Vector2 velocity = new Vector2(xSpeed / 500, -ySpeed / 500); float xPosition = rand.Next( (int)((CUtil.SCREEN_WIDTH / 2) - CUtil.Camera.XOffset), (int)(CUtil.SCREEN_WIDTH - CUtil.Camera.XOffset) ); float yPosition = 5; Vector2 position = new Vector2(xPosition, yPosition); Meteor meteor = new Meteor(CUtil.ResourcePool.MeteorIdle, CUtil.ResourcePool.MeteorIdle, position, velocity); meteor.Scale = 0.5f; mProjectiles.Add(meteor); }