Everything you are looking at here is probably in some
way related to games. The whole reason I learned programming
was to try to make a game. I should have started out trying
to make a tic-tac-toe program, because I drowned out there
for a long time. The following tables contain complete project
and small code examples of things that I learned and felt
others might find useful. Some of these have made me quite
popular in the FB programming circles, which is pretty cool.
Permission is given to copy, modify, and reuse the source
code here as you see fit, provided you don't claim ownership
to any of it. I'd be dearly interested in seeing any projects
you develop that use any code you found on my site :-) Please
enjoy and have fun with it!
= FutureBasic II code only
= FutureBasic^3 code only
= Code for both versions included
||The application and source code
to Edtris, a fun little Tetris game. Its a complete
program from graphics to high scores. An important case
study if you are new to game programming.
||The source code to a FishTank program.
Shows copybits animation and a tinting effect you can
get with QuickDraw by setting the foreground colors.
||Same as the above project by reworked
to compile in FB^3 for you. Also, this one uses the
new EnterProc functions in FB^3 that are simply awesome
||This fascinating project will magnify
portions of your desktop with copybits and GWorlds.
||This project is a converted pascal
program that generates an animated starfield.
||Source to Trippy 2.x for FB2. This
mind boggling project will rotate the screen colors
like mad using color cycling. Includes more than a dozen
color palettes which are chosen randomly for cycling.
||Source to Trippy 3 for FB^3. Trippy
3 works a little differently than Trippy 2 and has some
improvements to it...not to mention all the functions
work in FB^3.
Your Monitor Project
||This project is a screen saver that
smashes holes in the desktop with a wrecking ball.
||This is a fairly complete example
of a Pong game. Uses GWorlds and copybits for animation.
||A very simple project for FB2 that
compiles a CDEF which allows you to use PICTs as buttons.
Various examples included.
||A fireworks generating screen saver.
Uses ultra fast direct to screen drawing when run in
256 colors mode. Its really cool.
||Same as above, but with repairs
to the menu hiding routines to function in PowerPC mode.
Various other things have been fixed up in FB^3 for
||This one will blow your mind as
to how I did it. A realtime fire generating screen saver.
Some parts are in assembly for speed and this program
also does direct-to-screen drawing if possible. The
project includes both Derek's and Joe Kovac's version
of Fire (Joe rewrote a huge amount of it for maximum
speed and bug fixes) including Fire4, which has a proper
Renderer Info 1.1
||This is a ported Apple sample project
that queries the gl software to determine what kinds
of interesting things your graphics hardware can do.
This version is error free under Release 2 and also
grabs the Renderer string from gl's string table.
||All of the FB^3 USB headers and
libraries and code to scan the USB bus for everything
under the sun. You may be surprised what kinds of things
come up in the scan, I learned I had two USB channels!
(1.1 now checks for the presence of the USB manager
to prevent a crash on Macs without USB)
||How to fade images with copybits.
Fades only a window or part of a window if you'd like.
Very useful example.
||This is the above example in FB^3.
There were quite a few changes needed to convert over,
so I've done it for you.
To Screen Drawing Example
||Some extensive source code that
demonstrates how to draw directly to video memory. Somebody
seems to have made a similar project in FB2, but this
one has been lying around for ages on my hard drive
(I guess that makes it venerable?). Be careful, it may
crash some configurations!
Context Example 1.1
||This is a quick and easy port of
some Apple sample code for DrawSprocket. This code grabs
a monitor context and proceeds to activate it and get
it ready for drawing into. PPC only.
||A test program developed while porting
over InputSprockets to FB^3. Shows how to bring up the
Configure dialog and how to check for inputs from a
controller. PPC only.
||A really cool example of playing
MOD music in FB3 with libraries built by Codewarrior.
||A fully functioning demonstration
of color animation. Includes the FN CycleCLUT.
||FB^3 function that
will do a pixelation transition effect between two gworlds.
Simple and gives nice results.
||This example shows how to switch
the monitor resolution using QuickTime. Useful for movie
playback, among other things.
||A way to call DrawPicture with transparency.
Kludgy, but it works.
||A small project that explains the
Vertical Retrace Manager and shows how to install and
remove a task in PowerPC and 68k code.
- Sync to Video 1.1
||A small project that builds on the
previous VBL example by creating a persistant slot-based
VBL task that is tied to the monitor's refresh rate...any
monitor's! PowerPC only.