Last modified: March 19, 2025
In this lab, you will add bars to your Lode Runner world. Bars are like horizontal ladders.
You can download a demo of this lab here.
Start with the level you had from HW 2.
Create a Bar class; give it the appropriate image and size.
Then, in MyWorld, add some code that draws rows of bars. The bars should be at the top edge of a grid position, where the grid is the height of a ladder and the width of a wall.
Add code in your player class that makes your player go across bars with the left and right arrow keys.
The player should:
Hints:
Making the player snap to the bar when touching the bar is fairly simple, but also this doesn't look as good as if the top of the player has to touch the bar.
You can improve it by checking where the bar is located in relation to the player to confirm it is near the top of the player before snapping in place. Give it a bit of wiggle room for best effect.
Zip your entire project folder and submit it below.
PX_LastName_FirstName_LodeRunner
.PX_LastName_FirstName_LodeRunner.zip
. For example if you were in 3rd period and named Michael Wang, then you would name the file P3_Wang_Michael_LodeRunner.zip
You must Sign In to submit to this assignment
Dark Mode
Outline