due Friday, March 14, 11:59pm
In this assignment you will complete your world project for this quarter by adding support for clock-based movement and interactions between the entities in your world.
In general, this assignment focuses on:
clock-based movement
clock-based animation
entity transformation
obstacles to movement
response animation to an entity's actions
More details and requirements are given below.
High-level requirements are given below. With your submission,
include a README
file that clearly outlines the movement
algorithm, transformation, and animation (e.g., when they occur) for
each part.
This assignment also assumes that the world "begins" when the program begins. As such, your program should immediately load the saved world (created using the previous assignment) and begin the world interactions.
Your world must
contain at least one entity that moves (generally the gatherer).
control movement using the timer (clock) to restrict the rate of movement.
prevent movement through obstacles.
implement a (simple) means to try to avoid obstacles.
Movement must now be clock-based. This will allow you to control the rate at which an entity is able to move. For instance, an entity may be set to move at a rate of one tile every 0.5 seconds. You will likely want to vary the rate for each entity to avoid lockstep motion.
Movement through an obstacle (added in the previous assignment) must be prevented. You will also likely want to prevent movement through or over other entities (expect, perhaps, when gathering). Instead of moving through an obstacle, your entity should try to move around. For this assignment, you are only required to make a simple attempt to move around an obstacle. For example, when your normal movement algorithm would require moving over an obstacle, your program might attempt to move the entity one tile to the right instead.
Your world must support the transformation of one entity into another
entity. This may be a transformation into a new type of entity for
this assignment or into an existing type of entity (from previous
assignments). For instance, an Adventurer
may transform
into a Statue
when within four tiles of a Gorgon
.
Your world must
contain at least one entity with animation.
display at least two types of animation in response to an entity's actions. One animation must be for the required transformation and the other is up to you.
Bring your world to life by adding animation to your entities. Not every entity must be animated (it may not make sense for all of them), but at least one must be animated. All animation should be controlled by the timer (clock) to restrict the rate.
In addition to animating an entity, your world will need to include at least two animations in response to an entity's actions. The first animation must be in response to the transformation of one entity into another. The second animation is up to you (e.g., it may happen when an gatherer collects a resource).
Animation can be implemented by cycling through different images (sprites) for your entity or response.
You must submit your solution on unix11.csc.calpoly.edu (or on unix12, unix13, or unix14) by 11:59pm on the due date.
You will submit to the akeen user. Submit all files needed to run your program including all code files, all sprite image files, your README file, and one gaia.sav file.
At the prompt, type handin akeen x101hw5 *.py README gaia.sav and also submit all of your sprite image files (in bmp format).
Note that you can resubmit your files as often as you'd like prior to the deadline. Each subsequent submission will replace files of the same name.
The grading breakdown for this assignment is as follows.
Clean Execution: 10% — Program executes without run-time errors (and the submitted source demonstrates a legitimate attempt at a solution).
Functionality (clock-based movement): 20% — Entity movement is controlled by timer.
Functionality (obstacle and movement): 20% — Entity movement prevented by obstacles.
Functionality (transformation): 10% — An entity can undergo a transformation.
Functionality (entity animation): 20% — An entity's sprites are "animated".
Functionality (response animation): 20% — At least two entity actions are animated (transformation plus one).