How does one comment their main program and functions? I've heard good coders have default templates to help them describe their programs and functions. As I am forced to rewrite my engine I've come up with these examples below. How do you (more savvy) coders comment your code? Is this overkill or just right?
Code:
' PROGRAM NAME:
' SpelunkKingR3_0000.bex (Spelunk King Third Engine Rewrite)
' Filename convention is Game Name + Engine Revision + Build
'
' DESCRIPTION:
' First builds worked off of 22x22 tile chunk scrolling/map loading strategy.
' Second build focused on using 16x16 map chunks and using 64x64 tile collision map.
' This build will resize collision map entries to player sprite size (16x16 pixels)
' Also will feature integration of 16x16 tile map chunk scrolling/loading.
'
' BUILD SETTINGS:
' Assumes [X] Make All Variables in Subs/Functions Global
'
' STYLE CONVENTIONS:
' COMMANDS should be in upppercase. Labels should be uppercase for first letter in words.
' variables should be in all lowercase.
' obj_ denotes array for game objects such as players and monsters that have multiple attributes.
' spr_ indicates sprite and tile data
' pal_ is palette data
' Major sections in program get 2 lines of white space and a "** [Section Purpose] **" comment.
'
' SPECIAL THANKS (No particular order):
' The BEX community. SegaExtreme forums. Chilly Willy. Moon. Elusive. Damainman69. DevSter.
Code:
' COMMAND NAME:
' DRAWBLOCK
'
' DESCRIPTION:
' Draw 16x16 pixel object and apply change to collision map
'
' ARGUMENTS:
' dbn is the tile to draw and insert into tile buffer
' dbx is the horizontal 16x16 pixel block coordinate
' dby is the vertical 16x16 pixel block coordinate