Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Thursday, 28 August 2008

What's Happening?

I have kind of put a temporary halt to development while I finish a piece of course work for my OU course which has to be finished by the fourth of September. The course work is based around Threads and server applications. I completed everything but the last question which is based around servers and is worth 45% of the total mark for the piece. I'm already having trouble with this course work, one of the thread questions has completely thrown me and, although I have managed to answer it, my answer is an incredibly ugly solution.

While I'm on the subject, I thought I would have a quick dig at the Open University. I'm finding a lot of their programming courses very easy. At the moment I have studied M150, M255 and am studying towards M257 and am thinking about studying M263 Building blocks of software which seems like the easiest course of the three mandatory level two courses (which isn't really what I want to do). If I had my choiceI would skip M263 and save the thirty points for another course that would teach me something else more complicated, as at this point doing the course seems like a step backwards.

My other problem is that the Java courses are all based around small programming exclusively, which gives the student no experience at larger scale development. I would like one larger Java course worth more points - say 90 or 120 - that was based around developing one large program.

Another major problem is that the OU courses seem to be centred around Java programming and rarely look at other languages. I have done one course that was based on C++ but did not go into any depth on any of the more advanced aspects of the languages (pointers, for example). Ideally I would like to learn Java, C++ and some assembly language stuff.

I know the level three courses are a lot harder but they are still based heavily on Java and I have the maths courses to look forward to. I am actually quite scared of doing maths stuff as I'm rubbish at it. At the moment I am working through all of necessary computing courses and then I plan to jump across to the maths based stuff once I've finished.

A quick jump back to the development: I've added more menus (although I'm worried about the way I built the class). My solution will only be useful inside my program and I'm tempted to spend some time developing a full blown re-usable class that would lay out menus in the way I want. Also I've begun thinking about mouse support and how I am going to accomplish it. Another problem is that two use multiple menus and I have implemented numerous keyboard listeners to deal with them all (which I think I'm going to get rid of, although I'm going to still have two: one for inside the game and a second for all the menus).

The menu problems got me thinking about my objectives for this project. I have two main objectives: The first objective is to develop a piece of software that I can use to show my programming skills for potential jobs and bragging rights; the second is just to have a functioning program and as an exercise to see if I can make a full blown functioning program. They objectives don't seem to run parallel - the first objective pulls me towards taking my time and planning out each stage carefully and working out the specifics of my program before starting; the second just causes me to brute force everything and work as quickly as possible. At the moment I am sticking with the second.

Thursday, 7 August 2008

Setting Path Environment Variables In Vista

This is a quick tutorial explaining how to set Path Environment Variables in Windows Vista. It will take you through a step by step guide that will allow you to run all the Java SDK programs from the windows command line.

1. Locate your Java SDK. It will normally be located in a directory such as:
C:\Program Files\Java\jre1.6.0_07\bin

If you are using the 64 bit version of Windows Vista it will be located in the Program Files (x86) folder.

If you can't locate your Java director it can be found by opening your control panel and double clicking on the Java icon. Go to the Java tab and then click on the either of the buttons marked 'view'. In the location tab is the path to your Java director although you have to add '\bin' to the end.

2. Next open the control panel and then system. Click on the Advanced System Settings. You should now see the System Properties window and be under the Advanced tab. Right at the bottom you should see a button marked “Environment Variables”. Click on the button.

You should now see the Environmental Variables tab. This window is divided into two sections. The bottom section is called 'System Variables'. Scroll down until bottom list until you find a Variable called 'path'. Select it and then click on the lower edit button. You will get yet another window. Now, under the Variable Value box, add the path of your Java director to the end of the line. The end the line should read something like:

;C:\Program Files (x86)\Java\jre1.6.0_07\bin

3. Reset your computer.

4. When Windows opens hit the Windows button and then type 'CMD' into the search bar. This will launch the command line. Type 'java -version' into the command line. This should hopefully bring up information about the version of Java your using.

Wednesday, 9 July 2008

Package And Class Info



My chosen development method is 'keep coding until something sticks', so my source code is currently a big mess even though the application doesn't do a lot yet. I have written absolutely no documentation for the program (unless, of course, this post counts).

I've divided the program into four packages. The main package is called LexDanceDance which contains everything else. The only class inside the package is the main class which starts the program.

The first package inside LexDanceDance is called ‘Objects’. This package contains classes that represent on screen objects. At the moment there are three classes in the package. The first is 'ScreenItem' which holds all the basic information about screen items (such as their screen position). ScreenItem is a abstract class (even though I've left the construction methods as public not protected - which is stupid).

I have two other classes. One is used to represent text on screen and it's called 'TextItem'. The final class is going to be used to represent a menu but it is not finished yet. This class is called 'OptionListItem'.

The second package is called 'controller'. It will contain all the classes that deal with the input devices. At the moment it only contains one class called 'KeyboardControlClass' and it deals with keyboard input, obviously.

The final package is called ‘Graphics’ and deals with all the on-screen stuff. There are two classes here. The first is called ‘screen’ (which actually doesn't do anything and will be removed eventually); the second, and last, class is called ‘DancePanel’ which overwrites the JPanel class and deals with all the on-screen stuff.

While it does not appear that I have got very far I believe I have reached a point where I can start to play with harder stuff. My first challenge is to get full-screen mode working. After this I intend to set up a double-buffer and then I can start on getting the dance mat input working.

Monday, 7 July 2008

Intentions

As this is my first post I am going to try and outline what I'm going to write about in this blog. A while ago I got into playing dance mat games. Not realising there were ones freely available already for the PC, I decided to write one for myself.

My first step was to buy a cheap Dance: UK XL dance mat off of eBay. Once this arrived I posted a thread on the official Java development forums asking a couple of basic questions.

If your interested in the thread: here.

My next post will outline the basic class structure of my program so far.