' Vortex. ' Copyright (C) 2001, Allan Crossman. ' ' This program is free software; you can redistribute it and/or ' modify it under the terms of the GNU General Public License as ' published by the Free Software Foundation; either version 2 of ' the License, or (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; ' If not, write to the Free Software Foundation, Inc., ' 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Many improvements made by Lisa Lovelace. ' And some later modifications by Allan Crossman again. ' ' To play: ' ' Move with W, S, A, D. ' Move the crosshairs with the mouse (or the arrow keys in keyboard only mode) ' Shoot with the mouse button (or the up arrow in keyboard only mode) ' ' In keyboard only mode, press command or option to fire fast or slow shots. ' In mouse mode, shot speed is dependant on where the crosshairs are. ' ' Press escape to quit. ]ignorecase on ]rsrcmerge "Vortex.rsrc" ' Remove the console, set the version number, and call the intro routine... hide console version$ = "LL/AC 1.1" textfont "Chicago" disable break init sound goto Swarmz ' Which also sets up the console, etc... ' With the intro done, the game begins... Main: gosub PrepareForGame ' Done only once. Restart: ' Which is also jumped to after Game Over. gosub Startup gosub LoadMusic gosub Level1 ' You can cheat by commenting levels out. gosub Level2 gosub Level3 gosub Level4 gosub Level5 gosub Level6 goto EndGame PrepareForGame: if screen width <> 640 or screen height <> 480 then set screen to console forecolor 65535, 65535, 65535 line top_left_x - 1, top_left_y - 1, top_left_x + width, top_left_y - 1 line top_left_x - 1, top_left_y - 1, top_left_x - 1, top_left_y + depth line top_left_x - 1, top_left_y + depth, top_left_x + width, top_left_y + depth line top_left_x + width, top_left_y - 1, top_left_x + width, top_left_y + depth end if virtue = init screen(0, 0, width, depth) set screen to virtue max_player_speed = 10 max_player_shots = 24 ' How many shots on screen at once? player_shot_length = 44 ' How long each shot lasts. max_enemy_shots = 10 ' For all and any shooting enemies. enemy_shot_length = 70 cdtime = 3 ' Cool down for player weapon. bullets_in_cartridge = 24 reload_time = 25 cannon_repair_time = 18 max_guards = 7 ' guard ring of shooter scdtime = 15 ' Cool down for shooter weapon. strcdtime = 22 ' Cool down for strafer weapon. invultime = 15 ' Player goes partially invulnerable for this ' length of time in certain circumstances. maxph = 200 ' Maximum player health. hardedge = 10 ' Which is not so hard now, applying only to the player... stars = 250 ' Maximum stars on screen at any one time. max_roids = 10 max_explosions = 5 breakuppieces = 3 ' How many smaller pieces a bouncer breaks into. max_big_bouncers = 6 max_med_bouncers = max_big_bouncers * breakuppieces max_small_bouncers = max_big_bouncers * breakuppieces * breakuppieces dim SB_pos(max_small_bouncers, 2) dim SB_speed(max_small_bouncers, 2) dim SB_exists(max_small_bouncers) dim MB_pos(max_med_bouncers, 2) dim MB_speed(max_med_bouncers, 2) dim MB_exists(max_med_bouncers) dim BB_pos(max_big_bouncers, 2) dim BB_speed(max_big_bouncers, 2) dim BB_exists(max_big_bouncers) dim roid_pos(max_roids, 2) dim roid_speed(max_roids, 2) dim roid_exists(max_roids) dim player_shot_pos(max_player_shots, 2) dim player_shot_speed(max_player_shots, 2) dim player_shot_exists(max_player_shots) dim player_shot_born(max_player_shots) dim enemy_shot_pos(max_enemy_shots, 2) dim enemy_shot_speed(max_enemy_shots, 2) dim enemy_shot_exists(max_enemy_shots) dim enemy_shot_born(max_enemy_shots) dim explosion_pos(max_explosions, 2) dim explosion_size(max_explosions) dim starpos(stars, 2) dim starspeed(stars) dim starbrightness(stars) for a = 1 to stars starspeed(a) = 0 next a musicwait = 10 ' Quicktime is called once every n ticks (n = musicwait) files = file count (":Vortex Music") ' === Prepare Sprites === set sprite render port to virtue no sprite background set sprite mask color to 0,0,0 temp = init screen (0,0,100,100) set screen to temp dim spr_explosion(10) dim spr_player(12) dim spr_Follower(2) dim explosion_sort_table(max_explosions) dim offsetX_explosion(10) dim offsetY_explosion(10) dim spr_P_shot(max_player_shots) dim spr_guard(max_guards) dim guard_exists(max_guards) dim offsetX_guard(max_guards) dim offsetY_guard(max_guards) ' Explosion Sprite for a=1 to 10 cls explosion_intensity = cos(a/8) forecolor 65535 * explosion_intensity, 65535 * (explosion_intensity)^2, 65535 * (explosion_intensity)^6 fcircle 3*a, 3*a, 3*a spr_explosion(a) = grab sprite (0, 0, 6*a, 6*a) offsetX_explosion(a) = 3*a offsetY_explosion(a) = 3*a next ' Roid Sprite cls forecolor 22000, 23500, 30000 fcircle 8, 8, 8 spr_Roid = grab sprite (0, 0, 16, 16) offsetX_Roid = 8 offsetY_Roid = 8 ' SB Sprite cls forecolor 25000, 17500, 17500 fcircle 5, 5, 5 spr_SB = grab sprite (0, 0, 10, 10) offsetX_SB = 5 offsetY_SB = 5 ' MB Sprite cls forecolor 25000, 17500, 17500 fcircle 8, 8, 8 spr_MB = grab sprite (0, 0, 16, 16) offsetX_MB = 8 offsetY_MB = 8 ' BB Sprite cls forecolor 25000, 17500, 17500 fcircle 11, 11, 11 spr_BB = grab sprite (0, 0, 22, 22) offsetX_BB = 11 offsetY_BB = 11 ' Enemy Shot Sprite cls forecolor 65535, 45000, 0 line 0,1, 2,1 line 1,0, 1,2 spr_E_shot = grab sprite (0, 0, 3, 3) offsetX_E_shot = 1 offsetY_E_shot = 1 ' Player Shot Sprite cls forecolor 10000, 45000/3, 65535/3 line 0,0, 6,6 line 0,6, 6,0 line 3,0, 3,6 line 0,3, 6,3 forecolor 0, 45000, 65535 line 2,3, 4,3 line 3,2, 3,4 spr_P_shot(0) = grab sprite (0, 0, 7,7) offsetX_P_shot = 3 offsetY_P_shot = 3 for a = 1 to max_player_shots spr_P_shot(a) = clone sprite(spr_P_shot(0)) next ' Player Sprite cls forecolor 65535, 0, 0 rect 2, 2, 12, 12 forecolor 65535, 65535, 0 fellipse 7, 7, 3, 7 fellipse 7, 7, 7, 3 spr_Player(0) = grab sprite (0, 0, 14, 14) offsetX_Player = 7 offsetY_Player = 7 for a=1 to 12 cls forecolor 65535 * (1 - a/12), 65535, 65535 rect 2, 2, 12, 12 forecolor 65535, 65535 * (1 - a/12), 65535 fellipse 7, 7, 3, 7 fellipse 7, 7, 7, 3 spr_Player(a) = grab sprite (0, 0, 14, 14) next ' follower Sprites (0-2) cls forecolor 0, 65535, 0 circle 8, 8, 8 circle 8, 8, 7 circle 8, 8, 6 spr_follower(2) = grab sprite (0, 0, 16, 16) offsetX_follower = 8 offsetY_follower = 8 cls forecolor 65535, 65535, 0 circle 8, 8, 8 circle 8, 8, 7 circle 8, 8, 6 spr_follower(1) = grab sprite (0, 0, 16, 16) cls forecolor 65535, 0, 0 circle 8, 8, 8 circle 8, 8, 7 circle 8, 8, 6 spr_follower(0) = grab sprite (0, 0, 16, 16) ' Shooter Sprite cls forecolor 30000, 0, 65535 fellipse 12, 7, 12, 7 spr_Shooter = grab sprite (0, 0, 24, 14) offsetX_Shooter = 12 offsetY_Shooter = 7 ' guard Sprite (added feature) for a=1 to max_guards cls forecolor 65535*(2-a/max_guards)/5, 0, 65535*(2-a/max_guards)/5 fellipse 12+ a*2, 7+a*2, 12+ a*2, 7+a*2 forecolor 0,0,0 for a2=0 to 2*(12+ a*2) ' pseudo transparency for a3 = 0 to 2*(12+ a*2) if (a2+a3) mod 2 = 0 then plot a2,a3 next next forecolor 65535*(2-a/max_guards)/3, 0, 65535*(2-a/max_guards)/3 ellipse 12+ a*2, 7+a*2, 12+ a*2, 7+a*2 spr_guard(a) = grab sprite (0, 0, 2*(12+ a*2), 2*(7+a*2)) offsetX_guard(a) = 12 + a*2 offsetY_guard(a) = 7 + a*2 next ' Strafer Sprite cls forecolor 0, 65535, 45000 fcircle 8, 8, 8 spr_strafer = grab sprite (0, 0, 16, 16) offsetX_strafer = 8 offsetY_strafer = 8 ' Medkit Sprite cls medkit_pos_x = 8 medkit_pos_y = 6 forecolor 65535, 65535, 65535 rect medkit_pos_x - 8, medkit_pos_y - 6, medkit_pos_x + 8, medkit_pos_y + 6 forecolor 65535, 0, 0 rect medkit_pos_x - 7, medkit_pos_y - 5, medkit_pos_x + 7, medkit_pos_y + 5 forecolor 65535, 65535, 65535 rect medkit_pos_x - 3, medkit_pos_y - 1, medkit_pos_x + 3, medkit_pos_y + 1 rect medkit_pos_x - 1, medkit_pos_y - 3, medkit_pos_x + 1, medkit_pos_y + 3 spr_medkit = grab sprite (0, 0, 16, 12) offsetX_medkit = 8 offsetY_medkit = 6 set screen to virtue kill screen temp return Startup: ' Stuff which must be done every time a new game starts. gosub RandomNumber musicfile = int ((files * n) + 1) if musicfile > files then musicfile = files player_health = maxph bullets = bullets_in_cartridge bumped = 0 score = 0 return InitialiseLevel: player_speed_x = 0 player_speed_y = 0 player_pos_x = width / 2 player_pos_y = depth / 2 cooldown = 0 bullets = bullets_in_cartridge cannon_direction = -1.57 bumped = 0 for a = 1 to max_player_shots player_shot_exists(a) = 0 next a player_shots = 0 for a = 1 to max_enemy_shots enemy_shot_exists(a) = 0 next a enemy_shots = 0 for a = 1 to max_roids roid_exists(a) = 0 next a roids = 0 for a = 1 to max_small_bouncers SB_exists(a) = 0 next a SBs = 0 for a = 1 to max_med_bouncers MB_exists(a) = 0 next a MBs = 0 for a = 1 to max_big_bouncers BB_exists(a) = 0 next a BBs = 0 for a = 1 to explosions explosion_size(a) = 0 next a explosions = 0 follower_exists = 0 medkit_exists = 0 shooter_exists = 0 strafer_exists = 0 invulnerable = 0 if player_health = 0 then player_health = 1 start_score = score hidecursor return LevelIntro: cls textsize 24 for a = 1 to 65 step 2 forecolor a * 1000, 0, 0 text 270, 235, "Level " + str$(level) copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if playing then gosub Music wait 0.02 next a for a = 65 to 1 step -2 forecolor a * 1000, 0, 0 text 270, 235, "Level " + str$(level) copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if playing then gosub Music wait 0.02 next a return LevelComplete: ' I make no assumptions that all enemies are dead... for j = 1 to 50 starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckSBCollision gosub CheckMBCollision gosub CheckBBCollision gosub CheckRoidCollision gosub CheckFollowerCollision gosub CheckEnemyShotCollision gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckRoidDeath gosub CheckFollowerDeath gosub CheckShooterDeath gosub CheckStraferDeath gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveRoids gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub MoveStrafer gosub MoveMedkit gosub Display copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 next j if player_health < 1 then goto GameOver showcursor textsize 24 for a = 1 to 65 step 2 forecolor a * 1000, a * 1000, 0 text 195, 235, "Level " + str$(level) + " Complete!" copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if playing then gosub Music wait 0.02 next a for a = 65 to 1 step -2 forecolor a * 1000, a * 1000, 0 text 195, 235, "Level " + str$(level) + " Complete!" copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if playing then gosub Music wait 0.02 next a return EndGame: ' Comes about when player successfully completes game. if playing then stop movie mov close movie mov playing = 0 end if play rsrc 261 cls for a = 1 to 65 textsize 24 forecolor 0, a * 1000, 0 text 155, 235, "You survived the Vortex!" textsize 12 forecolor a * 1000, a * 1000, a * 1000 text 200, 270, "Click to replay. Press any key to end." copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 wait 0.02 next a goto GameOverWaitLoop PlayerQuits: ' When player hits esc during play... if playing then stop movie mov close movie mov playing = 0 end if showcursor play rsrc 260 player_health = 0 x = player_pos_x y = player_pos_y gosub AddExplosion for j = 1 to 50 cls gosub DrawExplosions gosub Starfield gosub MovePlayerShots gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckRoidDeath gosub CheckFollowerDeath gosub CheckShooterDeath gosub CheckStraferDeath gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveRoids gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub MoveStrafer gosub MoveMedkit gosub Display copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 gosub EndKillTime i = i + 1 next j for a = 1 to 65 textsize 24 forecolor a * 1000, 0, 0 text 150, 235, "What?! You want to quit?" textsize 12 forecolor a * 1000, a * 1000, a * 1000 text 200, 270, "Click to replay. Press any key to end." copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 wait 0.02 next a goto GameOverWaitLoop GameOver: ' When player dies. if playing then stop movie mov close movie mov playing = 0 end if showcursor play rsrc 260 player_health = 0 x = player_pos_x y = player_pos_y gosub AddExplosion for j = 1 to 50 cls gosub DrawExplosions gosub Starfield gosub MovePlayerShots gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckRoidDeath gosub CheckFollowerDeath gosub CheckShooterDeath gosub CheckStraferDeath gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveRoids gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub MoveStrafer gosub MoveMedkit gosub Display copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 gosub EndKillTime i = i + 1 next j for a = 1 to 65 textsize 24 forecolor 0, a * 1000, a * 500 text 190, 235, "Oops! You're dead..." textsize 12 forecolor a * 1000, a * 1000, a * 1000 text 200, 270, "Click to replay. Press any key to end." copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 wait 0.02 next a goto GameOverWaitLoop GameOverWaitLoop: ' Do we restart or end? if button then goto Restart if asc(inkey$) <> 0 then ' ie is any key down? cls ' Make sure no junk in corners... copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 set screen to console kill screen virtue if screen width <> 640 or screen height <> 480 then cls normal screen disable done ' Only do this now so that crashes before this give error. end end if goto GameOverWaitLoop MovePlayer: if peek(373) and 32 then ' W player_speed_y = player_speed_y - 0.75 end if if peek(372) and 2 then ' S player_speed_y = player_speed_y + 0.75 end if if peek(372) and 1 then ' A player_speed_x = player_speed_x - 0.75 end if if peek(372) and 4 then ' D player_speed_x = player_speed_x + 0.75 end if if peek(387) and 8 then cannon_direction = cannon_direction - 3.141593/180*10 ' Turn cannon left end if if peek(387) and 16 then cannon_direction = cannon_direction + 3.141593/180*10 ' Turn cannon right end if if player_speed_x > max_player_speed then player_speed_x = max_player_speed if player_speed_x < max_player_speed * -1 then player_speed_x = max_player_speed * -1 if player_speed_y > max_player_speed then player_speed_y = max_player_speed if player_speed_y < max_player_speed * -1 then player_speed_y = max_player_speed * -1 player_pos_x = player_pos_x + player_speed_x player_pos_y = player_pos_y + player_speed_y if player_pos_x < hardedge then player_pos_x = hardedge player_speed_x = player_speed_x * -1 play rsrc 258 end if if player_pos_x > width - hardedge then player_pos_x = width - hardedge player_speed_x = player_speed_x * -1 play rsrc 258 end if if player_pos_y < hardedge then player_pos_y = hardedge player_speed_y = player_speed_y * -1 play rsrc 258 end if if player_pos_y > depth - hardedge then player_pos_y = depth - hardedge player_speed_y = player_speed_y * -1 play rsrc 258 end if set sprite spr_player(bumped), player_pos_x - offsetX_player, player_pos_y - offsetY_player current_ship = spr_player(bumped) render sprite spr_player(bumped) if bumped then bumped = bumped - 1 return PlayerShoot: if cooldown > 0 then cooldown = cooldown - 1 if cooldown <= reload_Time/2 and bullets <= 0 then bullets = bullets_in_cartridge if (player_shots < max_player_shots) and (cooldown = 0) then if (((peek(387) and 64) <> 0) and keyboardcontrols) or button then a = 1 AssignPSLoop: if player_shot_exists(a) then a = a + 1 goto AssignPSLoop end if player_shots = player_shots + 1 cooldown = cdtime player_shot_exists(a) = 1 player_shot_born(a) = i player_shot_pos(a, 1) = player_pos_x player_shot_pos(a, 2) = player_pos_y player_shot_speed(a, 1) = (mousex - player_pos_x) / 8 player_shot_speed(a, 2) = (mousey - player_pos_y) / 8 if keyboardcontrols then if (peek(379) and 4) then ' with option key - slow shot player_shot_speed(a, 1) = cos(cannon_direction) * 1 player_shot_speed(a, 2) = sin(cannon_direction) * 1 else if (peek(378) and 128) then ' with cmd key - fast shot player_shot_speed(a, 1) = cos(cannon_direction) * 12 player_shot_speed(a, 2) = sin(cannon_direction) * 12 else player_shot_speed(a, 1) = cos(cannon_direction) * 6 player_shot_speed(a, 2) = sin(cannon_direction) * 6 end if end if else player_shot_speed(a, 1) = (mousex - player_pos_x) / 25 player_shot_speed(a, 2) = (mousey - player_pos_y) / 25 end if play rsrc 257 bullets = bullets -1 if bullets <= 0 then cooldown = cooldown + reload_time play rsrc 300 end if end if end if return MovePlayerShots: for a = 1 to max_player_shots if player_shot_exists(a) then if i - player_shot_born(a) > player_shot_length then player_shots = player_shots - 1 player_shot_exists(a) = 0 else player_shot_pos(a, 1) = player_shot_pos(a, 1) + player_shot_speed(a, 1) player_shot_pos(a, 2) = player_shot_pos(a, 2) + player_shot_speed(a, 2) wrkX = abs(player_shot_pos(a, 1) - width/2) wrkY = abs(player_shot_pos(a, 2) - depth/2) if wrkX > width/2 or wrkY > depth/2 then player_shots = player_shots - 1 player_shot_exists(a) = 0 end if end if if player_shot_exists(a) then set sprite spr_P_shot(a), player_shot_pos(a, 1) - offsetX_P_shot, player_shot_pos(a, 2) - offsetY_P_shot render sprite spr_P_shot(a) end if end if next a return Display: textsize 12 forecolor 65535, 65535, 0 text 24, 32, "Level " + str$(level) forecolor 0, 65535, 0 text 96, 32, "Score: " + str$(score) forecolor 0, 20000, 0 if player_health < 100 then forecolor 20000, 20000, 0 if player_health < 50 then forecolor 20000, 0, 0 rect 295 + player_health/2, 28, 295 + maxph/2, 30 forecolor 0, 65535, 0 if player_health < 100 then forecolor 65535, 65535, 0 if player_health < 50 then forecolor 65535, 0, 0 text 200, 32, "Shield Status: " rect 295, 28, 295 + player_health/2, 30 forecolor 0, 65535, 0 text 440, 32, "Bullets: " for bul_show = 1 to bullets rect 495 + bul_show * 4, 22, 495 + bul_show * 4+ 2, 32 next forecolor 0, 20000, 0 for bul_show = bullets + 1 to bullets_in_cartridge rect 495 + bul_show * 4, 22, 495 + bul_show * 4+ 2, 32 next ' Since Display is the last routine that draws, we can now save a screenshot... if inkey$ = " " then set screen to console ' for 1.7.1 or later (1 frame old) save pict "VortexScreenshot", 0, 0, width, depth wait key up set screen to virtue end if return UpdateCursor: if keyboardcontrols = 0 then getmousexy mousex, mousey mousex = mousex - top_left_x mousey = mousey - top_left_y else mousex = player_pos_x + cos(cannon_direction) * 40 mousey = player_pos_y + sin(cannon_direction) * 40 end if if mousex > width - 1 then mousex = width - 1 if mousex < 0 then mousex = 0 if mousey > depth - 1 then mousey = depth - 1 if mousey < 0 then mousey = 0 forecolor 30000, 65535, 30000 if cooldown > 0 then ' Idea stolen from HeadHunter. line mousex - 3, mousey - 3, mousex + 3, mousey + 3 line mousex - 3, mousey + 3, mousex + 3, mousey - 3 else line mousex - 4, mousey, mousex + 4, mousey line mousex, mousey - 4, mousex, mousey + 4 end if return CheckRoidCollision: for a = 1 to max_roids if roid_exists(a) then set sprite spr_Roid, roid_pos(a, 1) - offsetX_roid, roid_pos(a, 2) - offsetY_roid if sprite collides (current_ship, spr_Roid) then roid_exists(a) = 0 roids = roids - 1 player_health = player_health - 40 x = roid_pos(a, 1) y = roid_pos(a, 2) gosub AddExplosion player_speed_x = player_speed_x + ((player_pos_x - roid_pos(a, 1)) / 7) player_speed_y = player_speed_y + ((player_pos_y - roid_pos(a, 2)) / 7) play rsrc 301 ' added collide sound. bumped = 12 cooldown = cooldown + cannon_repair_time play rsrc 259 end if end if next a return CheckFollowerCollision: if follower_exists then set sprite spr_follower(follower_health), follower_pos_x - offsetX_follower, follower_pos_y - offsetY_follower if sprite collides (current_ship, spr_follower(follower_health)) then follower_exists = 0 player_health = player_health - 50 x = follower_pos_x y = follower_pos_y gosub AddExplosion player_speed_x = player_speed_x + ((player_pos_x - follower_pos_x) / 7) player_speed_y = player_speed_y + ((player_pos_y - follower_pos_y) / 7) play rsrc 301 bumped = 12 cooldown = cooldown + cannon_repair_time play rsrc 265 end if end if return CheckSBCollision: if invulnerable then return for a = 1 to max_small_bouncers if SB_exists(a) then set sprite spr_SB, SB_pos(a, 1) - offsetX_SB, SB_pos(a, 2) - offsetY_SB if sprite collides (current_ship, spr_SB) then SB_exists(a) = 0 SBs = SBs - 1 player_health = player_health - 30 x = SB_pos(a, 1) y = SB_pos(a, 2) gosub AddExplosion player_speed_x = player_speed_x + ((player_pos_x - SB_pos(a, 1)) / 9) player_speed_y = player_speed_y + ((player_pos_y - SB_pos(a, 2)) / 9) play rsrc 301 bumped = 12 cooldown = cooldown + cannon_repair_time play rsrc 259 end if end if next a return CheckMBCollision: if invulnerable then return for a = 1 to max_med_bouncers if MB_exists(a) then set sprite spr_MB, MB_pos(a, 1) - offsetX_MB, MB_pos(a, 2) - offsetY_MB if sprite collides (current_ship, spr_MB) then MB_exists(a) = 0 MBs = MBs - 1 player_health = player_health - 40 invulnerable = invultime ' Else we'd also hit the new SBs gosub MBBreakup x = MB_pos(a, 1) y = MB_pos(a, 2) gosub AddExplosion player_speed_x = player_speed_x + ((player_pos_x - MB_pos(a, 1)) / 7) player_speed_y = player_speed_y + ((player_pos_y - MB_pos(a, 2)) / 7) play rsrc 301 bumped = 12 cooldown = cooldown + cannon_repair_time play rsrc 259 end if end if next a return CheckBBCollision: if invulnerable then return for a = 1 to max_big_bouncers if BB_exists(a) then set sprite spr_BB, BB_pos(a, 1) - offsetX_BB, BB_pos(a, 2) - offsetY_BB if sprite collides (current_ship, spr_BB) then BB_exists(a) = 0 BBs = BBs - 1 player_health = player_health - 45 invulnerable = invultime ' Else we'd also hit the new MBs gosub BBBreakup x = BB_pos(a, 1) y = BB_pos(a, 2) gosub AddExplosion player_speed_x = player_speed_x + ((player_pos_x - BB_pos(a, 1)) / 5) player_speed_y = player_speed_y + ((player_pos_y - BB_pos(a, 2)) / 5) play rsrc 301 bumped = 12 cooldown = cooldown + cannon_repair_time play rsrc 259 end if end if next a return CheckEnemyShotCollision: for b = 1 to max_enemy_shots if enemy_shot_exists(b) then set sprite spr_E_shot, enemy_shot_pos(b, 1) - offsetX_E_shot, enemy_shot_pos(b, 2) - offsetY_E_shot if sprite collides (current_ship, spr_E_shot) then enemy_shot_exists(b) = 0 enemy_shots = enemy_shots - 1 player_health = player_health - 35 ' not draw explosion 'x = player_pos_x 'y = player_pos_y 'gosub AddExplosion play rsrc 264 bumped = 12 cooldown = cooldown + cannon_repair_time end if end if next b return Starfield: for a = 1 to stars if starspeed(a) then starpos(a, 1) = starpos(a, 1) + (((starpos(a, 1) - width / 2) / 20) * starspeed(a)) starpos(a, 2) = starpos(a, 2) + (((starpos(a, 2) - depth / 2) / 20) * starspeed(a)) if starpos(a, 1) < 0 then starspeed(a) = 0 if starpos(a, 1) > width - 1 then starspeed(a) = 0 if starpos(a, 2) < 0 then starspeed(a) = 0 if starpos(a, 2) > depth - 1 then starspeed(a) = 0 else gosub RandomNumber if n < 0.03 then gosub RandomNumber starspeed(a) = (n + 0.01) * 1.5 gosub RandomNumber starbrightness(a) = (n * 45000) + 20000 gosub RandomNumber starpos(a, 1) = (width / 2) + (n - 0.5) * 80 gosub RandomNumber starpos(a, 2) = (depth / 2) + (n - 0.5) * 70 else starspeed(a) = 0 end if end if if starspeed(a) then forecolor starbrightness(a), starbrightness(a), starbrightness(a) plot starpos(a, 1), starpos(a, 2) end if next a return AddRoid: if roids < max_roids then a = 1 AssignRoid: if roid_exists(a) then a = a + 1 goto AssignRoid end if roids = roids + 1 roid_exists(a) = 1 gosub RandomNumber if n < 0.25 then goto RoidFromTop end if if n < 0.5 then goto RoidFromBottom end if if n < 0.75 then goto RoidFromLeft else goto RoidFromRight end if end if return RoidFromTop: gosub RandomNumber roid_pos(a, 1) = n * width roid_pos(a, 2) = 0 gosub RandomNumber if roid_pos(a, 1) > width / 2 then roid_speed(a, 1) = (n - 0.25) * 12 * -1 else roid_speed(a, 1) = (n - 0.25) * 12 end if gosub RandomNumber roid_speed(a, 2) = (n * 5) + 4 return RoidFromBottom: gosub RandomNumber roid_pos(a, 1) = n * width roid_pos(a, 2) = depth - 1 gosub RandomNumber if roid_pos(a, 1) > width / 2 then roid_speed(a, 1) = (n - 0.25) * 12 * -1 else roid_speed(a, 1) = (n - 0.25) * 12 end if gosub RandomNumber roid_speed(a, 2) = (n * -5) - 4 return RoidFromLeft: gosub RandomNumber roid_pos(a, 1) = 0 roid_pos(a, 2) = n * depth gosub RandomNumber if roid_pos(a, 2) > depth / 2 then roid_speed(a, 2) = (n - 0.25) * 12 * -1 else roid_speed(a, 2) = (n - 0.25) * 12 end if gosub RandomNumber roid_speed(a, 1) = (n * 5) + 4 return RoidFromRight: gosub RandomNumber roid_pos(a, 1) = width - 1 roid_pos(a, 2) = n * depth gosub RandomNumber if roid_pos(a, 2) > depth / 2 then roid_speed(a, 2) = (n - 0.25) * 12 * -1 else roid_speed(a, 2) = (n - 0.25) * 12 end if gosub RandomNumber roid_speed(a, 1) = (n * -5) - 4 return MoveRoids: for a = 1 to max_roids if roid_exists(a) then ' Initial check... roid_pos(a, 1) = roid_pos(a, 1) + roid_speed(a, 1) roid_pos(a, 2) = roid_pos(a, 2) + roid_speed(a, 2) wrkX = abs(roid_pos(a, 1) - width/2) wrkY = abs(roid_pos(a, 2) - depth/2) if wrkX > width/2 or wrkY > depth/2 then roid_exists(a) = 0 roids = roids - 1 end if if roid_exists(a) then set sprite spr_Roid, roid_pos(a, 1) - offsetX_roid, roid_pos(a, 2) - offsetY_roid render sprite spr_roid end if end if next a return AddSB: if SBs < max_small_bouncers then a = 1 AssignSB: if SB_exists(a) then a = a + 1 goto AssignSB end if SBs = SBs + 1 SB_exists(a) = 1 gosub RandomNumber if n < 0.25 then goto SBFromTop end if if n < 0.5 then goto SBFromBottom end if if n < 0.75 then goto SBFromLeft else goto SBFromRight end if end if return SBFromTop: gosub RandomNumber SB_pos(a, 1) = n * width SB_pos(a, 2) = 0 gosub RandomNumber if SB_pos(a, 1) > width / 2 then SB_speed(a, 1) = (n - 0.35) * 12 * -1 else SB_speed(a, 1) = (n - 0.35) * 12 end if gosub RandomNumber SB_speed(a, 2) = (n * 5) + 4 return SBFromBottom: gosub RandomNumber SB_pos(a, 1) = n * width SB_pos(a, 2) = depth - 1 gosub RandomNumber if SB_pos(a, 1) > width / 2 then SB_speed(a, 1) = (n - 0.35) * 12 * -1 else SB_speed(a, 1) = (n - 0.35) * 12 end if gosub RandomNumber SB_speed(a, 2) = (n * -5) - 4 return SBFromLeft: gosub RandomNumber SB_pos(a, 1) = 0 SB_pos(a, 2) = n * depth gosub RandomNumber if SB_pos(a, 2) > depth / 2 then SB_speed(a, 2) = (n - 0.35) * 12 * -1 else SB_speed(a, 2) = (n - 0.35) * 12 end if gosub RandomNumber SB_speed(a, 1) = (n * 5) + 4 return SBFromRight: gosub RandomNumber SB_pos(a, 1) = width - 1 SB_pos(a, 2) = n * depth gosub RandomNumber if SB_pos(a, 2) > depth / 2 then SB_speed(a, 2) = (n - 0.35) * 12 * -1 else SB_speed(a, 2) = (n - 0.35) * 12 end if gosub RandomNumber SB_speed(a, 1) = (n * -5) - 4 return AddMB: if MBs < max_med_bouncers then a = 1 AssignMB: if MB_exists(a) then a = a + 1 goto AssignMB end if MBs = MBs + 1 MB_exists(a) = 1 gosub RandomNumber if n < 0.25 then goto MBFromTop end if if n < 0.5 then goto MBFromBottom end if if n < 0.75 then goto MBFromLeft else goto MBFromRight end if end if return MBFromTop: gosub RandomNumber MB_pos(a, 1) = n * width MB_pos(a, 2) = 0 gosub RandomNumber if MB_pos(a, 1) > width / 2 then MB_speed(a, 1) = (n - 0.35) * 10 * -1 else MB_speed(a, 1) = (n - 0.35) * 10 end if gosub RandomNumber MB_speed(a, 2) = (n * 5) + 4 return MBFromBottom: gosub RandomNumber MB_pos(a, 1) = n * width MB_pos(a, 2) = depth - 1 gosub RandomNumber if MB_pos(a, 1) > width / 2 then MB_speed(a, 1) = (n - 0.35) * 10 * -1 else MB_speed(a, 1) = (n - 0.35) * 10 end if gosub RandomNumber MB_speed(a, 2) = (n * -5) - 4 return MBFromLeft: gosub RandomNumber MB_pos(a, 1) = 0 MB_pos(a, 2) = n * depth gosub RandomNumber if MB_pos(a, 2) > depth / 2 then MB_speed(a, 2) = (n - 0.35) * 10 * -1 else MB_speed(a, 2) = (n - 0.35) * 10 end if gosub RandomNumber MB_speed(a, 1) = (n * 5) + 4 return MBFromRight: gosub RandomNumber MB_pos(a, 1) = width - 1 MB_pos(a, 2) = n * depth gosub RandomNumber if MB_pos(a, 2) > depth / 2 then MB_speed(a, 2) = (n - 0.35) * 10 * -1 else MB_speed(a, 2) = (n - 0.35) * 10 end if gosub RandomNumber MB_speed(a, 1) = (n * -5) - 4 return AddBB: if BBs < max_big_bouncers then a = 1 AssignBB: if BB_exists(a) then a = a + 1 goto AssignBB end if BBs = BBs + 1 BB_exists(a) = 1 gosub RandomNumber if n < 0.25 then goto BBFromTop end if if n < 0.5 then goto BBFromBottom end if if n < 0.75 then goto BBFromLeft else goto BBFromRight end if end if return BBFromTop: gosub RandomNumber BB_pos(a, 1) = n * width BB_pos(a, 2) = 0 gosub RandomNumber if BB_pos(a, 1) > width / 2 then BB_speed(a, 1) = (n - 0.35) * 8 * -1 else BB_speed(a, 1) = (n - 0.35) * 8 end if gosub RandomNumber BB_speed(a, 2) = (n * 5) + 4 return BBFromBottom: gosub RandomNumber BB_pos(a, 1) = n * width BB_pos(a, 2) = depth - 1 gosub RandomNumber if BB_pos(a, 1) > width / 2 then BB_speed(a, 1) = (n - 0.35) * 8 * -1 else BB_speed(a, 1) = (n - 0.35) * 8 end if gosub RandomNumber BB_speed(a, 2) = (n * -5) - 4 return BBFromLeft: gosub RandomNumber BB_pos(a, 1) = 0 BB_pos(a, 2) = n * depth gosub RandomNumber if BB_pos(a, 2) > depth / 2 then BB_speed(a, 2) = (n - 0.35) * 8 * -1 else BB_speed(a, 2) = (n - 0.35) * 8 end if gosub RandomNumber BB_speed(a, 1) = (n * 5) + 4 return BBFromRight: gosub RandomNumber BB_pos(a, 1) = width - 1 BB_pos(a, 2) = n * depth gosub RandomNumber if BB_pos(a, 2) > depth / 2 then BB_speed(a, 2) = (n - 0.35) * 8 * -1 else BB_speed(a, 2) = (n - 0.35) * 8 end if gosub RandomNumber BB_speed(a, 1) = (n * -5) - 4 return MoveSBs: for a = 1 to max_small_bouncers if SB_exists(a) then SB_pos(a, 1) = SB_pos(a, 1) + SB_speed(a, 1) SB_pos(a, 2) = SB_pos(a, 2) + SB_speed(a, 2) if SB_pos(a, 1) < 0 then SB_pos(a, 1) = 0 SB_speed(a, 1) = SB_speed(a, 1) * -1 end if if SB_pos(a, 1) > width - 1 then SB_pos(a, 1) = width - 1 SB_speed(a, 1) = SB_speed(a, 1) * -1 end if if SB_pos(a, 2) < 0 then SB_pos(a, 2) = 0 SB_speed(a, 2) = SB_speed(a, 2) * -1 end if if SB_pos(a, 2) > depth - 1 then SB_pos(a, 2) = depth - 1 SB_speed(a, 2) = SB_speed(a, 2) * -1 end if set sprite spr_SB, SB_pos(a, 1) - offsetX_SB, SB_pos(a, 2) - offsetY_SB render sprite spr_SB end if next a return MoveMBs: for a = 1 to max_med_bouncers if MB_exists(a) then MB_pos(a, 1) = MB_pos(a, 1) + MB_speed(a, 1) MB_pos(a, 2) = MB_pos(a, 2) + MB_speed(a, 2) if MB_pos(a, 1) < 0 then MB_pos(a, 1) = 0 MB_speed(a, 1) = MB_speed(a, 1) * -1 end if if MB_pos(a, 1) > width - 1 then MB_pos(a, 1) = width - 1 MB_speed(a, 1) = MB_speed(a, 1) * -1 end if if MB_pos(a, 2) < 0 then MB_pos(a, 2) = 0 MB_speed(a, 2) = MB_speed(a, 2) * -1 end if if MB_pos(a, 2) > depth - 1 then MB_pos(a, 2) = depth - 1 MB_speed(a, 2) = MB_speed(a, 2) * -1 end if set sprite spr_MB, MB_pos(a, 1) - offsetX_MB, MB_pos(a, 2) - offsetY_MB render sprite spr_MB end if next a return MoveBBs: for a = 1 to max_big_bouncers if BB_exists(a) then BB_pos(a, 1) = BB_pos(a, 1) + BB_speed(a, 1) BB_pos(a, 2) = BB_pos(a, 2) + BB_speed(a, 2) if BB_pos(a, 1) < 0 then BB_pos(a, 1) = 0 BB_speed(a, 1) = BB_speed(a, 1) * -1 end if if BB_pos(a, 1) > width - 1 then BB_pos(a, 1) = width - 1 BB_speed(a, 1) = BB_speed(a, 1) * -1 end if if BB_pos(a, 2) < 0 then BB_pos(a, 2) = 0 BB_speed(a, 2) = BB_speed(a, 2) * -1 end if if BB_pos(a, 2) > depth - 1 then BB_pos(a, 2) = depth - 1 BB_speed(a, 2) = BB_speed(a, 2) * -1 end if set sprite spr_BB, BB_pos(a, 1) - offsetX_BB, BB_pos(a, 2) - offsetY_BB render sprite spr_BB end if next a return CheckRoidDeath: if roids = 0 or player_shots = 0 then return f_sound = 0 for a = 1 to max_roids if roid_exists(a) then set sprite spr_Roid, roid_pos(a, 1) - offsetX_roid, roid_pos(a, 2) - offsetY_roid for b = 1 to max_player_shots if roid_exists(a) and player_shot_exists(b) then if sprite collides (spr_Roid, spr_P_shot(b)) then roid_exists(a) = 0 player_shot_exists(b) = 0 roids = roids - 1 player_shots = player_shots - 1 score = score + 50 x = roid_pos(a, 1) y = roid_pos(a, 2) gosub AddExplosion f_sound = 1 end if end if next b end if next a if f_sound then play rsrc 259 return CheckFollowerDeath: if follower_exists then set sprite spr_follower(follower_health), follower_pos_x - offsetX_follower, follower_pos_y - offsetY_follower for b = 1 to max_player_shots if follower_exists and player_shot_exists(b) then if sprite collides (spr_follower(follower_health), spr_P_shot(b)) then follower_health = follower_health - 1 if follower_health < 0 then follower_exists = 0 score = score + 100 x = follower_pos_x y = follower_pos_y gosub AddExplosion play rsrc 265 else score = score + 25 play rsrc 264 end if player_shot_exists(b) = 0 player_shots = player_shots - 1 end if end if next b end if return CheckShooterDeath: if shooter_exists = 0 then return f_sound = 0 for a = max_guards to 1 step -1 if guard_exists(a) then for b = 1 to max_player_shots if guard_exists(a) and player_shot_exists(b) then if sprite collides (spr_guard(a), spr_P_shot(b)) then guard_exists(a) = 0 score = score + 10 f_sound = 1 player_shot_exists(b) = 0 player_shots = player_shots - 1 end if end if next end if next if f_sound then play rsrc 264 if shooter_exists then for b = 1 to max_player_shots if shooter_exists and player_shot_exists(b) then if sprite collides (spr_shooter, spr_P_shot(b)) then shooter_exists = 0 score = score + 80 x = shooter_pos_x y = shooter_pos_y gosub AddExplosion play rsrc 259 player_shot_exists(b) = 0 player_shots = player_shots - 1 end if end if next b end if return CheckStraferDeath: if strafer_exists then for b = 1 to max_player_shots if strafer_exists and player_shot_exists(b) then if sprite collides (spr_strafer, spr_P_shot(b)) then strafer_exists = 0 score = score + 80 x = strafer_pos_x y = strafer_pos_y gosub AddExplosion play rsrc 265 player_shot_exists(b) = 0 player_shots = player_shots - 1 end if end if next b end if return CheckSBDeath: if SBs = 0 or player_shots = 0 then return f_sound = 0 for a = 1 to max_small_bouncers if SB_exists(a) then set sprite spr_SB, SB_pos(a, 1) - offsetX_SB, SB_pos(a, 2) - offsetY_SB for b = 1 to max_player_shots if SB_exists(a) and player_shot_exists(b) then if sprite collides (spr_SB, spr_P_shot(b)) then SB_exists(a) = 0 player_shot_exists(b) = 0 SBs = SBs - 1 player_shots = player_shots - 1 score = score + 50 x = SB_pos(a, 1) y = SB_pos(a, 2) gosub AddExplosion f_sound = 1 end if end if next b end if next a if f_sound then play rsrc 259 return CheckMBDeath: if MBs = 0 or player_shots = 0 then return for a = 1 to max_med_bouncers if MB_exists(a) then set sprite spr_MB, MB_pos(a, 1) - offsetX_MB, MB_pos(a, 2) - offsetY_MB for b = 1 to max_player_shots if MB_exists(a) and player_shot_exists(b) then if sprite collides (spr_MB, spr_P_shot(b)) then MB_exists(a) = 0 player_shot_exists(b) = 0 MBs = MBs - 1 player_shots = player_shots - 1 score = score + 40 x = MB_pos(a, 1) y = MB_pos(a, 2) gosub AddExplosion play rsrc 259 gosub MBBreakup end if end if next b end if next a return CheckBBDeath: if BBs = 0 or player_shots = 0 then return for a = 1 to max_big_bouncers if BB_exists(a) then set sprite spr_BB, BB_pos(a, 1) - offsetX_BB, BB_pos(a, 2) - offsetY_BB for b = 1 to max_player_shots if BB_exists(a) and player_shot_exists(b) then if sprite collides (spr_BB, spr_P_shot(b)) then BB_exists(a) = 0 player_shot_exists(b) = 0 BBs = BBs - 1 player_shots = player_shots - 1 score = score + 30 x = BB_pos(a, 1) y = BB_pos(a, 2) gosub AddExplosion play rsrc 259 gosub BBBreakup end if end if next b end if next a return BBBreakup: ' Can't use A or B; it mustn't change these values... for c = 1 to breakuppieces if MBs < max_med_bouncers then d = 1 BBBAssignMB: if MB_exists(d) then d = d + 1 goto BBBAssignMB end if MBs = MBs + 1 MB_exists(d) = 1 MB_pos(d, 1) = BB_pos(a, 1) MB_pos(d, 2) = BB_pos(a, 2) gosub RandomNumber MB_speed(d, 1) = ((n - 0.5) * 6) + BB_speed(a, 1) gosub RandomNumber MB_speed(d, 2) = ((n - 0.5) * 6) + BB_speed(a, 2) end if next c return MBBreakup: ' Can't use A or B; it mustn't change these values... for c = 1 to breakuppieces if SBs < max_small_bouncers then d = 1 MBBAssignSB: if SB_exists(d) then d = d + 1 goto MBBAssignSB end if SBs = SBs + 1 SB_exists(d) = 1 SB_pos(d, 1) = MB_pos(a, 1) SB_pos(d, 2) = MB_pos(a, 2) gosub RandomNumber SB_speed(d, 1) = ((n - 0.5) * 6) + MB_speed(a, 1) gosub RandomNumber SB_speed(d, 2) = ((n - 0.5) * 6) + MB_speed(a, 2) end if next c return AddExplosion: ' Set x and y of explosion before calling... if explosions < max_explosions then c = 1 AssignExplosion: if explosion_size(c) then c = c + 1 goto AssignExplosion end if explosions = explosions + 1 explosion_size(c) = 1 explosion_pos(c, 1) = x explosion_pos(c, 2) = y end if return DrawExplosions: if explosions = 0 then return ' Sort drawing order for a = 1 to max_explosions explosion_sort_table(a) = a next for a = 1 to max_explosions - 1 a3 = a for a2 = a + 1 to max_explosions if explosion_size(explosion_sort_table(a3)) < explosion_size(explosion_sort_table(a2)) then a3 = a2 next swap explosion_sort_table(a), explosion_sort_table(a3) next for a2 = 1 to explosions a = explosion_sort_table(a2) if explosion_size(a) then explosion_size(a) = explosion_size(a) + 1 if explosion_size(a) > 10 then explosion_size(a) = 0 explosions = explosions - 1 end if if explosion_size(a) then a3 = explosion_size(a) set sprite spr_explosion(a3), explosion_pos(a, 1) - offsetX_explosion(a3), explosion_pos(a, 2) - offsetY_explosion(a3) render sprite spr_explosion(explosion_size(a)) end if end if next a2 return AddMedkit: if medkit_exists = 0 then medkit_exists = 1 gosub RandomNumber if n > 0.5 then medkit_pos_x = 0 medkit_speed_x = 3 else medkit_pos_x = width - 1 medkit_speed_x = -3 end if gosub RandomNumber if n > 0.5 then medkit_pos_y = 0 medkit_speed_y = 2 else medkit_pos_y = depth - 1 medkit_speed_y = -2 end if play rsrc 267 end if return MoveMedkit: if medkit_exists then medkit_pos_x = medkit_pos_x + medkit_speed_x medkit_pos_y = medkit_pos_y + medkit_speed_y if medkit_pos_x < 0 then medkit_exists = 0 if medkit_pos_x > width - 1 then medkit_exists = 0 if medkit_pos_y < 0 then medkit_exists = 0 if medkit_pos_y > depth - 1 then medkit_exists = 0 if medkit_exists then set sprite spr_medkit, medkit_pos_x - offsetX_medkit, medkit_pos_y - offsetY_medkit if sprite collides (current_ship, spr_medkit) then medkit_exists = 0 player_health = player_health + 80 ' doubled from original if player_health > maxph then player_health = maxph end if end if if medkit_exists then render sprite spr_medkit end if return Addshooter: if shooter_exists = 0 then shooter_exists = 1 shootercooldown = 0 shooter_pos_y = depth / 2 gosub RandomNumber if n < 0.5 then shooter_pos_x = width - 1 shooter_speed_x = -3 else shooter_pos_x = 0 shooter_speed_x = 3 end if play rsrc 268 for a=1 to max_guards guard_exists(a) = 1 next end if return MoveShooter: if shooter_exists then shooter_pos_x = shooter_pos_x + shooter_speed_x shooter_pos_y = shooter_pos_y + shooter_speed_y if shooter_pos_x < 0 then shooter_exists = 0 if shooter_pos_x > width - 1 then shooter_exists = 0 if shooter_pos_y < 0 then shooter_exists = 0 if shooter_pos_y > depth - 1 then shooter_exists = 0 if shooter_exists then shootercooldown = shootercooldown - 1 if shootercooldown < 0 then gosub ShooterShoots a2 = 0 for a = 1 to max_guards set sprite spr_guard(a), shooter_pos_x - offsetX_guard(a), shooter_pos_y - offsetY_guard(a) if guard_exists(a) then a2 = a next if a2 <> 0 then render sprite spr_guard(a2) set sprite spr_Shooter, shooter_pos_x - offsetX_shooter, shooter_pos_y - offsetY_shooter render sprite spr_Shooter end if end if return ShooterShoots: if enemy_shots < max_enemy_shots then a = 1 AssignESLoop: if enemy_shot_exists(a) then a = a + 1 goto AssignESLoop end if shootercooldown = scdtime enemy_shot_born(a) = i enemy_shots = enemy_shots + 1 enemy_shot_exists(a) = 1 enemy_shot_pos(a, 1) = shooter_pos_x enemy_shot_pos(a, 2) = shooter_pos_y enemy_shot_speed(a, 1) = (player_pos_x - shooter_pos_x) / 40 enemy_shot_speed(a, 2) = (player_pos_y - shooter_pos_y) / 40 play rsrc 263 end if return AddStrafer: if strafer_exists = 0 then strafer_exists = 1 strafercooldown = 0 gosub RandomNumber if n < 0.5 then strafer_pos_x = 10 else strafer_pos_x = width - 10 end if gosub RandomNumber if n < 0.5 then strafer_pos_y = 10 aim = 2 else strafer_pos_y = depth - 10 aim = 1 end if if strafer_pos_x > (width / 2) then strafer_speed_x = -5 else strafer_speed_x = 5 end if strafer_speed_y = 0 play rsrc 268 end if return ' up = 1 ' down = 2 ' left = 3 ' right = 4 MoveStrafer: if strafer_exists then strafer_pos_x = strafer_pos_x + strafer_speed_x strafer_pos_y = strafer_pos_y + strafer_speed_y if strafer_pos_x < 10 then aim = 4 strafer_pos_x = 10 strafer_speed_x = 0 if strafer_pos_y > (depth / 2) then strafer_speed_y = -5 else strafer_speed_y = 5 end if end if if strafer_pos_x > width - 10 then aim = 3 strafer_pos_x = width - 10 strafer_speed_x = 0 if strafer_pos_y > (depth / 2) then strafer_speed_y = -5 else strafer_speed_y = 5 end if end if if strafer_pos_y < 10 then aim = 2 strafer_pos_y = 10 strafer_speed_y = 0 if strafer_pos_x > (width / 2) then strafer_speed_x = -5 else strafer_speed_x = 5 end if end if if strafer_pos_y > depth - 10 then aim = 1 strafer_pos_y = depth - 10 strafer_speed_y = 0 if strafer_pos_x > (width / 2) then strafer_speed_x = -5 else strafer_speed_x = 5 end if end if strafercooldown = strafercooldown - 1 if strafercooldown < 0 then gosub StraferShoots set sprite spr_strafer, strafer_pos_x - offsetX_strafer, strafer_pos_y - offsetY_strafer render sprite spr_strafer end if return StraferShoots: if enemy_shots < max_enemy_shots then a = 1 AssignStrLoop: if enemy_shot_exists(a) then a = a + 1 goto AssignStrLoop end if strafercooldown = strcdtime enemy_shot_born(a) = i enemy_shots = enemy_shots + 1 enemy_shot_exists(a) = 1 enemy_shot_pos(a, 1) = strafer_pos_x enemy_shot_pos(a, 2) = strafer_pos_y if aim = 1 then enemy_shot_speed(a, 1) = 0 enemy_shot_speed(a, 2) = -10 end if if aim = 2 then enemy_shot_speed(a, 1) = 0 enemy_shot_speed(a, 2) = 10 end if if aim = 3 then enemy_shot_speed(a, 1) = -10 enemy_shot_speed(a, 2) = 0 end if if aim = 4 then enemy_shot_speed(a, 1) = 10 enemy_shot_speed(a, 2) = 0 end if play rsrc 263 end if return MoveEnemyShots: for a = 1 to max_enemy_shots if enemy_shot_exists(a) then if i - enemy_shot_born(a) > enemy_shot_length then enemy_shots = enemy_shots - 1 enemy_shot_exists(a) = 0 else enemy_shot_pos(a, 1) = enemy_shot_pos(a, 1) + enemy_shot_speed(a, 1) enemy_shot_pos(a, 2) = enemy_shot_pos(a, 2) + enemy_shot_speed(a, 2) wrkX = abs(enemy_shot_pos(a, 1) - width/2) wrkY = abs(enemy_shot_pos(a, 2) - depth/2) if wrkX > width/2 or wrkY > depth/2 then enemy_shots = enemy_shots - 1 enemy_shot_exists(a) = 0 end if end if if enemy_shot_exists(a) then set sprite spr_E_shot, enemy_shot_pos(a, 1) - offsetX_E_shot, enemy_shot_pos(a, 2) - offsetY_E_shot render sprite spr_E_shot end if end if next a return AddFollower: if (follower_exists = 0) and player_health > 0 then play rsrc 262 follower_exists = 1 follower_health = 2 gosub RandomNumber if n > 0.5 then follower_pos_x = 0 else follower_pos_x = width - 1 end if gosub RandomNumber if n > 0.5 then follower_pos_y = 0 else follower_pos_y = depth - 1 end if follower_speed_x = 0 follower_speed_y = 0 end if return MoveFollower: if follower_exists then gosub RandomNumber if player_pos_x > follower_pos_x then follower_speed_x = follower_speed_x + n else follower_speed_x = follower_speed_x - n end if if player_pos_y > follower_pos_y then follower_speed_y = follower_speed_y + n else follower_speed_y = follower_speed_y - n end if follower_pos_x = follower_pos_x + follower_speed_x follower_pos_y = follower_pos_y + follower_speed_y if follower_pos_x < 0 then follower_pos_x = 0 follower_speed_x = 2 end if if follower_pos_x > width - 1 then follower_pos_x = width - 1 follower_speed_x = -2 end if if follower_pos_y < 0 then follower_pos_y = 0 follower_speed_y = 2 end if if follower_pos_y > depth - 1 then follower_pos_y = depth - 1 follower_speed_y = -2 end if set sprite spr_follower(follower_health), follower_pos_x - offsetX_follower, follower_pos_y - offsetY_follower render sprite spr_follower(follower_health) end if return KillTime: if inkey$ = chr$(27) then goto PlayerQuits if inkey$ = "P" or inkey$ = "p" then gosub Pause if abs(timer - starttime2) < 0.036 then goto KillTime ' abs - manage reseting timer starttime2 = timer return EndKillTime: ' Without Quit or Pause... if abs(timer - starttime2) < 0.036 then goto EndKillTime starttime2 = timer return Pause: play rsrc 266 showcursor forecolor 0, 65535, 30000 textsize 24 text 150, 235, "Paused - Click to resume..." copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 wait key up wait button up wait button wait button up hidecursor return LoadMusic: mov = open movie(":Vortex Music:Music " + str$(musicfile)) if movies error = 0 then start movie mov playing = 1 else ' Retry with 1st tune... musicfile = 1 mov = open movie(":Vortex Music:Music " + str$(musicfile)) if movies error = 0 then start movie mov playing = 1 else playing = 0 end if end if return Music: ' MUST check if playing <> 0 before calling... if is movie done (mov) = 0 then ' (else mov would be an invalid reference) movies task else stop movie mov close movie mov musicfile = musicfile + 1 gosub LoadMusic end if return Level1: level = 1 gosub LevelIntro ' Displays the level number. gosub InitialiseLevel ' Resets variables. i = 1 ' We'll keep track of which cycle we're in. L1Loop: starttime = timer ' So we can see how long this cycle takes ' and slow it down if needed. if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions ' Draws any explosions. gosub Starfield ' Draws moving starfield. gosub UpdateCursor ' Draws cursor where mouse is. gosub PlayerShoot ' Checks if player is shooting. gosub MovePlayerShots ' Moves our bullets. gosub MovePlayer ' Moves our ship. gosub CheckRoidCollision ' See if we've hit a Roid. gosub CheckFollowerCollision ' See if we've hit the Follower enemy. gosub CheckRoidDeath ' See if we've shot a Roid. gosub CheckFollowerDeath ' See if we've shot the Follower enemy. gosub MoveRoids ' Move Roids. gosub MoveFollower ' Move the Follower. gosub Display ' Update the display (score, health). if score - start_score > 450 then ' Condition for Follower coming in. gosub AddFollower ' ie it's always there once score > 450. end if gosub RandomNumber if n < 0.1 then gosub AddRoid ' 1 in 10 chance of adding a Roid. copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime ' Waits until 0.02 secs have elapsed since starttime. i = i + 1 if score - start_score < 1000 then goto L1Loop L1End: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckRoidCollision gosub CheckFollowerCollision gosub CheckRoidDeath gosub CheckFollowerDeath gosub MoveRoids gosub MoveFollower gosub Display copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if roids then goto L1End if follower_exists then goto L1End if player_health < 1 then goto GameOver gosub LevelComplete return Level2: level = 2 gosub LevelIntro gosub InitialiseLevel i = 1 L2Loop: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckRoidCollision gosub CheckFollowerCollision gosub CheckSBCollision gosub CheckRoidDeath gosub CheckFollowerDeath gosub CheckSBDeath gosub MoveRoids gosub MoveFollower gosub MoveSBs gosub Display gosub RandomNumber if n < 0.001 then gosub AddFollower if roids < 5 then gosub AddRoid if (SBs < 5) and (score - start_score < 1200) then gosub AddSB copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if score - start_score < 1500 then goto L2Loop gosub AddShooter L2End: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckRoidCollision gosub CheckFollowerCollision gosub CheckSBCollision gosub CheckEnemyShotCollision gosub CheckRoidDeath gosub CheckSBDeath gosub CheckFollowerDeath gosub CheckShooterDeath gosub MoveRoids gosub MoveSBs gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub Display copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if SBs then goto L2End if roids then goto L2End if follower_exists then goto L2End if shooter_exists then goto L2End if player_health < 1 then goto GameOver gosub LevelComplete return Level3: level = 3 gosub LevelIntro gosub InitialiseLevel i = 1 for a = 1 to max_big_bouncers - 2 gosub AddBB next a L3Loop: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckRoidCollision gosub CheckSBCollision gosub CheckMBCollision gosub CheckBBCollision gosub CheckEnemyShotCollision gosub CheckRoidDeath gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckStraferDeath gosub MoveEnemyShots gosub MoveRoids gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveStrafer gosub MoveMedkit gosub Display if player_health < 50 then gosub RandomNumber if n < 0.015 then gosub AddMedkit end if end if if i mod 400 = 0 then gosub AddStrafer copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if SBs then goto L3Loop if MBs then goto L3Loop if BBs then goto L3Loop if strafer_exists then goto L3Loop if player_health < 1 then goto GameOver gosub LevelComplete return Level4: level = 4 gosub LevelIntro gosub InitialiseLevel gosub AddMedkit i = 1 for a = 1 to max_big_bouncers gosub AddBB next a L4Loop: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckSBCollision gosub CheckMBCollision gosub CheckBBCollision gosub CheckEnemyShotCollision gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckShooterDeath gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveEnemyShots gosub MoveShooter gosub MoveMedkit gosub Display if i mod 500 = 0 then gosub AddShooter if i mod 400 = 0 then gosub AddMedkit copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if SBs then goto L4Loop if MBs then goto L4Loop if BBs then goto L4Loop if shooter_exists then goto L4Loop if player_health < 1 then goto GameOver gosub LevelComplete return Level5: level = 5 gosub LevelIntro gosub InitialiseLevel gosub AddMedkit i = 1 for a = 1 to max_big_bouncers gosub AddBB next a L5Loop: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckSBCollision gosub CheckMBCollision gosub CheckBBCollision gosub CheckRoidCollision gosub CheckFollowerCollision gosub CheckEnemyShotCollision gosub CheckSBDeath gosub CheckMBDeath gosub CheckBBDeath gosub CheckRoidDeath gosub CheckFollowerDeath gosub CheckShooterDeath gosub MoveSBs gosub MoveMBs gosub MoveBBs gosub MoveRoids gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub MoveMedkit gosub Display if SBs then if roids < 4 then gosub RandomNumber if n < 0.05 then gosub AddRoid end if end if gosub RandomNumber if n < 0.00025 * (SBs + MBs + BBs) then gosub AddMedkit end if if i mod 500 = 0 then gosub AddShooter if i mod 850 = 0 then gosub AddFollower copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if SBs then goto L5Loop if MBs then goto L5Loop if BBs then goto L5Loop if Roids then goto L5Loop if shooter_exists then goto L5Loop if follower_exists then goto L5Loop if player_health < 1 then goto GameOver gosub LevelComplete return Level6: level = 6 gosub LevelIntro gosub InitialiseLevel i = 1 L6Loop: starttime = timer if player_health < 1 then goto GameOver cls if invulnerable then invulnerable = invulnerable - 1 gosub DrawExplosions gosub Starfield gosub UpdateCursor gosub PlayerShoot gosub MovePlayerShots gosub MovePlayer gosub CheckFollowerCollision gosub CheckEnemyShotCollision gosub CheckFollowerDeath gosub CheckShooterDeath gosub CheckStraferDeath gosub MoveFollower gosub MoveEnemyShots gosub MoveShooter gosub MoveStrafer gosub MoveMedkit gosub Display if score - start_score < 750 then if strafer_exists = 0 then gosub AddStrafer if i mod 100 = 0 then gosub AddShooter if follower_exists = 0 then gosub AddFollower if player_health < 50 then gosub RandomNumber if n < 0.001 then gosub AddMedkit end if end if copyrect 0, 0, width, depth, top_left_x, top_left_y, top_left_x + width, top_left_y + depth, 0, virtue, 0 if (i mod musicwait = 0) and (playing) then gosub Music gosub KillTime i = i + 1 if score - start_score < 750 then goto L6Loop if strafer_exists then goto L6Loop if shooter_exists then goto L6Loop if follower_exists then goto L6Loop if player_health < 1 then goto GameOver gosub LevelComplete return ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' A minimalised form of my program Swarmz, for the intro... ' Swarmz: k = 0.9 ' Constant to change all the critters' speeds beasts = 1 ' Number of beasts queens = 1 ' Number of queens maxqueenspeed = k * 6 ' Queens' maximum speed in any direction maxbeastspeed = k * 6 ' Beasts' maximum speed in any direction queenjitters = k * 2.0 ' Queens' speed can have up to this value randomly added each tick beastjitters = k * 2.0 ' Beasts' speed can have up to this value randomly added each tick hardedge = 3 ' If any critter is beyond the hardedge it gets put back in the arena queenbouncespeed = k * 1.8 ' Speed queen is set to if it reaches the hardedge beastbouncespeed = k * 1.8 ' Speed beast is set to if it reaches the hardedge ' Housekeeping... fullscreen mode screen width, screen height, 8 play rsrc 256 n = rnd(0 - timer) width = 640 depth = 480 top_left_x = (screen width / 2) - (width / 2) top_left_y = (screen height / 2) - (depth / 2) ' Set console to proper size... ' Initialise the critters... dim queen_pos(queens, 2) dim queen_speed(queens, 2) dim queen_allegiance(queens) i = 1 GenerateQueens: queen_speed(i, 1) = 0 queen_speed(i, 2) = 0 gosub RandomNumber queen_pos(i, 1) = n * width gosub RandomNumber queen_pos(i, 2) = n * depth i = i + 1 if i <= queens then goto GenerateQueens dim beast_pos(beasts, 2) dim beast_speed(beasts, 2) dim allegiance(beasts) i = 1 GenerateBeasts: beast_speed(i, 1) = 0 beast_speed(i, 2) = 0 gosub RandomNumber beast_pos(i, 1) = n * width gosub RandomNumber beast_pos(i, 2) = n * depth i = i + 1 if i <= beasts then goto GenerateBeasts starttime = timer FillWithBugs: gosub SetQueens gosub SetBeasts gosub DrawCritters if timer - starttime > 2 then goto PrintLogo goto FillWithBugs DrawCritters: forecolor 65535, 0, 65535 gosub PlotBeasts forecolor 0, 0, 65535 gosub PlotQueens return PlotBeasts: i = 1 PBLoop: plot top_left_x + int(beast_pos(i, 1)), top_left_y + int(beast_pos(i, 2)) i = i + 1 if i <= beasts then goto PBLoop return PlotQueens: i = 1 PQLoop: plot top_left_x + int(queen_pos(i, 1)), top_left_y + int(queen_pos(i, 2)) i = i + 1 if i <= queens then goto PQLoop return SetQueens: i = 1 Queen: ' Do random queen speed alteration... gosub RandomNumber queen_speed(i, 1) = queen_speed(i, 1) + ((n - 0.5) * 2 * queenjitters) gosub RandomNumber queen_speed(i, 2) = queen_speed(i, 2) + ((n - 0.5) * 2 * queenjitters) ' Slow queen down if it's too fast... if queen_speed(i, 1) > maxqueenspeed then queen_speed(i, 1) = maxqueenspeed if queen_speed(i, 1) < maxqueenspeed * -1 then queen_speed(i, 1) = maxqueenspeed * -1 if queen_speed(i, 2) > maxqueenspeed then queen_speed(i, 2) = maxqueenspeed if queen_speed(i, 2) < maxqueenspeed * -1 then queen_speed(i, 2) = maxqueenspeed * -1 ' Update queen position... queen_pos(i, 1) = (queen_pos(i, 1) + queen_speed(i, 1)) queen_pos(i, 2) = (queen_pos(i, 2) + queen_speed(i, 2)) ' Put queen back in arena if necessary... if queen_pos(i, 1) > (width - hardedge) - 1 then queen_pos(i, 1) = (width - hardedge) - 1 queen_speed(i, 1) = queenbouncespeed * -1 end if if queen_pos(i, 1) < hardedge then queen_pos(i, 1) = hardedge queen_speed(i, 1) = queenbouncespeed end if if queen_pos(i, 2) > (depth - hardedge) - 1 then queen_pos(i, 2) = (depth - hardedge) - 1 queen_speed(i, 2) = queenbouncespeed * -1 end if if queen_pos(i, 2) < hardedge then queen_pos(i, 2) = hardedge queen_speed(i, 2) = queenbouncespeed end if i = i + 1 if i <= queens then goto Queen return SetBeasts: i = 1 Beast: ' Do random beast speed alteration... gosub RandomNumber beast_speed(i, 1) = beast_speed(i, 1) + ((n - 0.5) * 2 * beastjitters) gosub RandomNumber beast_speed(i, 2) = beast_speed(i, 2) + ((n - 0.5) * 2 * beastjitters) ' Slow beast down if it's too fast... if beast_speed(i, 1) > maxbeastspeed then beast_speed(i, 1) = maxbeastspeed if beast_speed(i, 1) < maxbeastspeed * -1 then beast_speed(i, 1) = maxbeastspeed * -1 if beast_speed(i, 2) > maxbeastspeed then beast_speed(i, 2) = maxbeastspeed if beast_speed(i, 2) < maxbeastspeed * -1 then beast_speed(i, 2) = maxbeastspeed * -1 ' Update beast position... beast_pos(i, 1) = beast_pos(i, 1) + beast_speed(i, 1) beast_pos(i, 2) = beast_pos(i, 2) + beast_speed(i, 2) ' Put beast back in arena if necessary... if beast_pos(i, 1) > (width - hardedge) - 1 then beast_pos(i, 1) = (width - hardedge) - 1 beast_speed(i, 1) = beastbouncespeed * -1 end if if beast_pos(i, 1) < hardedge then beast_pos(i, 1) = hardedge beast_speed(i, 1) = beastbouncespeed end if if beast_pos(i, 2) > (depth - hardedge) - 1 then beast_pos(i, 2) = (depth - hardedge) - 1 beast_speed(i, 2) = beastbouncespeed * -1 end if if beast_pos(i, 2) < hardedge then beast_pos(i, 2) = hardedge beast_speed(i, 2) = beastbouncespeed end if i = i + 1 if i <= beasts then goto Beast return RandomNumber: ' Gives variable 'n' a pseudo-random value between 0 and 1. n = rnd * (timer + n) * 37 n = n - int(n) return PrintLogo: textsize 48 for x = 1 to 65 forecolor x * 650, x * 650, x * 1000 text top_left_x + 230, top_left_y + 180, "Vortex" wait 0.02 next x for x = 1 to 65 forecolor x * 1000, x * 1000, x * 1000 textsize 24 text top_left_x + 75, top_left_y + 230, " By Allan Crossman and Lisa Lovelace" textsize 12 textface 1 text top_left_x + 4, top_left_y + 15, version$ textface 0 wait 0.02 next x for x = 1 to 65 forecolor x * 1000, x * 1000, x * 1000 textsize 24 text top_left_x + 205, top_left_y + 350, "< click to begin >" textsize 18 text top_left_x + 120, top_left_y + 375, "< or press any key to use keyboard only >" wait 0.02 next x PLWaitLoop: if button then goto Main if inkey$ <> "" then keyboardcontrols = 1 goto Main end if goto PLWaitLoop