* * * * * * * * * * * * * * * * * * * * * Ultra-Kit: BLOCKOUT * * * * * * * * * * * * * * * * * * * * *---------------------------------------------------------------------- * * Task bugle * * This task plays a "bugle" call. * *---------------------------------------------------------------------- * * Task booboo * * This task makes a booboo sound. * *---------------------------------------------------------------------- * * Task pop * * This task makes a brief "Pop" sound. * *---------------------------------------------------------------------- * * Task border * * Draws a 20-pixel gray frame around the outside of the screen. * *---------------------------------------------------------------------- * * Task tile (Int x, Int y, Int color) * * Draws a 40x20 colored square tile at the specified tile * coordinates. * (9 <= color <= 14) * (1 <= x <= 15, 1 <= y <= 22) * * If color < 0, tile is erased. * *---------------------------------------------------------------------- * * Task zaptile (Int num, Int pdl, Int wall, Int other) * * Erases any colored tile currently in contact with the ball. * Also reports contact status with the walls and with the paddle. * * Returns with - * num: The number of tiles erased * pdl: 0 = paddle is not in contact with the ball * 1 = paddle is currently in contact with the ball * wall: 0 = no wall is currently in contact with the ball * 1 = north wall is currently in contact with the ball * 2 = east wall is currently in contact with the ball * 3 = northeast corner is currently in contact with the ball * 4 = south wall is currently in contact with the ball * 6 = southeast corner is currently in contact with the ball * 8 = west wall is currently in contact with the ball * 9 = northwest corner is currently in contact with the ball * 12 = southwest corner is currently in contact with the ball * other: 0 = nothing else is currently in contact with the ball * 1 = something else is currently in contact with the ball * *---------------------------------------------------------------------- * * Task paddle (Int x, Int y, Int len) * * Draws/updates the game paddle on the screen. * * Enter with - * x,y: The coordinates of the center of the paddle * len: The half-length of the paddle * * Note: The y-coordinate of the paddle must remain constant * Note: More than one paddle is allowed (each at a different * y-coordinate) but the x-coordinates and sizes of all * paddles must be identical * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Vectors & Angles * * * * All vectors (mentioned below) are unit vectors of length 1 pixel, * * and have angles measured in units of "quants". (65536 quants = * * 360 degrees.) Angles are measured clockwise from "north". * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Task moveball (Float x, Float y, Int vector) * * Moves the ball from its current position (bouncing off any * tiles, walls, or the paddle). * * Enter with - * x,y: Current coordinates of the ball * vector: Requested direction (in quants) * * Returns with - * x,y: New coordinates of the ball * vector: Actual direction (in quants) * *---------------------------------------------------------------------- * * Task english (Int vector) * * Task english (Int curve, Int max, Int vector) * * Produces the effect of a paddle with a slight amount of convex * curvature (so that the ball doesn't always bounce off the paddle * with exactly the same angle all the time). * * Enter with - * curve: A number indicating the amount of curvature (0 = flat paddle) * [If not specified, uses a default value of 10] * max: The maximum angle (in quants) at which the ball is allowed to * leave the paddle * [If not specified, uses a default value of 12000] * vector: The ball's current vector (in quants) * * Returns with - * vector: The ball's new vector (in quants) * * IMPORTANT: The ball MUST be currently in contact with the paddle when * this task is called, or else unusual ball motion will occur! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Task square (Int x, Int y, Int color) * * Draws a 20x20 colored square tile at the specified "square" coordinates. * (0 <= x <= 31, 0 <= y <= 23) * * If color < 0, square is erased. * *---------------------------------------------------------------------- * * Task zapsquare (Int num) * * Erases any colored square currently in contact with the ball. * (Black, white, and gray squares are not affected.) * * Returns with - * num: The number of squares erased * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *