This site is created in the purpose of an project in Malmö Högskola spring '00. The project purpose is to learn to analys, design and create a program. The project started mars 20:th and is due may 16:th. It began with that I was confronted with a customer who wanted a new version of the classic game battleship. This site was created for the reason of that the customer wanted regulary updates of how the project is goin. The site is parted in a diary part, which takes the process week for week and then an phase part that lists the diffrent phases in the project and their components.DiaryHow it started
I was given an customer (a teacher who represented a customer). The customer wanted a new version of battleship. This version should be played over a network and with the change from the classic one, that there should be several players on the same gamearea. One player should start a servergame which other players should be able to log on to. The customer didnt want any grid either, the players should just click somewhere on the gamearea to mark their shot. The cutomer wanted a requierment specification, contract and a preliminari GUI finnished mars 31:th.If you have any comments or questions feel free to mail me Mikael Röjnert
Week 1 (27-31 mars)
Writes an requierment specification, contract and design a preliminari GUI. Friday the customer approves and signs the papers.Week 2 (3-7 april)
The work begins. Start to design the use-cases for the game. I also start to re-design the GUI and look into the functions in javas swing pakage. On thursday I check the serversocket and socket classes in java to try to get a grip of how they work, not very succesful having trublle with the thread part.Week 3 (10-14 april)
Get back to work with the swing components, having trouble with deactivating and activate different panels in a frame. Creates this page for the customer and everyone else how might have some use of it. Finnished the new GUI.Week 4 (17-21 april)
Sat some hours and worked with the panels in the GUI and found out how to change panels in the same frame which I had problems with last week. Also started to work on the client server part and got it working in the end of the week.Week 5 (24-28 april)
Started to connect the client server classes with diffrent events generated in the gameframe, no succes. Don't know how I can get a mouseevent on the gamearea from one player to react and check the other players gameareas. Also i don't know how to check if the x and y coords. from a mouse click is a hit or not, tried with the class pixelgrabber, no luck there either. Started with the class that randomizes the x and y coordinates for the boats. Problems with how to figure out if the x and y allready is in use of another boat.Week 6 (1-5 may)
Fixed the pixel method. I now load a picture into a bufferedImage and then when I get the x and y coords from the mouseclick I check the bufferedImage and gets the color for those coordinates. Having BIG problems with solving how clients can connect to a specific gamehost and then just communicate with just that one. Gets my lobby to work the users can now chat with each other.Week 7 (8-12 mayl)
A working game seams far away and I only have one week left. At the moment it dosen't look like I will make it in time. But never give up, I continue to stride for the goal. I got the due date prolonged for three days (giant achivement :). Now its time to lock myself into the closet uniil the end. The final GUI is also finnished but to see that you have to download the game and play it.Week 8 (15-12 mayl)
Thursday night and Iam out. For seven days now I havnt seen the sun and in this wheater to, we have had ( 20 degrees Celsius) the week I've been away. It started raining yesterday. Well enough of that I have an almost working game now. The main functions are working, there's just some minor cleaning up to do here and there. So this is the last line I type for this weekary and this project, feel free to try it and see what you think. Hope you enjoy it.How did I do it ?
As this is my first big project in game programming i didn't really no where to begin. As we have learned earlier this year the starting point for a project is to analys it. That was just what I did, first i sat down and typed down everthing my battleship game could and should do. When that was done I continued to do a use-case diagram. For this as for the rest of the analysis bit I used the excellent tool together. Which makes it easy to do diffrent types of diagrams. A great utility in this is that you get the java code direct. The use-case diagram I then used to create the different sequenses in the game ex.A player shot and miss.Phasepart
Its from the sequence diagrams you develop the different classes for the game. After that it just the easy bit left :). Now you just sit down and type all the neacesary code for the game, where I used J-Builder to code mine. For most of the GUI I used swing components. After all this is done you hopefully have a working game.
Analysis
Requierment specification ( Only in swedish )Design
Contract ( Only in swedish )
Use-case diagram
Sequence diagramImplementation
Enter name
Create game
Join game
Highscore
Start server game
Choose server game
Shoot and hit
Shoot and miss
Quit gameClass diagram
Package GUI
Package Engine
Gui
Classes
Package GUI
battleShip
enter
GUIboatarea
GUIcreate
GUIendgame
GUIenter
GUIgame
GUIgamearea
GUIhighscore
GUIlobby
GUImain
GUImainframe
GUIwainting
Package Engine
server
client
player
highscore
gameDownload the java files in a .zip
Start instructions: First you run the server in the Engine package and then for every client run battleship in the GUI package