Re: TIB: Programing


[Prev][Next][Index][Thread]

Re: TIB: Programing




In a message dated 8/17/98 4:15:18 AM Central Daylight Time, BEARLKBOB@aol.com
writes:

> What is your favorite method for programing
	Well...when I make a BASIC program, I'll usually start with all the basic
stuff, you know, clearing the screen, saving the pic and gdb to user vars (so
that i don't ruin anything that's on the graphscreen that the user was working
on) then I usually start with the main loop, because TI-BASIC isn't object
oriented (doh!).  When I find that I need to make a routine that will be
called often, I make a seperate program that holds my routine and can be
called a number of times from the main program.  This helps to prevent the
program from becomming too large (as is evident with my C&C86PRE program which
uses more than 15k of mem, but uses 17 subprograms, leaving the maximum
program size at only 4k (that being the main program) this allows my program
to run MUCH faster and is easier to read than as if it had been done all in
one program.
	ASM is a totally different story.  In ASM, I'll usually start with the data
that my program uses before I write any code at all.  When all the sprite data
and strings that I think i'll need are finished, and usually only one map, if
my program uses a map for gameplay, I'll go on to write the code.  Here I make
any variable declarations that I think may be needed in the program.  After
that's completed I proceed to write or include any basic routines that I know
for sure will be used in the program.  Things such as putsprite, or my own
putsprite if i just need a simpler version, and Findpixel.  Any data
accessing/analyzing routines go here also.  Once all the subroutines are
completed, I write the main loop that runs the subroutines in sequence and
makes the program GO.

>  where do you get your ideas
	When I started TI-BASIC, I simply fiddled with the different things on my
calculator.  I started to figure out how graphing works, then did some more
fiddling.  Played around with variables, for loops.  Using the back of TI
manual really helps if you don't know the parameters for a certain function
you're interested in.
	For ASM however, I looked at other people's code.  Mainly though, I learned
from Ahmed's Archery program.  I spent hours just starying at it figuring out
what it does, and what it's for.  And as a VERY handy refrence tool, I use ASM
Studio 86's wonderful Help file.  That's the best reference I have been able
to find for common commands and it's really helped me take off.


>  how do you get so good at it.
	Practice, Practice, Practice.  Try yourself, make a routine that makes your
name bounce around the screen forever.  When learning ASM, my first program
made my name bounce around the screen.  I was shocked at how fast it was
compared to my BASIC routine that made my name bounce around.  I couldn't even
see it!  I thought my calculator had crashed, then I pressed exit and all was
well.  Anyways, after putting in some loops with nop's to slow it down to a
nice speed I could see what it did.  After that, I decided to make four
"Dave"s bounce around the screen at the same time...then I made some of them
menu-sized and some homescreen-sized.  Another good thing about this is that
EVERY program you make can be made better.  For instance, I have plans to make
my name bouncer make my name bounce around with a random tragectory.  (This is
easy in basic, just use X+10cos angle->X and Y+10sin angle->Y however in ASM
this gets a bit tricky because you need to use my sine/cosine data tables and
it's a pain to work with negative numbers in ASM).  Just remember that when
you make a program, eventually you're going to look back at it and say "What
was I thinking?" then you proceed to rewrite the whole program, making it less
than 1/2 the size of the original, and adding half a dozen new features.


-Dave