This project is intended for use in an introductory course on Java. At the end of the course, students should be able to add attributes to classes and implement simple methods. By extending an already existing project instead of writing simple classes completely on their own, the final program should - hopefully - give them a sense of accomplishment in a playful manner.
The project contains a full implementation with those parts that students should add or modify, marked and commented out like:
// TODO >>>
// return somethingWeWillImplement();
// TODO <<<
To see how things are meant to work in the full version of the game, you can use these bits of code. But be sure to remove them completely before handing over the code to the students. The remaining parts still constitute an executable application with only some functionality missing.
Additionally, you might "destroy" some parts, adding syntax errors, to request students to correct errors in a first step (see below).
The intended exercises are as follows:
- Setup the project in the IDE. Correct all syntax errors and run the program.
- Implement the method
allTimedOut
in the classLevelTargets
to check if all targets have come to the end of their animation. - Implement the method
scoredAtLeastOnce
in the classLevelTargets
to check if at least one target has been scored. - Implement the method
qualifiedForNextLevel
in the classLevelTargets
to check if at least one object that is not dangerous has been scored and all targets have come to the end of their animation. (i.e. allowing to proceed to the next level) - Implement the method
passivityKills
in the classLevelTargets
to check if no target has been scored and all targets have come to the end of their animation. (i.e. the level is finished without any successful user action) - Implement the method
allFriendliesScored
in the classLevelTargets
to check if all targets that are not dangerous have been scored. - Implement the method
advanceAheadOfTime
in the classLevelTargets
to check if the level is finished by having scored all targets, that are not dangerous. - Extend the class
Level
to provide a bonus. The bonus should be five points on the first level and increase by five for each level. - Add logic to add the bonus in case the user advances to the next level by scoring all
relevant objects before all objects have come to the end of their animation. (i.e. in case
of
advanceAheadOfTime
)
The exercise to implement LevelTargets.advanceAheadOfTime()
should foster discussion about code duplication
(if implemented separately), naming methods, wrapping logic, abstractions,... (if calling allFriendliesScored
)
The several places where negation is used to work on objects that are not dangerous should foster
discussion about maybe introducing a new method to the abstract class Target
.
If you prefer to have a different story for your game, just change it:
- In
dictionary.properties
you can change screen labels and the storytelling. - Change
/resources/images/background.jpg
to whatever background image you like. - Drop the images for your preferred objects to click (or avoid) in the folders
/resources/images/objects/friendly/
or/resources/images/objects/dangerous/
respectively. Name the image filesimage_N.png
, whereN
are consecutive numbers starting from 1 for each type - You may change the styles in
/resources/css/zombie.css
- You may use a different font, dropped in at
/resources/fonts/
- Changes to fonts or renaming the css file have to be reflected in
Zombieland.initFonts()
andZombieland.createAndSetupScene()
A note on images: Although it should speak for itself, images with a transparent background are highly recommended.
Some ideas:
- Sports theme
Sports motif as a background and different types of balls as objects. (baseballs, basketballs, tennisballs, golfballs...) Could for example be categorized in typical European sports and typical American sports. - Nutritional theme
Different foods, might be categorized in healthy and unhealthy. (actually the opposite of the original, politically incorrect story) - French Revolution theme
Different portraits of people. The morbid way: Click those who lost their head. The more friendly way: Click those who played a role in the French Revolution. Adding portraits of George Washington, Elvis Presley, Albert Einstein,... as portraits that are meant not to be clicked.