EE308_lab4

Fantastic_box 2021-10-09 23:43:28
The Link Your Classhttps://bbs.csdn.net/forums/MUEE308FZ
The Link of Requirement of This Assignmenthttps://bbs.csdn.net/topics/601188617
The Aim of This AssignmentDevelop a Bobing software
MU STU ID and FZU STU ID<19105860_831902226>
MU STU ID and FZU STU ID of my partner<19103557_831902230>

------------------------------------------------------

Main tool:eclipse

https://weibo.com/tv/show/1034:4690545776459871?from=old_pc_videoshow

https://github.com/ArrXiao/EE308_LAB4

------------------------------------------------------

I.PSP Form

Personal Software Process StageEstimated Time (minutes)Actual Time (minutes)
· Estimate60120
· Analysis3090
· Design Review2010
· Coding Standard3030
· Design60120
· Coding12001800
· Code Review3060
· Test3060
· Postmortem&Process Improvement6030
· Test Report12060
Total16402280

------------------------------------------------------

II.Learning Progress Bar

Number of daysNew code(line)Cumulative code (line)Learning time of the day (hours)Accumulated learning time (hours)Important growth
1001010120
2001020120
32272271030120
4179495838120
5388883644120
61521035347120
73060148120

------------------------------------------------------

III.Description of Problem-Solving Ideas(the key or difficult functions and programming thinking)

We chose JAVA as the programming language of the lab, and we learned about JAVA design pages and games in the first two days of the project
We first divided the experiment into five modules

  1. Preliminary realization of page skipping.
  2. Add images and buttons to the page.
  3. Code the logic of the game.
  4. Integrate the page code with the game code.
  5. Test and adjust the code.

1 and 2 are the most critical in the entire programming process. The jump to the page determines whether the game works properly, and the insertion of images and buttons determines the flow of the game. For aesthetic reasons, we chose not to use the original buttons of the Java window, but to use small images as buttons. For the basic image background and button image, we continue to use the texture used in ink Knives for UI.

For 3, We wrote a Player class that solves this problem. In this class, We implemented its constructor and several GET functions from last semester. When a button on the page is triggered, the relevant program will run, and this program will call this class, so that each player will randomly generate dice results and get awards and corresponding points through the function call. There is also an array to keep track of each player's results and rank them by sort at the end.

For 4, This module is really relatively simple, my teammates and I had a plan for some docking of the two at the beginning of the project.

For 5, Although this step seemed simple, it took me and my teammates a lot of time to coordinate the code.

------------------------------------------------------

IV.Design and Implementation Process

The backbone of the whole code is to realize the page jump through the button, and then provide the game results through random numbers. Click "开始游戏" on the first home screen and you will be redirected to the selection screen. On this page, players can view the rules or select single or multiplayer games. Each page has a back key.
In single player games, the process of shaking the dice is shown by switching between images, but the game results are already generated by clicking "开ROLL" on the previous page, and then the game results are displayed.
Multiplayer games are derived from single-player games. In simple terms, the single player game is repeated, and records of multiple multiplayer games are saved and ranked at the end.

img

------------------------------------------------------

V.Code Description and Test

The first is the mainInterface.java file, which is the first page to enter the game.

Click "开始游戏" on the previous page to open the window programmed by the next file named select.java.

Then, clicking on "规则介绍" takes you to the window programmed by the rule-java file.

Then, clicking on "单人游戏" takes you to the window programmed by the rule-java file.

After clicking "开ROLL", After clicking "STOP", the game progress page will appear

After clicking "STOP", the results of the game will be displayed

img

On the other hand, if ”多人游戏“ is selected, a different page is taken to.

Finally, by clicking on "ROLL", each player can get their own results, which can be played by up to six people.

img

------------------------------------------------------

VI.Pair Programming Experience and Summary

In this lab, my teammate and I have obtained:
1.Review basic knowledge of JAVA.
2.More familiar with the cooperation with teammates
3.The way of thinking about more complex situations and the way of thinking about solving problems.
4.How to use programming language to implement applications
5.Experience the life of a programmer

· During the experiment, my teammates and I had different opinions on the programming direction of the application. I personally preferred to develop wechat mini program, while my teammates hoped to design the application through JAVA programming. Finally, after intense discussion and physical contact, we decided to use his plan. The main reason is also to consider the review of Java programming and the target tendency of this experiment.

· On the other hand, my teammates and I spent a lot of time learning how to code Windows and game logic in JAVA, even though we had a good JAVA background. We're kind of clueless in this regard. So in the first few days of the project, both of us started studying almost as soon as we got up. In a way, both of us have greatly strengthened our ability to study independently and master JAVA.

· In the end, when my team and I put our code together for a final test, we ran into a big test. The lack of communication during the writing of the code resulted in many connection problems when the code was finally integrated. Some variables are not generic, and some functions cannot call wait. So we spent half a day modifying the integration code. This experience, while exhausting, is yet another reminder of the importance of writing detailed comments.

------------------------------------------------------

VII.Photo of Pair Working

img

------------------------------------------------------

VIII.Appendix:Code Specification

  • Indentation: For indentation, In addition to the auto-indent processing code within DEV, I also corrected it manually.

  • Variable naming: In terms of variable names, We mostly use plain English abbreviations and _ to make it easier for others to read the code.

  • Maximum number of characters per line: The maximum number of characters per line is based on the keyword array declared at the beginning of the code, which is not exceeded in subsequent code, and all code is basically limited to reasonable and comfortable positions.

  • Maximum number of function lines: In this project , the maximum number of function lines is 111.

  • Function and class naming: When naming functions and classes, We start with the most direct. Name by using words and abbreviations together.

  • constant: We always define constants to help me implement and standardize my coding. On this project, We relied less on constants than We had in the past so that the code didn't feel bloated.

  • Blank line rule: In our rules, We always leave a blank line between two unrelated blocks of code. In some of the longer code, We also used blank lines to make the code a little clearer, but this also caused our code to look very long.

  • Annotation rules: All the annotations in our code are used to help others understand our code better.

  • Space before and after operator: We always put a single white space before and after operator which makes code more readable.

  • Other rules: We think there are no other rules for our code.

img

...全文
138 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

183

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程 教学
软件工程 高校
社区管理员
  • 单步调试
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧