Flipflapsthe project is to design and write a c 11fltk game

Assignment Help C/C++ Programming
Reference no: EM13371678

"FlipFlaps"

The project is to design and write a C++ 11/FLTK game program with a graphical user interface.The game is based on "pancake sorting,", which actually has some mathematical significance.

The heart of the game is a centered stack of pancakes, each one a different size. The goal is to get the stack into order (from smallest on top to largest on bottom) by flipping over the top partial stack of some number of pancakes. See the Wikipedia article for an example flipping the top three pancakes. Since we're flipping flapjacks, the game is named "FlipFlaps".

The program must:

1. Start with an attractive splash screen showing (at least) the name of the game ("FlipFlaps"), the team number, and the team members' names. Feel free to add team members' pictures, animations, etc.

2. Explain how to play the game.

3. Ask for the player's initials and display the top 5 scores read in from the disk followed by the player's initials. The top scores file starts out empty.

4. Ask for a difficulty level from 2 to 9; this is the number of pancakes. Each pancake is a different size. Display the pancakes in a centered stack in a random order. 

5. Allow the player to select where to insert the spatula; you may decide to have a button beside each possible spatula position, or choose some other way to indicate where to flip. When the player clicks the "Flip!" button, flip over the partial stack above the spatula and redraw the screen.

6. If the pancake stack is now in order, from smallest on top to largest on the bottom, calculate the player's score (see "Scoring" below) and display it next to the player's initials. Sort the list of 6 scores and write the top 5 out to disk with initials. Then the next time the game is played that file will be read in and displayed in step 3 above. Note: The game is also over if the player makes too many flips (see "Scoring" below).Ask the player if they want to play another game or quit.

Scoring: The instructors will provide a function named find_solution which calculates the minimum number of flips needed for a particular stack of pancakes. The score for one game is 100 minus 10 times the number of unnecessary flips more than the minimum, multiplied by the difficulty level.For example, if a particular stack of 6 pancakes could be flipped into order with 5 flips (according to the find_solution function), but the player takes 7 flips, then the score is [100 - 10 * (7 - 5)] * 6 = 480. The score for a game cannot go below zero, so in this case the game ends after 15 flips even if the pancakes are still not in order.

Display "Can be done in xx flips" (use the information from find_solution). Also display a running count of how many flips so far, and the player's score so far.

Timer to end the game when time is up. Allow 10 times the number of pancakes, e.g., 7 pancakes gives 70 seconds. Display a digital clock with the time remaining. Hint: Check the online FLTK documentation for Fl::add_timeout.

Animation, e.g., on the splash screen or to show the pancakes moving as they are being flipped over. Hint: Check the FLTK online documentation for "double-buffered window" to reduce flashing.

This is a team project, with approximately three students on a team. The instructor will assign the teams. (Note: If there are any problems with your team assignment, please talk to your TA promptly.) 

Divide up the code, with each student on a team of 3 doing two of the six items on page 1. If you have a team of 4, the fourth person must do one of the harder "Extra Items" on page 2 for the team to get a maximum grade of 100.

A team of 3 will receive 5 points extra credit for doing one "Extra Item" or 10 points for doing two. A team of 4 will receive 5 points extra credit for doing a second "Extra Item" or 10 points for doing all three "Extra Items."

You must use at least two C++11 features, such as auto and range-based for. You must write at least two classes of your own, with separate header and implementation files. Follow good style, and limit each function to no more than 24 lines (one terminal window). Each team member is expected to have a rough idea of how all the code works, and should be able to explain in detail how their own part of the code works.

Be creative in deciding how to meet these specifications in an attractive and user-friendly way, but get the basic functionality working before you try to make it too fancy, or you may run out of time!

All user input and output must be through the GUI, not the console window. However, you may use the console window for printing debugging messages for the developers (your team).

Your program should compile and runwithout change on the Visual C++ environment in the lab or linux2.cse.tamu.edu with X windows.

Your program must be submitted bothto CSNET and also on a CD formatted for Windows. The project report (described below) should be submitted on paper to your TA,along with your CD. You only need to submit one report and CD and CSNET file per team. Write a report according to the outline below. All team members will receive the same project grade, unless some team member does not do his/her part.

Download:- Pancake_Game.zip

Reference no: EM13371678

Questions Cloud

John has his wealth of euro1000 invested in ripoffcom : john has his wealth of euro1000 invested in ripoff.com shares. there is a 50 chance that the share market crashes and
What is the effect of overstocking and under stocking in : what is the effect of overstocking and under stocking in an
Industry paper as a partial requirement for this course you : industry paper as a partial requirement for this course you will have to submit a paper on an industry of your
Question 1 capital expenditure decisions and investment : question 1 capital expenditure decisions and investment criteriain recent years morten ltd a company that manufactures
Flipflapsthe project is to design and write a c 11fltk game : flipflapsthe project is to design and write a c 11fltk game program with a graphical user interface.the game is based
How did people in the north use natural resources : how did people in the north use natural resources differently than people in the south? briefly
A sample of size 200 from population 1 has 50 successes a : a sample of size 200 from population 1 has 50 successes. a sample of size 200 from population 2 has 40 successes. what
How to write code for any particle shape using kk-3 system : how to write code for any particle shape using kk-3 system coding in grope
1 express the following operatorsj j2 j3 a a2 a3 -a2 -a in : 1. express the following operatorsj j2 j3 a a2 a3 -a2 -a in rectangular form and sketch the operators in the complex

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write some code that puts a zero in every element of q

Given a two-dimensional array of integers named q, with 2 rows and 4 columns, write some code that puts a zero in every element of q. Declare any variables needed to help you.

  Wave steepness is the ratio of wave height

Wave steepness is the ratio of wave height (WH) to wave length(WL) and is an indicator of wave stability. When wave steepness exceeds a 1/7 ratio; the wave becomes unstable and begins to break. Assume a data file exits with the following header

  Consider implementing subnetting to support three department

Consider implementing subnetting to support three departments within an organization. The three departments P, Q and R need support for 30, 40 and 60 hosts.

  Write a program that converts each name

You are given a file consisting of students? names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastNam..

  Write a for loop that adds the integers

Assume the int variables i , lo , hi , and result have been declared and that lo and hi have been initialized. Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result .

  Your program should include two functions

Your program should include two functions. Function celsius_at_depth should compute and return the Celsius temperature at a depth given in kilometers. Function fahrenheit should convert a Celsius temperature to Fahrenheit.

  Write c program to read one ip address

Write a C or C++ program which Read one IP address at a time from Dec_IPAddresses.txt and convert it into Hex. Store converted values stored in another file (e.g. HEX_IPAddresses.txt).

  Reduce the numerator and denominator

Write the function  in C ++ to reduce the numerator and denominator in the Rat class to lowest terms.

  Design, write, and test a program

Design, write, and test a program that represents some of the aspects of a student

  Create a calling module name and parameters

Create a calling module name and parameters for the following. (Remember that the asterisk before the parameter name indicates a call-by-reference parameter.

  Create a global array of structures

Create a global array of structures with the following data. Each structure should store the data (Employee Table - Name, age, salary information) . Array size must be at least 10

  Write a computer program to prepare a linear support vector

write a computer program to prepare a linear support vector machine svm. prepare a report and deliver the report

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