File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / BreakApp / README.rtf
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:39 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Ohlfs;}
\paperw9560
\paperh7560
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 BreakApp
\b0\fs24 \
\
BreakApp is a simple game program where the goal is to knock out the tiles in a playing field by bouncing a ball off the walls and a paddle without letting the ball drop past the paddle.  Because BreakApp is meant to be an example of using NeXTSTEP, it's not full of features that would make it an terribly exciting game. That is left as an exercise to the reader. Instead, BreakApp demonstrates:\
\
� Simple animation techniques\
� Use of the SoundKit\
� Use of NXImages with custom draw methods\
� Reading colors from a color list\

\fc1\cf1 \
BreakView, a subclass of View, is the central class in BreakApp; it implements all of the game functionality and provides several target/action methods with which the game play can be controlled.  The BreakApp class, a subclass of Application, provides some housekeeping functionality (such as management of nib files, etc). SoundEffect is the class responsible for dealing with the SoundKit.\
\
BreakApp uses a buffered output window as a means to fake double-buffered animation. The current frame is drawn directly into the window. However, because the window is buffered, the drawing goes to the backing store, and not the screen.  Only when the frame is complete does BreakApp flush the window contents to the screen; this process is fast and provides a flicker-free update. BreakApp then proceeds to draw the next frame into the backing store.\
\

\b Changes since 2.0
\b0 \
\
� BreakApp used to run with a timed entry set to fire as often as possible. Now it sets the period to 0.03 seconds. Because timed entries have been changed such that under 3.0 they do not add the time it takes for the timed entry function to execute to the period, this pretty much guarantees about 30 frames/second on machines capable of 30 frames/second or more. It also assures that on very fast machines BreakApp won't hog the CPU by running at hundreds of frames a second.\
\
�  The sound effects in BreakApp are now generated with the SoundKit. Under 2.0, because sampled sounds could not be mixed in real time, BreakApp used the MusicKit.\
\
� Minimum for the game window size is now set through Interface Builder; thus, there's no need to get the windowWillResize:to: delegate method.\

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.