Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C/C++ language and OpenGL, design a program to do the followings: 1. Create a window with a pathway, similar to the figure above. 2.

image text in transcribed

Using C/C++ language and OpenGL, design a program to do the followings: 1. Create a window with a pathway, similar to the figure above. 2. Let the user place a green prey at a location specified by a mouse click. The prey starts moving immediately in the pathway at a given speed in an infinite loop. 3. At any time, the user can create a red predator at a location specified by a mouse click as well. 4. Once a predator is created, it starts following the prey at a higher speed ( 2 times the speed of the prey). 5. When a predator is present, the prey is aware of it and will take the Escape to flee, if it gets there first. If the prey escapes, the predator gets a bit smalled in size and stops moving. Note that the predator cannot take the Escape route 6. Should the predator reach the prey, it will eat it, that is, the prey vanishes and the predator gets a bit bigger in size and stops moving

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago