TemplateApp

TemplateApp is a child of BreakApp, which is delivered with the extended 2.0 release.  BreakApp was written by Ali Ozer at NeXT who did not sanction or assist in this project in any way.

TemplateApp is not copywritten, is not shareware, and is meant to be modified extensively.  Do not send the changes to me - just post them as freeware to the net.  You don't even need to include my name anywhere.

The purpose of TemplateApp is to facilitate the progress of good animation software development (including games) on the NeXT computer.  This version is meant to run under NextStep 2.0 because it uses the new NXImage object, but a simple change should make it 1.0 compatible.  Basically, this is a stripped-down BreakApp with all the functionality and none of the game.  That means that for anyone who wants to generate quick, reasonable animation applications, they need only modify the portions of this application that are desired.

More specifically, this release consists of many files.  The only one that really needs immediate change is the TemplateView object file.  In this file you get to fill in the 'step' method with the animation of your choice.  Then create an image and load it into the NXImage operator and off you go!  (You don't even need an image if you feel like using NXRectFill or other postscript operators - this is the default example of TemplateApp)

Note:  This does not mean that animation is simple!!  This is written for serious NextStep programmers who want to get started quickly without lots of fuss.  You must know what you are doing at least somewhat to get this going to your satisfaction.  I wrote this because after writing about 2 animations I noticed that almost everything was the same in the two programs except the animation loop.

TemplateApp has hooks for: animation, one image (more are trivial), sound (using the SoundGenerator object supplied with BreakApp), mouse events, keyboard events, loadable background images from menu or as defaults, game high scores, scores, text, and so on.  Most basics are there, although lots of little things can be done to optimize for your own needs.

I tried to comment the code in TemplateView.[hm] in various useful ways and I hope it is helpful.  Anyone could have done this, and probably done a better job, but I think it might be useful for getting up to speed quickly.  Note that development was done on an 8 Meg. 68030, using NextStep release 2.0.  Your mileage may vary.  Certainly it will run slowest on my computer so you can only do better...

Good luck!                                                                                            Shane