Hi,
What do you say about making your code more object oriented?
Separating different entities into classes should do the trick, code will be easier to read and more open to new features:)
I would base your game on something more or less like:
class Ball{
Point Location;
Point Velocity;
Size BallSize;
}
class Barrier{
Point Location;
Size BarrierSize;
bool IsActive;
BarrrierType Type;
public virtual void HandleHit(){
}
}
class Board:Barrier{
public override void HandleHit(){
}
}
class World{
List<Barrier> Barriers;
Ball MyBall;
Board MyBoard;
public void Init(){
}
public void Tick(){
HandleCollisions();
MyBall.Location = MyBall.Location+MyBall.Velocity;
Draw();
}
private void HandleCollisions(){
foreach(Barrier b in Barriers){
if(b.IsActive){
if(){
b.HandleHit();
}
}
}
}
private void Draw(){
foreach(Barrier b in Barriers){
{
}
}
public void AddSomeBarier(){
Barriers.Add(new Barrier(location, size..));
}
}