Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

Using C language and OpenGL, design a program to do the followings:

1. Create a window with a pathway, similar to the above figure.

2. Let the user place a green prey at a location specified by a mouse click. The prey starts moving immmediately 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 scape route

6. Should the predator reache the prey, it will eat it, that is, the prey vanishes and the predator gets a bit bigger in size and stops moving.

Using language and OpenGL, design a program to do the followings 1. Create a window with a puthway, similar to the above figure 2. Let the user place a green prey at a location specified by a mouse click. The prey starts moving immediacy in the pathway a given speed in an inte koop 3. At any time, the ser can create and predator at a location specified by a m e dick 4. Once a predator incidit following the pryw a higher speed times the pend the prey S. When a predator is preses, the prey is ware of it and will take the Escape fleei it gets there fit. If the prey escapes, the predator gets a bit smalled in size and stops moving Note that the predator cannot take the caper 6. Should the predator e the prey, it will eat that is the prey vanishes and the predator gets a bit bigger in size and opening In C language Using language and OpenGL, design a program to do the followings 1. Create a window with a puthway, similar to the above figure 2. Let the user place a green prey at a location specified by a mouse click. The prey starts moving immediacy in the pathway a given speed in an inte koop 3. At any time, the ser can create and predator at a location specified by a m e dick 4. Once a predator incidit following the pryw a higher speed times the pend the prey S. When a predator is preses, the prey is ware of it and will take the Escape fleei it gets there fit. If the prey escapes, the predator gets a bit smalled in size and stops moving Note that the predator cannot take the caper 6. Should the predator e the prey, it will eat that is the prey vanishes and the predator gets a bit bigger in size and opening In C language

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_2

Step: 3

blur-text-image_3

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions