I'm playing around with
Python, which seems to be a nice programming language. It's free to download and there are versions for all sorts of computers including PC, Mac and Linux. It is fairly lenient on syntax, with no silly semi-colons at the end of each line. You don't have to round off FOR loops or IF conditions with an EndFor or a curly bracket. It also seems to run fairly quickly and you can do lots of interesting things with it. People have written extensions to add extra functions, so it can be adapted to a huge variety of uses.
I have been working with a book called
"Python Programming For The Absolute Beginner", which has covered the basics well. I'm now ready to try something a bit more challenging, so I have started a little game. This will be a "fishing" game, where you have to catch fish using a harpoon.
So far I have animated the water and created a boat which can be moved left and right using keys. There is a harpoon gun on the boat which can be rotated, and the boat bobs up and down as the waves move past.
I'll be creating fish which swim past under the boat, and you have to aim your harpoon at the fish. Different fish will give more points, and there will be fish to avoid such as sharks and electric eels. You'll be able to sell your catch to get better equipment such as a better boat, faster harpoon, stun grenade etc.
I've been getting used to object-oriented programming, which is quite a new concept for me. It's a way of organising your program by splitting it up into chunks which manage themselves. So, there's an object called Boat which has code to make it move, and bob up and down. Another object is the gun, and it need to contain code which allows it to rotate and follow the boat around.
Drawing the screen in Python takes some getting used to. There's a plug-in module called Pygame which handles the graphics, but you need to do quite a bit to get it working. In Small Basic you just have to say "here's a sprite", but in Python you have to say: "Create a sprite object. Open an image. Apply the image to the surface of the sprite. Copy the sprite's surface onto the screen's surface. Tell the screen to update itself."
You can also ignore sprites altogether and just draw the images directly onto the screen myself. In the example so far I have done both. The waves are drawn onto the screen manually, as is the gunbarrel. The boat and the gun-base are Sprites. I don't know which one I prefer. I don't even know why someone would do one rather than the other. If you know, please leave a comment.
So far, I like the way it's moving. The graphics are a touch ugly. Python doesn't seem to anti-alias, so the edges are quite rough. I'll work on tarting up the bitmaps later when I have it working properly.
Image resources are
here.
Download the source code
here.