Last modified: March 28, 2023
In this lab, you will add bars to your Lode Runner world. Bars are like horizontal ladders.
You will also modularize your world into a level so that later on, you can create more levels for your game.
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.
Create a level made of platforms, ladders and bars. It should use helper methods and loops to lay out platforms, ladders and bars.
Use a grid with width equal to wall width and height equal to ladder height.
All the ladders and walls should be located at the center of grid positions.
All bars should be located at the top of grid positions.
The player should be able to travel all over the map.
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