4 Replies - 1123 Views - Last Post: 11 July 2013 - 04:09 AM Rate Topic: -----

#1 DaMi25  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 57
  • Joined: 09-December 12

Case Study in Java

Posted 10 July 2013 - 04:24 AM

Good day! I just want to ask about our case study. Our professor told us to think of a program in Java. After days of thinking, I decided to make an educational game. This game is for kids and basically it is sort of a Math Teacher. I began planning for the GUI. My first frame will show the user the list of players who played the game or if there are no registered players, there will be a button that will help you create an account. By the way, there is no need to have a password, just a name like in the game Zuma Deluxe(if you know). So after making a name, the screen will show you the main interface. It has a Play and Exit button. If you click the play button, it will lead you to another frame that will show you three radio buttons, which is for Easy, Intermediate and Hard. If you'll choose Easy, it will lead you again to another frame and this will be the game. This is the situation, if I'm the one playing the game and my mother called me then I need to close the game but I'm in the middle of a game. When I'll play again, I want to continue what I started a while ago. So how will I get to that part of the game again using my registered name? Will I use database for that? Or there are other things that I must or should do? Sorry for this question, I am not that good in Programming. I know I still have lots to study in Java. Waiting for your reply. Thanks in advance. :)

Is This A Good Question/Topic? 0
  • +

Replies To: Case Study in Java

#2 Flukeshot  Icon User is offline

  • A little too OCD
  • member icon

Reputation: 417
  • View blog
  • Posts: 1,030
  • Joined: 14-November 12

Re: Case Study in Java

Posted 10 July 2013 - 06:38 AM

You could use a simple text file to save all of the relevant data which can be read in at load time, it doesn't take much Java skill but it will take a lot of applied logic and general programming skill.
Was This Post Helpful? 1
  • +
  • -

#3 jon.kiparsky  Icon User is offline

  • Beginner
  • member icon


Reputation: 10897
  • View blog
  • Posts: 18,590
  • Joined: 19-March 11

Re: Case Study in Java

Posted 10 July 2013 - 07:05 AM

A text file is of course a perfectly sensible approach and probably one you can manage pretty well. You can step up that game a little by structuring the data using XML. This migght be overkill, but I assume you're trying to learn something, so you could learn something about XML this way.
You might want to consider reading up on serialization. That's a useful tool to have in your kit, and it seems like it might apply to your current situation.
Was This Post Helpful? 1
  • +
  • -

#4 DaMi25  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 57
  • Joined: 09-December 12

Re: Case Study in Java

Posted 11 July 2013 - 03:46 AM

Thanks for your suggestions. For the mean time, I'll read about the things you have said. :) Thanks a lot!
Was This Post Helpful? 1
  • +
  • -

#5 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2388
  • View blog
  • Posts: 5,012
  • Joined: 11-December 07

Re: Case Study in Java

Posted 11 July 2013 - 04:09 AM

I would just have a directory with one file for each user, named by their username (so the list of users is the list of all files in the directory) and just serialise the entire game state to the appropriate file.

It's not clever, secure, unhackable, readable or scalable but it's quick and easy. You have a lot of parts to get working. Get each working ASAP and then think if you could modify them to be clever.

If this is V1, V2 could be backed by a database.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1