a fighting game of sorts cs470 project presentation by mark blum

18
A Fighting Game of Sorts CS470 Project Presentation By Mark Blum

Upload: loren-campbell

Post on 23-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum

A Fighting Game of Sorts

CS470 Project Presentation

By Mark Blum

Page 2: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum

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

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

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

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

Interface Mock Up

Page 7: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum
Page 8: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum
Page 9: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum
Page 10: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum
Page 11: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum
Page 12: A Fighting Game of Sorts CS470 Project Presentation By Mark Blum

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

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

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

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

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

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

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.