/* * CONSTRUCTORS */ public BallController(int fieldSize_, int ballSize_, float ballSpeed_, float ballSpeedLimit_, float ballSpeedInc_, float bounceCorrection_, SpriteBatch sb, Texture2D texture, SoundEffect high, SoundEffect low) { this.fieldSize = fieldSize_; this.ballSize = ballSize_; this.ballSpeed = ballSpeed_; this.ballSpeedLimit = ballSpeedLimit_; this.ballSpeedInc = ballSpeedInc_; this.bounceCorrection = bounceCorrection_; bleepLow = low; bleepHigh = high; ballStartPos = (fieldSize - ballSize) / 2; ball = new Entity(texture, new Rectangle(ballStartPos, ballStartPos, ballSize, ballSize)); timer = new Timer(); lastHitPlayer = -1; spriteBatch = sb; spriteTexture = texture; lastHitPlayer = -1; }
/* * CONSTRUCTORS */ public Ball(int fieldSize_, int ballSize_, float ballSpeed_, float ballSpeedLimit_, float ballSpeedInc_, float bounceCorrection_, bool classicBounce_, SpriteBatch sb, Texture2D texture) { this.fieldSize = fieldSize_; this.ballSize = ballSize_; this.ballSpeed = ballSpeed_; this.ballSpeedLimit = ballSpeedLimit_; this.ballSpeedInc = ballSpeedInc_; this.bounceCorrection = bounceCorrection_; this.classicBounce = classicBounce_; collision = false; ballStartPos = (fieldSize - ballSize) / 2; ball = new Rectangle(ballStartPos, ballStartPos, ballSize, ballSize); timer = new Timer(); spriteBatch = sb; spriteTexture = texture; }
public Powerup(SpriteBatch spriteBatch,Texture2D spriteTexture, GraphicsDevice graphicsDevice,int offset) { timer = new Timer(); disable = false; this.spriteTexture = spriteTexture; this.spriteBatch = spriteBatch; this.GraphicsDevice = graphicsDevice; aliveTimer = 0; Colortype = new Color[5]; Colortype[0] = Color.Red; Colortype[1] = Color.Green; Colortype[2] = Color.Blue; Colortype[3] = Color.Gold; Colortype[4] = Color.Purple; //test variables //powerupX = 400; //powerupY = 400; powerupType = 2; randomNumber = new Random(DateTime.Now.Millisecond+offset); }