![Page 1: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/1.jpg)
A Fighting Game of Sorts
CS470 Project Presentation
By Mark Blum
![Page 2: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/2.jpg)
Background
• I made a graphically driven game.
• The “clients” for my project are myself, my brother Luke, and my friends.
• Java was used to create the game.
![Page 3: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/3.jpg)
Project Goals
• Make a new game that is better than any previous game I have created.
• Accomplish this by incorporating the best features of the previous games I have created (story, graphics, and AI) and adding any features that may still be missing (sound and save feature).
![Page 4: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/4.jpg)
Requirements
• The system must have a save game feature, a character creation module, a cheat code, 10 stages, an ending sequence, and a high score ranking system.
• My game fulfills all the listed requirements.
![Page 5: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/5.jpg)
Sample High Score Ranking System
Having completed stage X before ending the game, youhave achieved the fighting rank of:• Wimp• Lucky Punk• Thug• Novice• Initiate• Adept• Expert• Specialist• Master• Grand Master• Supreme Grand Master
![Page 6: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/6.jpg)
Interface Mock Up
![Page 7: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/7.jpg)
![Page 8: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/8.jpg)
![Page 9: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/9.jpg)
![Page 10: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/10.jpg)
![Page 11: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/11.jpg)
![Page 12: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/12.jpg)
Data Structures
• I used a couple of stacks to implement the High Score system.
• To store the information about the hero and the various bosses I used a simple file format.
![Page 13: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/13.jpg)
Data Structures, cont.
• An example of a typical boss file is: Dan|110|37|0|3|2|2|2|2|3|1|5|8|6|2|0|40|5|5|5|0|0|0|24|EMC|40
• An example of a typical hero file is: true|1|Goku|112|45|0|3|2|2|2|2|3|2|true|true|true
![Page 14: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/14.jpg)
Data Structures, cont.
• For input validation I used a special data structure that was capable of only holding whole numbers.
• This was used extensively in the character creation module. It is also used when the player is prompted to enter the number of additional EP to sink into an attack.
![Page 15: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/15.jpg)
AI• Random/Rule-based hybrid.
• Each character has a random percentage chance to do any particular move that they possess.
• Percentage chances are modified based on certain “rules”.
• Examples:if enemy is defending: then increase probability of powering up by probability to defend and set probability to defend to 0
• if enemies action equals Energy Maximum Charge attack: then defend with a 8 times current stage probability
![Page 16: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/16.jpg)
Biggest Hurdle
• The biggest hurdle I encountered during the course of my project involved threading and thread “safeness” or lack thereof.
• During the players turn, I needed to “pause” the program until the player had made a selection.
• Added an extra thread to take care of the fighting. Unfortunately, Swing is not thread safe.
![Page 17: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/17.jpg)
Solution
• I made a special class that I used to sync my threads with, and I made all my accessor and mutator methods synchronized.
• I also declared many of my variables to be volatile, and I made use of repaint(0) instead of repaint() where it mattered.
• Where possible, I used the results of a change before making the change.
![Page 18: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum](https://reader036.vdocuments.site/reader036/viewer/2022062715/56649daf5503460f94a9cd6c/html5/thumbnails/18.jpg)
What I’ve Learned
• I learned that making a graphically driven game is extremely time consuming, and that making/editing the graphics can take just as much time as the coding.
• In addition, I learned how to make programs that utilize Swing thread safe.