As with our previous images, we use the draw() method to write our code for displaying our ground on the screen:
for(UpperBoundary ub : upperBoundary){ ub.draw(canvas);}for(LowerBoundary lb: lowerBoundary) { lb.draw(canvas);}
Even this part is taken care of for now. Now, we have to look at the collision part of our ground. We need to detect a collision on our ground with the player.