Big Ma's House

With your Big Fat Lazer Cannon, defend Big Ma's House from the Little White Men. If the Little White Men reaches the end of the Screen it drops a Bomb on the defences of Big Ma's House, on the 4th Bomb Drop it's Game Over.  Shoot the Little White Men with your Fine Lazer, but be careful because you only get 3 shots, it you shoot them your score is incremented and shots fire restored to 3, otherwise your number of shots is only restored after a Bomb is dropped.

Controls: <- Left Right -> Joystick, Fire Button to Lazer.

Requirements:

Winape 2.0 Alpha 18 or Later
Or other emulator with CDT support.

Loading:

Select "Settings", "Memory" and in the ROMs Column, Lower becomes "OS464" with Upper 0 set to "BASIC1-0", by default Lower is "OS6128" with Upper 1 set to "BASIC1-1" and Upper 7 set to "AMSDOS" or "PARADOS". Loading Big Ma's House will vary depending on if Upper 7 ROM is or isn't present, an unexpanded 464 for example won't have any ROMs in Upper 7, and it can be selected as "(Emply - Same as Upper 0)".

Loading: Select "File", "Tape" & "Show Tape Control", use "Open" on the Tape Control pannel to select the directory and select the 'Big Ma's House.cdt' file. Without closing the Tape Control box, Return to the Emulator, if ROMs are present in Upper 7 type |TAPE to switch to Tape Mode, otherwise RUN" or press CTRL+Keypad Enter and press any key, return to the tape control window & click the Black "Play" icon, once the game has loaded the Stop Button Icon can be used and Eject to Eject the CDT image.

Coding:

Big Ma's House makes use of the Amstrads Code set in order to get the game functioning in the PUR-120 category to access MODE, INK, SYMBOL and the Graphical position of a Graphic. Simple Animation is created by alternating between the redefined Characters, this is done in Line 9 where c = NOT c-510, which causes variable c to alternate between 255 & 254.

1 - Setup Screen Mode & Palette using Control Codes and Regular Commands, Variables are set as Integers, variable 'i' holds the address for the Frame Flyback routine, allow me to call it later on without exceeding 120 Character Limit. More Control Codes to Redefine the Graphics and Draw the Initial Position of the Little White Man.

2 - Variables g checks when the little white man reaches the edge of the screen.
              h is the position of the bomb.
              c alternates between 254..255 to draw the man.
              h$ reads the DATA of Big Ma's House from Line 5.
    The Rest of Line 2 Focuses on Drawing the House Graphically.
3 - Carries on from Line 2 to Draw The House. I'm able to make use of a Single NEXT to deal with the Nested Loop from Line 2 to save some space.
    Variables x,y = Big Cannon position,
              u,v = Lazer position,   
              s   = destination of Lazer,
              w   = position of Little White Man,
              k   = shots remaining,
              q   = check if lazer below Man,
              o   = checks if Fire is pressed.
    Subroutine Line 10 to PRINT Cannon,
              d   = position to drop the Bomb from,
    Main Game Loop
              f   = acts as an flag for the many WHILE loops, so it acts like an IF.
              r   = contains the value from Joystick Movement.

4 - Checks if Fire is Pressed and if shots are remaining quickly draw and undraw Line. IF little man is below Lazer Delete Man, restore number of shots remaining, move man to the beginning (w=0) and force flag (f=1) to exit WHILE loop.

5 - Check if Left Joystick, x=MAX(x,0) to prevent x from going below 0, as long as x is greater than 0, subtract 32 from x (Big Cannon position) & u (Lazer x-position), goto Subroutine 10 to update position. The DATA on the rest of this line is used to draw the House.

6 - Initial Routine checks if k=3 and Little Man is positioned at 0, if so has just been Zapped, so this updates the Score. As usual 'f' is the flag, so force exit and proceed to Check if Right Joystick has been Pressed, if so, check that x is below 384 from x=MIN(x,384) and update positions according and draw new position.

7 - Update position of little white man, call frame flyback, if man has reached designed position to drop bomb, goto subroutine 8 to drop bomb, exit then check if d = 152, if it does Game Over, Keyboard Buffer is Flushed (CALL a) and Waits for Keypress (CALL b) and RUN used to start a new game, if d is not equal to 152, d is restored to initial position using variable 'j' (initialised on line 10). The Main Game Loop finishes on this line, with lines 8,9 & 10 used as subroutines.

8 - Bomb Dropping Subroutine, WHILE loop tests if ink 0 is found and if so, continue to drop bomb, a little sound is added here for it, when WHILE TEST finds a different colour, exit loop and PRINT a black which removes a little bit of the defence barrier a line at a time. The Number of Shots Fire is restored after this.

9 - Man Animation Subroutine, Initially prints one man, c is used to switch characters, x-coordinate position of man is updated with the 'w' variable, if 'w' equals 640, then make w=4 and then print new position of man.

10 - Variable a = Reset Keyboard Buffer
              b = Wait for Keypress
              j = is used to restore d variable for the position of the bomb
     Print Big Cannon Subroutine, Print Top as Bright White and Bottom as White (Grey).
