Flash Games 10/25/2014
Rocketeer (10/25/2014)
Source download: rocketeer_3.fla
In Rocketeer, the object is to take off and fly into orbit. In orbit, you can maneuver your ship around the earth, fly out to several thousand kilometers, then deorbit and land at the space port.

Achieving orbit can be a little tricky, but with practice, you can develop your own technique. In this game, you are fortunate enough to have unlimited fuel, so you don't have to do it perfectly.

Walkthrough:

To start the game, first click on the video to give it focus. This will insure that the flash program can read your keyboard. Press "H" to remove the help message, the press the up arrow to start the main engine. Establish a positive rate of climb of at least 100-150 meters per second, then start a pitchover.

During the ascent phase, control the rate of ascent by lowering the nose. Let the horizontal velocity build while maintaining an altitude just above the middle of the screen. As the horizontal speed nears orbital velocity, about 7900 meters per second, fly up toward the top of the screen, but try not to fly off the screen. When orbital velocity is reached, shut off the engine and wait. The rocket will coast out of the upper atmosphere. If you do not shut off the engine, it will cut automatically when you exceed 150 kilometers altitude.

Once in orbit, you will need to carry out an OMS burn to keep from falling back into the atmosphere. Immediately rotate the rocket until the nose points in the direction of motion. Watch the altitude display in the lower left and when you are near peak altitude, do a very short burn to raise your perigee and establish a safe orbit.

The velocity display in orbit gives your speed relative to circular orbital velocity. A positive number indicates you are moving faster than required for a circular orbit, and will soon start going up again. A negative number indicates you are going too slow for a circular orbit, and you will soon start going down again.

To re-enter the atmosphere and land, do a retro burn near perigee to make the speed negative. The trajectory will dip into the atmosphere and the view will switch back to the flat earth model.

The rocket should be moving almost horizontally when it enters the atmoshere. Too steep an entry could be disastrous, so use the engines to slow the vehicle and bring the rocket down slowly. If the aerodynamic load factor exceeds 4 G's, structural failure will occur. To avoid this, stay out of the denser part of the atmosphere until you have slowed down. Once you get down to below 1000 meters/second, you can fly to the spaceport and land vertically.

Try to land as slowly as possible. A hard landing can damage your vehicle and feeze the program.

That's it. I hope you enjoy it.

Please send your comments, questions, or suggestions to lefty2000@outlook.com.

10/11/2014: Actionscript Tutorial -- Implementing a rocketship game.
I am now working on my rocketship game, but instead of building on what I had previosly done, I decided to start from scratch and use some of my recently acquired knowledge. Progress will be documented in the form of actionscript tutorials which I will post as I go. The plan is to advance in easy stages. I am focusing on the actionscript and not the graphics. You can use my graphics by downloading the sample lesson files, or make up your own.

The links below will take you to the lessons posted so far:

Lesson 1
Lesson 2
Lesson 3

The above interactive flash video is the latest version.

Commands:
Rotation -- right and left arrows
Jet -- Up and down arrows
zoom out -- x
zoom in -- z

You are welcome to send your comments, questions, or suggestions to lefty2000@outlook.com.

Flash Games

Actionscript Tutorial -- 10/5/2014
Flash lends itself to writing 2-D games that are not too complex, and can be played online in a browser. The level of complexity suitable for this type of game is consistent with the capability of a solitary programmer sweating over his keyboard late into the night. My first version of Flash was MX2000, aka Flash 7. Later, I upgraded to Flash 8, but I have not kept up with later versions. For the time being, most browsers can handle Flash 8, but that may change in the next few years, for I hear rumbles that HTML5 is the next big thing for online media and flash is on the wane. We shall see.

I have been thinking about updating my Rocketship flash game, but after studying the existing code for awhile, I realized I needed a refresher course on actionscript 2.0 and I needed to extend my knowledge of same. So I decided to tackle the problem of converting the Lapmaster game which I orginally wrote in python into flash and write a tutorial describing the process of writing the game as I went along. So far, I have about 95% of the game converted and running. You can read the tutorial here: actionscript tutorial.

To play the current version of the demo game online in your browser, click here. Please send your comments, questions, or suggestions to lefty2000@outlook.com.

Game Design

More on DLL distribution -- 8/22/2014
Like all things microsoft, the issue of DLL redistribution is a messy one. According to the instructions at Determining Which DLLs to Redistribute you can get a list of which files you are allowed to redistrbute from your version of VC10 by looking at the file redist.txt in the compiler installation directory. Determining which DLL's you are using can be difficult, and the easiest way to find out is to move your program onto onto another computer with a standard factory load, which does not have the compiler and the SDK installed and try to run it. You will soon know what is missing and go from there. You may be able to work around the problem by deleting some features from your program or doing things in a different way. Depending on what features of MSVC you have used, you may not need any of the non redistributable DLL's. Using basic low level functions of Windows increases the chances of avoiding this problem.

I have run this test with several game project programs which use basic Windows functionality, including opening a window, loading and displaying a bitmap, keyboard input, playing a sound, and one that includes OpenGL code and found no problems with running them on a new machine which had only a standard windows 8 load. My conclusion is that portability from one windows machine to another may not be as much of a problem as I earlier had implied in my previous posting.

One word of caution, however. The Microsoft article on redistribution clearly states that "debug" versions programs are NOT redistributable. Before giving your friends your program to play with, be sure to compile it in a release version.

Thanks visiting my web-site -- Lefty

lefty2000@outlook.com My Email Address for this site.


Introduction -- (updated 8/4/2014)
This website is all about having fun with computers. I first began to play with personal computers in the days of the KIM-1, and the Sol-20. From there I moved to the Apple II and the Commodore 64. It was an exciting time when a solitary programmer working alone into the night could create something innovative and marvelous. There were many thousands of us out there writing programs in basic to play checkers, tic-tac-toe, solitaire, Star Trek, Solitaire, and others I can't remember. A friend of mine and fellow home computer hobbyist told me about the time he got into a conversation with a young man working in a local computer store. My friend mentioned to the young man that he had written a program to play checkers and the young man responded by showing him a program he was working on, a fantasy role playing game. My friend thought that the game was rather silly and doubted if anyone would want to play it. The game was called Ultima, and the young man was named Richard Garriott.

The days when a solitary programmer could write best selling computer game are long gone, but I have never abandoned the hobby of computer game programming or the pleasure it has given me. You can't make a fortune writing computer games by yourself, but you can still have a lot of fun, you can learn a lot about information technology and software design. I believe that fun and learning go hand in hand, and while in these latter years my emphasis is more on the fun than the learning, I am still learning and still chasing the state of the developing technology.

Part of the fun is sharing with other like mind persons, so I am creating this web-site to make available what I have learned over the years. My current interests are programming with python, C++, and Flash. In order to make my programs more accessible, I have avoided using expensive software packages, with the exception of flash. I will be posting some games written using flash 8.

C++ is the most powerful tool for writing computer games and you can do almost anything with the express version which is distributed free by microsoft. Unfortunately, the learning curve is steep and it has taken me years to learn enough to do much with it. It was not until the circumstances of my day job forced me to tackle MSVC10 express that I began to make real progress. It is fairly easy to distribute programs developed with MSVC10, but you do have to include the redistributable DLL's. While these DLL's are included with the free version of MSVC10, I am told that you do not have the right to redistribute this library, unless you purchase the full version, which is expensive. The workaround is for the user of your program to install msvC10 express on his machine so he will have the required DLL's legally. I suppose there is some social value in this restriction, since it creates an incentive for people to install C++ and once they do that, they just might learn to use it, and if they turn pro they might break down and buy the full version from microsoft. To get Microsoft's official position, visit Determining Which DLLs to Redistribute. You might get away with illegally redistributing libraries, but then one day you might get the bigfoot right on your head, so don't do it.

Python and pygame are free and you can freely distribute your products, but your user will have to download and install these packages in order to run your program. Python and pygame are portable across multiple systems, they are easy to learn, easy to use, and very powerful, as long as you don't need extreme levels of performance. I am sticking with python 2.7 for now. For awhile, I used python 3.0, but when I tried to use pyOpenGL with python 3.0, I got stuck and had to go back to python 2.7, which I believe is what most people are using right now. That will probably change, but I have found no difficulty running stuff I wrote with python 3.0 with python 2.7. If you are interested in 3d programming with python, pyOpenGL is probably a good choice. What you learn from pyOpenGL is very helpful when using OpenGL with MSVC10, and vice versa.

Flash is a great tool for writing computer games because you can post your programs on a web-site and your users can run them online in their browser. The downside is you have to learn actionscript, which can take some time, and the flash authoring tool is rather expensive. Nevertheless, if you are willing to bite the bullet, you can make your games readily accessible to casual users.

Creating the graphics for your computer games can be a challenge. If you are an artist, you can probably do everything with paintshop pro (which I have) or photoshop (which I do not have). 3d graphical tools like Poser can be useful for creating animations for computer games, but that is kind of expensive. The flash authoring tool (I have an older version, Flash 8 professional) is great for creating graphics and creating animations if you are willing to invest the time and money. There are places where you can download free sprite images so you can go that route if you so choose.

Since I have worked mostly alone and am self taught, my programming style and methods may exhibit some profound ignorance and some peculiar eccentricities of my own. Still, I managed to make it to retirement as an aerospace engineer so it has not been entirely a waste, and I have enjoyed every moment of it.


August 3 2014: Rocketship v1.0 -- Flash
This is an example of programming a simple game in flash8. This is the first part of rocketship game which allows the player to fly a rocket into orbit and navigate from the earth to the moon or to other planets. This initial version only allows the player to lift-off and fly around inside the Earth's atmosphere.

The game begins with the rocket poised on the launch pad. To start and stop the engine, press the space bar. To rotate the rocket, use the right and left arrow keys. If you fly out of the atmosphere, the rocket will disappear off the top of the screen. In a future version, if I get around to writing it, the view should switch to a view of the rocket in orbit around the earth.

To play the game online in you browser, click here. After the page opens, you may need to click in the window once with the mouse before the video responds to the keyboard.

I have included the flash source in the downloadable zip file, but you will need the flash authoring tool in order to look at it.


July 31 2014: Lap Master v1.0 -- pygame
August 2 2014: Lap Master v1.1
My first project is a driving game called Lap Master. The player drives an old style "cigar shaped" race car around a closed track and tries to complete a certain number of laps in minimum time. The player controls the car using the keyboard.

As configured, the car has four gears. To shift up, use the up arrow key, to shift down, use the down arrow key. To turn right, press the "d" key and to turn left, press the "a" key. The car turns at a constant rate when the "a" or "d" key are pressed. This means that the radius of the turn depends on the speed. The higher the speed, the greater the radius of the turn. To turn more sharply, speed must be reduced; that is the only way with Lap Master. It is a bit unrealistic, but it makes for challenging play.

The steady state speed in each gear is 25 mph for 1st gear, 50 for 2nd, 75 for 3rd and 100 for 4th. There are four turns on the existing track, and it is possible to make them all at 100 mph, but you must start the turn at the right spot.

If the car goes off the track, the gear drops to 1st gear and the car jitters until you steer it back onto the track. The gear setting, current speed, and lap number are displayed on the screen during the race. when you complete the last lap, the game will stop and display your elapsed time for a few seconds so you can record it before the game exits.

It's a simple, fun game. To download the files, click here. If I come up with any improvements, as is my intention, I will post them here. For more information about Lap Master, how it was developed and how it works, click here.

Thanks visiting my web-site -- Lefty

lefty2000@outlook.com My Email Address for this site.

Return to Home Page