Saturday, September 19, 2009

3.2 - check!

I've finished the next chapter. It was dedicated to the window structure and controlling it. Most of the information here I will not use this project, however it is still good to learn it - to know what the possibilities are. It also helps one to draw a general picture of how things work in windows.Certainly I'm not saying that I should have skipped this chapter, no - there were quite a few essential things that I've learned from it, both for this project as well as for programing in general.

I am managing to go through this really fast - I am using the fact that I have a reasonable amount of time not dedicated to other subjects' work. I am doing so partially because I don't know exactly how much time it will take me to write the game.

I feel soon I should already specify what game I want to make. Some of the choices I'm thinking about are:

  • tick, tack, toe
  • solitaire
  • chess
  • peg solitaire
  • etc.
I am not planning to create any AI for my game (computer based opponents) - that would be too complicated. That's why I can't have any other card game then solitaire - the player's would see each other's cards.

Wednesday, September 16, 2009

First Windows API Programing

I haven't updated the blog much for a while - not only because of the fall trips. I still have not managed to solve the Visual problem on my computer, but I've been able to use my mom's for the time being - for the exercise programs. I've already done a few - suggested as practice in the end of the first chapter of the tutorial (3.1) which I have studying. I've crated the following programs:

  • "computer die" - Random number picked from 1-6. Uses windows message boxes, like the one on the right.
  • "Garfield" - a little sequential interactive program that also uses message boxes. The outcome depends on the decision of the user.
  • "Click" A window. When you clock it it tells you you did so with a... message box :D.


Maybe it doesn't look impressive. But what it is, is the introduction to the Windows API - the structures of Windows' windows and how to use them. I also refreshed myself on the use of the random function - very useful for games. Following the style of programing used in "Garfield" I could easily program any sequential "game" - like many quizzes found in magazines (set of questions where the answer leads to a next question until some kind of an end box is reached).

While writing those little programs, I've already came across some of the most common problems which I will surely encounter again while writing my final game. One of them was a single line I've missed in a complex structure - unfortunately it was important enough to  fail the whole application. It was also a mistake that the Visual C++ Program did not find - like it does with simple typos and incorrect type usage. It took line-by-line comparison to find the mistake. Later on in bigger projects I will try to include crash prevention and notification scripts (so called exceptions).

Some other problems I encountered were needing me to do a further research into specific queries on MSDN (the ultimate C++ documentation :)) which were not described in the tutorial. Again, I am sure I will be doing that over and over when creating the final program - it is one of the specifics of programming. It is good I'm already getting practise with that and I'm getting used to using MSDN and its documentation style.




There is one more practice program to do - a window that makes sure you really want to exit (a prompt like in most of programs, e.g. Word). After that I will hit the 3.2 chapter.

[UPDATE]

I have finished the last program - it only required me to research a specific function and apply it. Now I'm going through the 3.2 chapter.

Friday, September 4, 2009

Problems with Visual C++

To try and solve the problem of Visual C++ not wanting to install, I tried installing it of a CD rather than a file on the computer. Unfortunately it has had the same effect.I have supplied more details about the problem to the official Visual forum (MSDN) and am waiting for an answer now.

There is another thing that I can try - install the trial version of the full Visual software (the Express Editions are free). However, it only lasts 90 days, therefore I will only try it after we get back from the trips - not to waste the time that we're away.

Wednesday, September 2, 2009

Start of leraning + more on the Visual problem

I have started my lecture on the Windows API. Unfortunately I still cannot fix the problem with Visual C++ and I don't really have any way of 'fighting' it - I have to wait hoping to receive help from forums where I posted the problem. I can do exercises on another computer where the software works, however I probably won't be able to do the whole project there and even if, I'd rather do it on my own computer. If I don't get MS Visual working by the time I will start to write the actual program, I might choose to use an alternative program - it will be less easy on me since I got to know Visual  before, but it might be the best solution

For now I will just keep on going through the tutorial.