Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic AI Implementation w/o a functional UI #105

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 2 additions & 3 deletions W18_proj00.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Samuel Fu, Xingxing Geng
- Samuel Fu (GitHubID:`iamSamuelFu`)
- Xingxing Geng (GitHubID:`xingxinggeng`)
- Xingxing Geng (GitHubID:'`xingxinggeng`)

## A)
This project builds up a game simulating table tennis, which can have most up to 2 players playing at the same time on the same computer.
Expand Down Expand Up @@ -29,8 +29,7 @@ The build.xml is a little bit messy in formatting but runnable. Some targets nee
The "issues" listed pointed out many possibilities this game could turn into. All the bugs and improvements in "issues" are explained in details respectively. There are definitely enough questions for us to earn 1000 points, though some of the issues are minor.

## H)
* Hit star to gain life :https://github.com/ucsb-cs56-projects/cs56-games-pong/issues/100
* Adjust the size of the main screen :https://github.com/ucsb-cs56-projects/cs56-games-pong/issues/101
Hit star to gain life :https://github.com/ucsb-cs56-projects/cs56-games-pong/issues/100

## I)
The code overall is formatted well, and the purposes of class and methods of are clear. The variable names are mostly self-documenting. However, there are more comments than it actually needs. It makes the code easier to read within their own class, but some comments only explained what the code does, instead of why we use this code. Therefore, it is difficult to see the relationship between classes without the class diagram. I would tell whoever is going to work on the code that each object in this game (such as "paddle," "pong," and "game") was coded in seperate file under the same directory. Each file implements what each object does. It will be easier to understand the code by figuring out what object the method belongs to.
Expand Down
43 changes: 43 additions & 0 deletions docs/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Feb 15 18:41:46 PST 2018 -->
<title>All Classes</title>
<meta name="date" content="2018-02-15">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Ball.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">Ball</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/BallTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests" target="classFrame">BallTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/ColorPrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">ColorPrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/CustomModePrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">CustomModePrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/DifficultyLevel.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">DifficultyLevel</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/DifficultyLevelPrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">DifficultyLevelPrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/highscore/DisplayHighScores.html" title="class in edu.ucsb.cs56.projects.games.pong.highscore" target="classFrame">DisplayHighScores</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/EndOfGame.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">EndOfGame</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/Game.html" title="class in edu.ucsb.cs56.projects.games.pong" target="classFrame">Game</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/GameOver.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">GameOver</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/highscore/HighScore.html" title="class in edu.ucsb.cs56.projects.games.pong.highscore" target="classFrame">HighScore</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/HighScoreTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">HighScoreTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/instructions/Instructions.html" title="class in edu.ucsb.cs56.projects.games.pong.menu.instructions" target="classFrame">Instructions</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/InstructionsTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">InstructionsTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">MainMenuComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuUI.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">MainMenuUI</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MenuPaddingComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">MenuPaddingComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MenuTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">MenuTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Paddle.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">Paddle</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/PaddleTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests" target="classFrame">PaddleTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/PlayTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu" target="classFrame">PlayTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Pong.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">Pong</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/PongTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests" target="classFrame">PongTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Screen.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay" target="classFrame">Screen</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/sound/SoundEffect.html" title="class in edu.ucsb.cs56.projects.games.pong.sound" target="classFrame">SoundEffect</a></li>
</ul>
</div>
</body>
</html>
43 changes: 43 additions & 0 deletions docs/allclasses-noframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Feb 15 18:41:46 PST 2018 -->
<title>All Classes</title>
<meta name="date" content="2018-02-15">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Ball.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">Ball</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/BallTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests">BallTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/ColorPrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">ColorPrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/CustomModePrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">CustomModePrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/DifficultyLevel.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">DifficultyLevel</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/DifficultyLevelPrompt.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">DifficultyLevelPrompt</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/highscore/DisplayHighScores.html" title="class in edu.ucsb.cs56.projects.games.pong.highscore">DisplayHighScores</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/EndOfGame.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">EndOfGame</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/Game.html" title="class in edu.ucsb.cs56.projects.games.pong">Game</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/GameOver.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">GameOver</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/highscore/HighScore.html" title="class in edu.ucsb.cs56.projects.games.pong.highscore">HighScore</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/HighScoreTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">HighScoreTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/instructions/Instructions.html" title="class in edu.ucsb.cs56.projects.games.pong.menu.instructions">Instructions</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/InstructionsTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">InstructionsTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">MainMenuComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuUI.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">MainMenuUI</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MenuPaddingComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">MenuPaddingComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/MenuTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">MenuTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Paddle.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">Paddle</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/PaddleTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests">PaddleTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/menu/PlayTextComponent.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">PlayTextComponent</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Pong.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">Pong</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/tests/PongTest.html" title="class in edu.ucsb.cs56.projects.games.pong.tests">PongTest</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/gameplay/Screen.html" title="class in edu.ucsb.cs56.projects.games.pong.gameplay">Screen</a></li>
<li><a href="edu/ucsb/cs56/projects/games/pong/sound/SoundEffect.html" title="class in edu.ucsb.cs56.projects.games.pong.sound">SoundEffect</a></li>
</ul>
</div>
</body>
</html>
160 changes: 160 additions & 0 deletions docs/constant-values.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Feb 15 18:41:46 PST 2018 -->
<title>Constant Field Values</title>
<meta name="date" content="2018-02-15">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#edu.ucsb">edu.ucsb.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="edu.ucsb">
<!-- -->
</a>
<h2 title="edu.ucsb">edu.ucsb.*</h2>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>edu.ucsb.cs56.projects.games.pong.menu.<a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuUI.html" title="class in edu.ucsb.cs56.projects.games.pong.menu">MainMenuUI</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="edu.ucsb.cs56.projects.games.pong.menu.MainMenuUI.HEIGHT">
<!-- -->
</a><code>protected&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuUI.html#HEIGHT">HEIGHT</a></code></td>
<td class="colLast"><code>480</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="edu.ucsb.cs56.projects.games.pong.menu.MainMenuUI.WIDTH">
<!-- -->
</a><code>protected&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="edu/ucsb/cs56/projects/games/pong/menu/MainMenuUI.html#WIDTH">WIDTH</a></code></td>
<td class="colLast"><code>640</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
124 changes: 124 additions & 0 deletions docs/deprecated-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Feb 15 18:41:46 PST 2018 -->
<title>Deprecated List</title>
<meta name="date" content="2018-02-15">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Deprecated List";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li class="navBarCell1Rev">Deprecated</li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Deprecated API" class="title">Deprecated API</h1>
<h2 title="Contents">Contents</h2>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li class="navBarCell1Rev">Deprecated</li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
Loading