首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做program、代写C++编程设计
项目预算:
开发周期:
发布时间:
要求地区:
Assignment3
Jump to bottom
nishithamadhu100 edited this page 3 weeks ago · 30 revisions
Air Hockey Project
Objectives:
In this project, you will be starting your 2-Player Air Hockey project. Checkout the game
description and onine Air Hockey game to get familiarised with the game.
You will be accomplishing the following items:
Get familiarized with the basic structure of the Game.
Process keyboard input from the user.
Add a player movement system.
Add a goal based scoring system.
Add an initial welcome screen, where you mention the scoring system and player controls.
Implement win-lose scenario.
Display the scores and the winner of the game.
Save the 10 best win scores in a file.
Setting up the goal area on the top and bottom boundary of the zone.
Game Over Screen
Increase the slider size from 4 to 7.
Different speed of ball in different levels.
Add obstacles for different levels.
Add color to the game.
Game levels
Easy : Ball speed - lowest, Obstacles - None
Medium : Ball speed - 20% increase from the Easy level, Obstacles - None
Hard : Ball speed - 20% increase from the Medium level, Obstacles - 2
neu-cpp /
Summer-2024
Code Issues Pull requests Projects Wiki Security InsightsPreliminary Steps
Updating your repository: You will need to pull the updates related to the Air Hockey
project from the course repository. You can do this using the following git command
sequence.
You should now have an air_hockey directory in your repository. Note sometimes your "main" is
called "master".
Create a assignment_3 branch: You will be creating a branch where you will be doing the
work for this phase of the project. The AIs will refer to this branch to do the grading. The
following are the steps for creating a branch. This involves creating the branch, checking it
out, and then pushing the branch to your github repo. You can get more information on
branching in the Pro Git branching chapter.
Don't forget that you have been working on the "master" or "main" branch so far. Think of each
branch as an independent version of the code. If you decide to go back to main branch, just use
checkout command. By the way, you could decide to merge branches together but that's not
what we will need for now.
This branch should only be for your work on this project. For other course assignments, please
remember to switch back to your main branch using the following command.
You can check which branch you're currently in using the this command.
File Descriptions
air_hockey.cpp: This file has the main infinite game loop. Before starting the game loop, all game
components are initialized. The game has a sleep of 200 milli-seconds.
git fetch
git pull upstream main
git branch assignment_3
git checkout assignment_3
git push origin assignment_3
git checkout main
git branchball.cpp: This file contains functions that check if the ball is colliding with the slider and the left &
right walls of the zone. You need to write a similar function which checks if the ball is colliding
with the goal area in order to determine the winner.
slider.cpp: This file contains functions that initialize, move, draw and undraw the slider.
zone.cpp: This file contains functions to intialize, draw and undraw the zone.
key.cpp: This file contains the functionality to read user input from the keyboard while the game
is being played. You have to update this file and add cases for 's' and 'S' to save the state of the
game to a file.
Overview:
In this project we are going to be building a 2-player Air Hockey game on Khoury Linux server. To
simplify the development of the game, we will be using the ncurses library rather than a pixel
based graphics library such as GTK. Ncurses is a character based graphics library that has been
used to develop command line utilities and tools such as editors.
ncurses documentation
To get your project started, you have been provided with a template in the air_hockey folder.
Below is a summary of the files that have been provided with the project.
Makefile: This file is used to build the executable air_hockey. The following is an example of
how to build air_hockey.
To remove the build files, you can do a "make clean". This will remove the executable and the
associate object files (*.o). This is useful prior to committing files to the repository because you
typically do not want to include generated files in the repo.
$ make
g++ -c -o main.o main.cpp -I../include -g -O0
g++ -c -o slider.o slider.cpp -I../include -g -O0
g++ -c -o air_hockey.o air_hockey.cpp -I../include -g -O0
g++ -c -o zone.o zone.cpp -I../include -g -O0
g++ -c -o ball.o ball.cpp -I../include -g -O0
g++ -c -o key.o key.cpp -I../include -g -O0
g++ -o air_hockey main.o slider.o air_hockey.o zone.o ball.o key.o -I../include -g -O0 -ln
$
$ make clean
make clean
rm -f *~ core /*~
rm -f air-hockeyBuilding the Game
The game should be built following the below logical progression. You will start working on
smaller tasks that we call: 'get-to-know-the-code-base' before making bigger changes to the
codebase. Note: You do not need to submit different parts separately; please provide a single,
complete submission.
Part 1:
You should implement the code necessary to implement the following functionality.
Welcome screen
This is the starting screen in your game, on pressing t should start the game. On this screen,
you have to provide an overview of the scoring system.
Moving the Players
Currently the slider (player) cannot move from the starting position, so you need to add player
controls.
The slider (player) should be able to move left, right, up and down.
The arrow-keys should be used for moving the bottom slider around the zone in left, right,
up and down directions.
w,W, a/A, s/S and d/D keys should be used for moving the top slider around the zone in left,
right, up and down directions.
The slider may not cross the center line when striking the puck.
The slider may only strike the puck when it is on its side of the centerline.
The provided filename {key.cpp} file helps detect key presses.
Pausing the Game
The game is paused when P/p is pressed and resumes on another press.
Ending the Game
The game will end naturally when the time limit is reached (fixed to 2 minutes).
Additionally, the game can be ended prematurely by pressing q or Q. In either case, the
game should terminate gracefully without causing a segmentation fault.
rm -f *.o
$Increase the slider size from 4 configurable up to 7.
Till Part 2, you see that the size of the slider is 4, now increase it upto 7.
Prompt the user to input the size before the game starts.
Scoring the Game
Since it is a 2-player game only two mallets need to be placed on the AirHockey playing
surface.
The puck needs to be struck with the mallet and the puck must fully drop in the goal area to
be counted as a goal. Rebounds or pucks that get stuck halfway in do not count as a point.
Keep track of how much goals the users score.
Print out a running score total at the top of the screen.
Game Over Screen:
The game over screen should be visible after the end of the game. *It should display
information such as points scored by both the players, winner and time taken to win.
Part 2:
You should implement the code necessary to implement the following functionality.
Implement win-lose scenario:
The game will consist of N rounds played in each level. The user should be able to enter the
number of games N on the welcome screen.
A player wins a set if they win the majority of the games in that set.
The overall winner of the game will be the player who wins the majority of the levels
Save 10 best win scores:
*The information about 10 best scores should be stored in a file. Save them in
./saves/save_best_10.game Extensions don't matter in Unix, you'll be able to open the file at any
time in an editor.
Set up the goal area:
By default, the goal area is the entire top and bottom edge of the zone.
If the player controlling the top slider is not able to defend the ball and it hits the top goal
area, then the opposite player scores a goal and vice-versa.
In this step, you need to take the width of the goal area as an input from the user before the
start of the game. The width of the goal area should be less than the width of the zone. Pages 5
Different difficulty levels - Obstacles and Speeds
The game starts with a ball that runs at a default low speed.
As the player progresses through the levels, the speed of the ball should increase and
obstacles should be added according to the Game levels description above.
The obstacles can be placed at fixed positions or randomly within the game zone, but they
must not be placed on the walls.
Coloring the game
Add color to the game to make it more visually appealing. Use the ncurses library to
implement colors. Refer to the relevant section of the ncurses documentation for details on
how to use colors.
What to turn in.
Check your game into your assignment_3 branch. The TAs will checkout this branch, make
the code, and then run it to grade your work.
Submit the link to the branch/commit similar to what you have done for other assignments.
Scoring (worth 135 points)
5 pts: Welcome screen (with Instructions to run)
10 pts: Move the first player with the arrow keys.
10 pts: Move the second player with the control keys.
15 pts: Keep track of the player's score.
10 pts: Speed of the ball with different difficulties levels.
3 pts: Press P/p to pause the game, must resume on another press
2 pts: Press Q/q at any time to quit the game.
5 pts: Set up the goal area
10 pts: Implement win-lose scenario.
15 pts: Save 10 best win scores.
5 pts: Game Over Screen.
5 pts Slider size change
20 pts Color the game
20 pts Add Obstructions in the game
Note: If your code does not compile and run on khoury server, your grade will start at 50%.
Please build and test in this environment.Find a page…
Home
Assignment3
Air Hockey Project
Objectives:
Game levels
Preliminary Steps
File Descriptions
Overview:
Building the Game
Part 1:
Welcome screen
Moving the Players
Pausing the Game
Ending the Game
Increase the slider size from 4 configurable up to 7.
Scoring the Game
Game Over Screen:
Part 2:
Implement win-lose scenario:
Save 10 best win scores:
Set up the goal area:
Different difficulty levels - Obstacles and Speeds
Coloring the game
What to turn in.
Scoring (worth 135 points)
Github Setup Instructions
GNU Debugging
Introduction to Linux and Coding with Makefile
Clone this wiki locally
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!