;``````````````````````````````````````````````````````````````` ; ; If this program will not compile for you, get the latest ; version of batari Basic: ; ; http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#gettingstarted ; ;*************************************************************** ;*************************************************************** ; ; Kernel setup. ; includesfile multisprite_bankswitch.inc include fixed_point_math.asm set tv ntsc set kernel multisprite set romsize 32kSC set optimization speed set smartbranching on set optimization inlinerand ;*************************************************************** ; ; Variable aliases go here (DIMs). ; ; You can have more than one alias for each variable. ; If you use different aliases for bit operations, ; it's easier to understand and remember what they do. ; ; I start variable aliases with one underscore so I won't ; have to worry that I might be using bB keywords by mistake. ; I also start labels with two underscores for the same ; reason. The second underscore also makes labels stand out ; so I can tell at a glance that they are labels and not ; variables. ; ; Use bit operations any time you need a simple off/on ; variable. One variable essentially becomes 8 smaller ; variables when you use bit operations. ; ; I start my bit aliases with "_Bit" then follow that ; with the bit number from 0 to 7, then another underscore ; and the name. Example: _Bit0_Reset_Restrainer ; ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Keeps the reset switch from repeating when pressed. ; dim _Bit0_Reset_Restrainer = a ;*************************************************************** ;*************************************************************** ; ; PROGRAM START/RESTART ; __Start_Restart ;*************************************************************** ; ; Sets Player colors. Must always be within the "Main Loop" ; COLUP0 = $B6 : COLUP1 = $44 : _COLUP1 = $44 ; COLUP2 = $78 : COLUP3 = $5C : COLUP4 = $FA : COLUP5 = $B8 ;**************************************************************** ; ; set players locations ; player0x = 77 : player0y = 46 : player1x = player0x + 8 : player1y = player0y ; player1x = 85 : player1y = 46 ; Red Ralph player2x = 141 : player2y = 58 ; Blue Leo player3x = 28 : player3y = 30 ; Purple Don player4x = 141 : player4y = 16 ; Orange Mike ;*************************************************************** ;*************************************************************** ; ; MAIN LOOP (MAKES THE PROGRAM GO) ; Also used for unpause the game ; __Main_Loop ;*************************************************************** ; ; Sets Player colors. Must always be within the "Main Loop" ; COLUP0 = $B6 ;*************************************************************** ; ; Player0 Controls ; if joy0up then player0y = player0y + 1 : COLUP1 = $44 : _COLUP1 = $44 if joy0down then player0y = player0y - 1 : COLUP1 = $78 : _COLUP1 = $78 if joy0left then player0x = player0x - 1 : COLUP1 = $5C : _COLUP1 = $5C if joy0right then player0x = player0x + 1 : COLUP1 = $54 : _COLUP1 = $54 player1x = player0x + 8 : player1y = player0y ;**************************************************************** ; ; Set up playfield and players ; gosub __Main_Turtle gosub __Turtles ;*************************************************************** ; ; Reset switch check and completion of main loop. ; ; Any Atari 2600 program should restart when the reset ; switch is pressed. It is part of the usual standards ; and procedures. ; ;``````````````````````````````````````````````````````````````` ; Turns off reset restrainer bit and jumps to beginning of ; main loop if the reset switch is not pressed. ; if switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Start_Restart ;``````````````````````````````````````````````````````````````` ; Jumps to beginning of main loop if the reset switch hasn't ; been released after being pressed. ; if _Bit0_Reset_Restrainer{0} then goto __Main_Loop ;*************************************************************** ; ; Displays the screen. ; drawscreen ;*************************************************************** ; ; Return to the start of the "__Main_Loop" ; goto __Main_Loop __Main_Turtle player0: %01111100 %00100000 %00111000 %01111000 %00000000 %01111000 %00000000 %01100110 %10101111 %11101001 %10101100 %11101100 %10100000 %01011110 %00111110 end return thisbank __Turtles player1: %00000000 %00000000 %00000000 %00000000 %01111000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00011100 %00100000 end return thisbank