So I'm making a breakout game for a school project, and I have made a brick that changes its color according to the value of the lives variable. If it's 4 the color is green, if its 3 yellow, 2 orange and 1 red. When the variable reaches a value of 0 the brick will be destroyed and removed from the game. Now I'm trying to add some bricks to the world with different starting values for the variable lives, so that some already spawn with the orange or yellow color. The problem is that I don't know how to do that. Can someone help me or show me some code of how to do it? This is what I have tried so far:
It gives the error: cannot find symbol - variable lives
addObject(new Brick(lives = 100),300,3);
