When should events be used instead of loops

Assignment Help Basic Computer Science
Reference no: EM131111357

In Exercise 9, why is it better to use an event instead of a loop to make the pterodactyl continue flying while the world is running?

In general, when should events be used instead of loops in computer programming?

Exercise 9

The Animals object gallery contains a pterodactyl. The student data files for this book have a world named flapping pterodactyl with a character-level method named flap that will cause the pterodactyl to flap its wings. Do each of the following:

a. Create a method called pterodactyl fly that will make the pterodactyl move forward while flapping its wings, and then create a loop in world.my first method to make the pterodactyl fly away.

b. Add controls to your pterodactyl world so that the user can steer the pterodactyl.

c. Add a user control to point the camera at the pterodactyl when the spacebar is pressed.

d. Modify the world to use an event instead of a loop to make the pterodactyl fly while the world is running. You might need to refer back to Chapter 3, which covers events.

Reference no: EM131111357

Questions Cloud

The scattergrams of part a to evaluate the performance : The Minnesota Department of Transportation installed a state-of-the-art weigh-in-motion scale in the concrete surface of the eastbound lanes of Interstate 494 in Bloomington, Minnesota.
Create an alice world with a character of your choice : Create an Alice world with a character of your choice that will ask the user for a number, cause the character to jump up, use a loop to spin around the number of times specified, and then come back down. Think about how variables will be used as ..
How does the type of carbohydrate impact health : What is meant by the AMDR, and what is this range for carbohydrates? How does the type of carbohydrate impact health? What is one negative health impact from carbohydrate intake?
Interpretation of the triple constraints : First, review the "triple constraints" of IT Project Management as covered in this week's reading "What is Project Management?" Note that there are more than 3 constraints discussed in the article. The illustration above from the article shows the..
When should events be used instead of loops : In general, when should events be used instead of loops in computer programming?
Find the equation of the least squares line : A large proportion of US. teenagers work while attending high school. These heavy workloads often result in underachievement in the classroom and lower grades.
Describe an alice event of the bde format : Describe an Alice event of the BDE format that will make a ballerina jump up when a key is pressed, spin around for as long as the key is held down, and return to the ground when the user lets go of the key.
Quality of the software that we produce : How do we ensure the quality of the software that we produce? How do we successfully institute new software technologies?
Write a one-page report on homer and the iliad : Write a one-page report on Homer and the Iliad. Be sure to include a synopsis of the literary piece.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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