Develop an animated application

Assignment Help Computer Graphics
Reference no: EM13333349

In this assignment you will develop an animated application that uses linked lists as the basis of the implementation. This application builds on the application that you worked with for tutorial 3.

Go to Stream and download the files

caterpillar.py

my_catclass.py

Set up a new project in Eclipse and add these files to it.

caterpillar.py is a program that implements the beginnings of a simple graphical animation. When you run this program, you will see a screen, 1000 pixels wide by 400 pixels high, displaying a basic background scene with a 'caterpillar' anchored at random location. To begin with, the caterpillar just has a face, no body parts.

Similar to the application that you worked with in tutorial 3, on each iteration of the main program loop we check to see if the user wants to quit, or if he has pressed the spacebar, or one of the 'm', 'd' or 's' keys, each of which initiates a different response (full functionality is described later.) After that, we update the screen by redrawing the background scene and the caterpillar. The drawing methods for the background and the caterpillar have been provided for you.

The module my_catclass.py, which is imported into caterpillar.py, implements a linked list based implementation for a caterpillar object. The caterpillar class is expanded from the class used in the tutorial.

Now, a caterpillar consists of the following components:

  1. face_xcoord and face_ycoord - horizontal and vertical coordinates for the face. These coordinates are used by the draw_face(screen) method to give the location of the top left boundary of the graphic that represents the caterpillar's face.
  2. body - a reference to a segment_queue object. A segment_queue is a linked list of body_segment nodes that makes up the caterpillar's body. A segment_queue has head and last references, just like the Improved linked Queue class shown in lectures. A body_segment(x, y) object consists of x and y coordinates, giving the location of the top left boundary of the graphic representing the segment; and a reference to the next body_segment in the list.
  3. travel_direction - a string representing the current direction of travel for the caterpillar, either 'left' or 'right'.
  4. food - a reference to a food_list object. A food_list is a linked list of food_item nodes that makes up the caterpillar's food. A food_item(x, y, kind) object consists of a string representing the foodtype, either 'nice' or 'nasty'; x and y coordinates, giving the location of the top left boundary of the graphic representing the item; and a reference to the next fooditem in the list.

Reference no: EM13333349

Questions Cloud

Compute the ratio of income taxes to income earnings : Which is the largest expense for each company in the most recent year? What is its dollar amount? Is it logical that this would be the largest expense given the nature of each company's business? Explain your answer.
Determine what is the break-even quantity per unit : Shapland Inc. has fixed operating costs of $350,000 and variable costs of $60 per unit. If it sells the product for $70 per unit, what is the break-even quantity
Explain how reported accounting numbers might affect : Explain how reported accounting numbers might affect an individual's perceptions and actions. Cite two examples.
Develop an animated application : In this assignment you will develop an animated application that uses linked lists as the basis of the implementation. This application builds on the application that you worked with for tutorial 3.
What would be the total increase in the gdp : Given an increase in spending of $1,000, and a Marginal Propensity to Consume of 80% (8/1 0), what would be the total increase in the GDP (as a result of the Multiplier?) What would the Multiplier be? Show your work.
Determine what is the companys cost of equity capital : David Ortiz Motors has a target capital structure of 45% debt and 55% equity. The yield to maturity on the company's outstanding bonds is 9%, and the company's tax rate is 40%.
Divorce case knowledge that the wife is pregnant : Under our statue requiring that a petition disclose whether there are any children under ages of 16, making it obligatory upon the court to make such orders respecting custody and support as is best for the child or children, is an attorney guilty of..
Financial reporting environment for the quarter : Prepare a 2 page newsletter that identifies and summarises developments and changes in the financial reporting environment for the quarter from January to March 2013.

Reviews

Write a Review

Computer Graphics Questions & Answers

  Website template design

Recognize a few sites that appear to be designed using either a template or style sheet. What types of documents lend themselves easily to templates?

  Design portfolio that comprise design item and justification

Our goal for the campaign is to find a fun way to promote tap water as a healthier, cheaper and more environmentally friendly way to stay hydrated. We want tap water to become fashionable in the same way that bottled water companies have establish..

  Develop the image manipulations

Develop the image manipulations

  Develop a grayscale image consisting of grid

Develop a grayscale image consisting of an 8 x 8 grid with vertical line in the first column. Compress into JPEG format and decompress.

  Discuss website design basics

Juan arrived the end of his online course program. His family was so proud of him. Juan's wife wish to throw a party to celebrate Juan's online graduation together with all of his family, and started planning the special event.

  Modifying the product program through gui

Modify the product Program to use a GUI. The GUI should show the data one product at a time, including the product number, the name of the item, the number of units in stock.

  What conclusion can be drawn from these limitations

what conclusion can be drawn from these limitations regarding the future direction in computerarchitectures ?

  Make a list of eight shots in picture composition

What are the specific instructions that the director gives to the camera operator to perform each operation Make a list of eight shots in picture composition

  Discussion on internet development

In 1990s, the Internet offered primarily text based web-sites. At present the Internet is rich in multimedia sites that include audio and video.

  Essential elements of a design pattern

configuration of an Iterator pattern, patterns could be used in a Library System, Singleton, Template, Decorator, Façade,What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of natu..

  Differences in database design models

Make a poster or presentation, which graphically depicts differences between database design models.

  .what will happen if you connect p3.5 at the buzzer

Consider the following code segment. Assume that processor clock in the active mode is set to 1,000,000 Hz. In this mode the platform draws 0.5 mA.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd