CoCo Cosmic Aliens 0.13 with source code discussion
The latest iteration of CoCo Cosmic Aliens adds a game over/attract mode, and include double buffering again.
Progress is being made, but not as much as I had hoped for this version, but progress nonetheless.
The ability to die now exists. An initial high score of 10,000 points has been added to the game, and the ability to beat the high score now exists.
The extra life routine has been tweaked. Originally Extra life was first awarded at 3,000 points and would increment by 3,000 each time. I’ve tweaked that to increment by “WAVE x 1,000” so if you get an extra life on WAVE 5, it would add 5,000 points to the next extra life you’d receive, etc.
I’ve decided to give a peek into the source code/logic and routines in this video preview, I’ll also share the actual text of my “cheat sheet” document in this post:
Here are my programming crib notes:
Top Minimum location = 16 (Y) Bottom Maximum location 159 (Y) 16x12 grid using full 16x16 blocks for cells Pmode 1,1-1,2=page1 Pmode 1,3-1,4=page2 pmode 1,5-1,6=page3 pmode 1.7-1,8=page4 GET/PUT variables: A1-A8=Aliens, R1-R5=Rocks, CR=Blank space TL=TOP LINE, BLANK OUT STATUS BAR EX=Explosion, SP=Spaceship, UF=UFO, L=Laser, B=Bomb CA=Current Alien, MA=Maximum Aliens ES=Enemy Sate (which enemy to display, of the 8 available sprites) FB=Fire Button, Peek 65280 AX,AY(8) = alien x/y coordinates BX,BY(8) = bomb x/y coordinates BS(8)=Bomb State ON/OFF CB=CURRENT BOMB RX,RY(8) = Rock X/Y coordinates SX,SY(8) = Shot X/Y coordinates SS(8)=Shot State ON/OFF RL(8)=Rock Lives RF(8)=Rock Falling Rate UX,UY=UFO X/Y Coordinates, US=UFO STATE X1,X2(15),Y1,Y2(15), ABSOLUTE X/Y COORDINATES OF SPRITE LOCATIONS TX,TY(32) TEXT X/Y COORDINATES PS=PLAYER SCORE WV=WAVSAVEE SR=SHIPS REMAINING EL=EXTRA LIFE POINTS TO REACH Joystick: Peek(65280) 126/254=right buttonLIST 125/253=left button 100-110 SET INITIAL VARIABLES + RESET ALIEN POSITIONS 120 CLEAR SCREEN START GAME:CLEAR SCREEN, INCREMENT WAVES/ALIENS UPDATE STATUS BAR 139 MAIN GAME LOOP 205 ALIENS CHANGE DIRECTION 265-300 ALIENS CHANGE DIRECTIONS 305-340 PUT ONE OF 8 ALIENS ON SCREEN 345 TURN LASER SHOT ON 365 PUT LASER SHOT ON SCREEN 390 TURN ON BOMB DROP 410 BOMB FALLING 440 SPACESHIP HIT 470 BOMB HIT 495 ALIEN HIT LASER 521 LASER HIT ALIEN 525 NULIFY LASER SHOT 580 RENDER TOP STATUS BAR 581 UPDATE SCORE 582 UPDATE WAVE 583 UPDATE SHIPS 584 UPDATE GAME OVER 585 UPDATE HIGH SCORE 590 TEXT RENDER 605 PCOPY COMMAND 610 REFRESH ALIENS/SCREEN 615 RESET BACKGROUND ARRAY 620 INCREMENT WAVE COUNTER 625 INCREMENT/CYCLE ENEMY IMAGE 630 (RE)SET ENEMY STARTING POINTS 635 DECREASE ALIENS LIST 640 JOYSTICK ROUTINE/SPACESHIP PUT 650 UFO ENABLE 655 UFO MOVE LEFT/RIGHT 670 UFO HIT 680 EARN EXTRA LIFE 685 ERASE UFO 686 PUT UFO 690 WAVE BONUS