QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: johnno56 on October 02, 2021, 08:25:34 am

Title: Competition
Post by: johnno56 on October 02, 2021, 08:25:34 am
Quick question... Is anyone from this site participating in the Syntaxbomb competition... or is that a bite of a taboo topic? Just curious...
Title: Re: Competition
Post by: SMcNeill on October 02, 2021, 08:27:21 am
Got a link?  Never heard of it.  😘
Title: Re: Competition
Post by: bplus on October 02, 2021, 09:03:55 am
https://www.syntaxbomb.com/game-coding-competitions/code-a-game-comp-there-can-be-only-one-aug-14th-to-oct-24th-2021/
Title: Re: Competition
Post by: Pete on October 02, 2021, 12:50:26 pm
Unless the competition is exclusively in SCREEN 0, then no.

Kidding aside, I wish Rob had finished his Zaxon clone he made 10+ years ago. It really showcased the power of the then still infant QB64. I suppose that now a lot of the entries would be 3-D, but we do have a few OpenGL enthusiasts parked around here, somewhere. Did you intend to enter?

Pete

How can we prove intelligent life exists on other planets? Simple, they won't visit here!
Title: Re: Competition
Post by: jack on October 02, 2021, 01:02:34 pm
at first I thought: what a ridiculous limitation, only one key or button, how could one possibly write an interesting game with that limitation, but then I thought that it would be simple enough to make a "pop the balloons" game where a rectangle moves randomly across a screen full of balloons and you hit the key to pop the balloon that the rectangle targets, or you could make other similar games
Title: Re: Competition
Post by: bplus on October 02, 2021, 01:06:08 pm
Flappy Bird pretty much is a single key game.
Title: Re: Competition
Post by: bplus on October 02, 2021, 01:08:58 pm
I started a discussion about accessing all letters and numbers (for menu) with a single key here:
https://www.qb64.org/forum/index.php?topic=4239.msg136134#msg136134
Title: Re: Competition
Post by: Pete on October 03, 2021, 01:14:25 am
You could make a Defender clone with one button. Just have the ship shoot continuously as it simultaneously moves upwards to the top of the screen and reappears at the bottom. Take your finger off the button, and it stops elevating and shooting. You could make the ship in the shape of a hand, with the middle finger extended forward, and name it, Windows Offender.

By the way, the forum crashed again, while I was trying to post ths.

Pete
Title: Re: Competition
Post by: johnno56 on October 03, 2021, 04:49:02 am
How about that Trex runner? One click to duck; double-click to jump; release to run... Just a thought...
Title: Re: Competition
Post by: bplus on October 03, 2021, 08:28:06 am
This is Screen 0, One Key Game I made from my variation of Cryptogram Puzzle:
Code: QB64: [Select]
  1. _Title "One Key Challenge - Cryptogram Puzzle" ' b+  started One Key Challenge 2021-09-25
  2. ' from Cryptogram Puzzle   2021-09-09
  3. ' 2021-09-07 intended for QB64 home programming entertainment use only."
  4. ' Thank you Best Life ref: https://bestlifeonline.com/funny-short-jokes/"
  5. '
  6. ' 2021-10-02 installed new GetInput but it needs a chunk of screen space setup
  7. ' Have it basically working now for some cleanp. Move the file into data statements.
  8. ' Make a utility to do this.
  9.  
  10. Dim Shared Answer$ '  beginning phrase to be guessed    '   3 stages of the Puzzle
  11. Dim Shared Coded$ '   hidden in code
  12. Dim Shared Working$ ' decoded and solved when working$ becomes = ucase$(answer$)
  13. Dim Shared Letters$(1 To 26) ' for coding and highlited letters
  14. Dim Shared LCodes$(1 To 26) '  for code and decode by number 1 to 26
  15. Dim Shared Guesses$(1 To 26) ' track all the guess to decode
  16. Dim Shared HighLited ' cursor over letters to guess
  17. Dim Shared Mode
  18. _FullScreen 'I guess it does make it easier to tell E from F...
  19. Dim jokes$(1 To 100)
  20. For i = 1 To 100
  21.     Read r$
  22.     If r$ <> "EOD" Then jokes$(i) = r$: jCount = jCount + 1 Else Exit For
  23. restart:
  24. Answer$ = jokes$(Int(Rnd * jCount) + 1)
  25. For i = 1 To 26: Guesses$(i) = "-": Next 'setup the display guesses array
  26. For i = 1 To 26 ' use letters for display of letters to pick second and to create a code
  27.     Letters$(i) = Chr$(i + 64)
  28.     LCodes$(i) = Letters$(i) ' these will convert between each other by index number
  29. For i = 26 To 2 Step -1 ' shuffle the letters in LCode$()
  30.     Swap LCodes$(i), LCodes$(Int(Rnd * i) + 1)
  31. Coded$ = "": Working$ = "" ' reset for next go around
  32. For i = 1 To Len(Answer$) 'third: put the phrase in coded$ and hide it in working$
  33.     a = Asc(UCase$(Answer$), i)
  34.     If a >= 65 And a <= 90 Then
  35.         Coded$ = Coded$ + LCodes$(a - 64)
  36.         Working$ = Working$ + "*"
  37.     Else
  38.         Coded$ = Coded$ + Mid$(Answer$, i, 1)
  39.         Working$ = Working$ + Mid$(Answer$, i, 1)
  40.     End If
  41. HighLited = 1 'setup done start game
  42. Mode = 1
  43.     Mode = 1 - Mode
  44.     DisplayScreen
  45.     k$ = GetInput$(61, 22)
  46.     If Mode = 0 Then ' highlight a letter
  47.         'm replaces arrows and mouse select of highlited 1 to 26 for letters
  48.         test = InStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", k$)
  49.         If test > 0 Then HighLited = test
  50.         test = InStr("1234", k$)
  51.         If test > 0 Then
  52.             Select Case test
  53.                 Case 1: GoSub do1: Mode = 1
  54.                 Case 2: GoSub do2: Mode = 1
  55.                 Case 3: GoSub do3: Mode = 1
  56.                 Case 4: GoSub do4: Mode = 1
  57.             End Select
  58.         End If
  59.     Else
  60.         Select Case k$
  61.             Case "1": GoSub do1
  62.             Case "2": GoSub do2
  63.             Case "3": GoSub do3
  64.             Case "4": GoSub do4
  65.             Case "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
  66.                 Guesses$(HighLited) = k$ ' for screen updates
  67.                 For i = 1 To Len(Working$)
  68.                     If Letters$(HighLited) = Mid$(Coded$, i, 1) Then Mid$(Working$, i, 1) = k$
  69.                 Next
  70.         End Select
  71.     End If
  72.     _Limit 60
  73. Loop Until Working$ = UCase$(Answer$)
  74. DisplayScreen
  75. Color 1, 2
  76. cp 17, "You got it!    5 secs to next puzzle..."
  77. GoTo restart
  78.  
  79. do1: ' display answer
  80. Working$ = UCase$(Answer$) ' show the answer$ guesses correct moves to next puzzle
  81. DisplayScreen
  82.  
  83. do2: ' get decode letter for highlighted Letter
  84. For i = 1 To 26
  85.     If LCodes$(i) = Letters$(HighLited) Then c$ = Chr$(i + 64): Exit For
  86. Guesses$(HighLited) = c$ ' for screen updates
  87. For i = 1 To Len(Working$)
  88.     If Letters$(HighLited) = Mid$(Coded$, i, 1) Then Mid$(Working$, i, 1) = c$
  89.  
  90. do3: ' find a uncoded letter
  91. Color 15, 2: Locate 24, 40: Print "Select Find Letter"
  92. d$ = GetInput(61, 22)
  93. c$ = LCodes$(Asc(d$) - 64)
  94. Guesses$(Asc(c$) - 64) = d$
  95. For i = 1 To Len(Working$)
  96.     If c$ = Mid$(Coded$, i, 1) Then Mid$(Working$, i, 1) = d$
  97.  
  98. do4: ' clear guess letter from code letter
  99. Guesses$(HighLited) = "-"
  100. For i = 1 To Len(Working$)
  101.     If Letters$(HighLited) = Mid$(Coded$, i, 1) Then Mid$(Working$, i, 1) = "*" ' clear the letter
  102.  
  103. 'one liners
  104. Data "What kind of exercise do lazy people do? Diddly-squats."
  105. Data "What do you call a pony with a cough? A little horse!"
  106. Data "What is Forrest Gump's password? 1Forrest1."
  107. Data "Why did the M&M go to school? He wanted to be a Smartie."
  108. Data "What did one traffic light say to the other? Stop looking at me, I'm changing!"
  109. Data "What do you call bears with no ears? B."
  110. Data "What's a foot long and slippery? A slipper!"
  111. Data "Why do French people eat snails? They don't like fast food!"
  112. Data "What's red and moves up and down? A tomato in an elevator!"
  113. Data "I invented a new word today: Plagiarism."
  114. Data "What is sticky and brown? A stick!"
  115. Data "How does a rabbi make coffee? Hebrews it!"
  116. Data "Rest in peace boiling water. You will be mist!"
  117. Data "How do you throw a space party? You planet!"
  118. Data "Want to hear a construction joke? Oh never mind, I'm still working on that one."
  119. Data "Why don't scientists trust atoms? Because they make up everything!"
  120. Data "I hate Russian dolls they're so full of themselves!"
  121. Data "Talk is cheap? Have you ever talked to a lawyer?"
  122. Data "Why did the gym close down? It just didn't work out!"
  123. Data "Two artists had an art contest. It ended in a draw!"
  124. Data "A plateau is the highest form of flattery."
  125. Data "I have a fear of speed bumps. But I am slowly getting over it."
  126. Data "You can only get spoiled milk from a pampered cow."
  127. Data "What do you call a boomerang that doesn't come back? A stick!"
  128. Data "You know what I saw today? Everything I looked at."
  129. Data "What are a shark's two most favorite words? Man overboard!"
  130. Data "If we shouldn't eat at night, why do they put a light in the fridge?"
  131. Data "Have you ever tried eating a clock? It's really time-consuming, especially if you go for seconds."
  132. Data "Why are ghosts such bad liars? Because they are easy to see through."
  133. Data "It's cleaning day so naturally, I've already polished off a whole chocolate bar."
  134. Data "What did the buffalo say when his son left for college? Bison!"
  135. Data "Here, I bought you a calendar. Your days are numbered now."
  136. Data "Where do fish sleep? In the riverbed."
  137. Data "What did one plate say to his friend? Tonight, dinner's on me!"
  138. Data "Where are average things manufactured? The satisfactory."
  139. Data "I tried to sue the airport for misplacing my luggage. I lost my case."
  140. Data "Why doesn't the sun go to college? Because it has a million degrees!"
  141. Data "I was wondering why the Frisbee was getting bigger, then it hit me."
  142. Data "I have many jokes about rich kids unfortunately none of them work."
  143. Data "What do you call a singing laptop? A Dell!"
  144. Data "Why was six afraid of seven? Because seven ate nine."
  145. Data "Why are skeletons so calm? Because nothing gets under their skin."
  146. Data "How do trees get online? They just log on!"
  147. Data "Some people think prison is one word but to robbers it's the whole sentence."
  148. Data "My girlfriend treats me like a god. She ignores my existence and only talks to me when she needs something."
  149. Data "Where does the sheep get his hair cut? The baa baa shop!"
  150. Data "Why did the orange stop? It ran out of juice!"
  151. Data "I never make mistakes. I thought I did once, but I was wrong."
  152. Data "What does the man in the moon do when his hair gets too long? Eclipse it!"
  153. Data "What did 0 say to 8? Nice belt!"
  154. Data "EOD"
  155.  
  156. Sub DisplayScreen
  157.     Color 11, 2: Cls
  158.     Color 1
  159.     cp 2, "*** One Key Challenge - Cryptogram Puzzle ***"
  160.     Color 7
  161.     cp 4, "All selections are made by pressing spacebar when letter or menu number is highlighted."
  162.     cp 5, "Solve by selecting a code letter then selecting a letter guess."
  163.     cp 6, "Use the _ steps to move down or up on last row."
  164.     cp 7, "Use the escape key to quit immediately."
  165.     cp 9, "To get the answer and move onto next puzzle, select 1."
  166.     cp 10, "To decode current highlighted letter, select 2."
  167.     cp 11, "To solve a letter, select 3 and then select letter to find."
  168.     cp 12, "To clear a guess at highlighted letter, select 4."
  169.     Color 4
  170.     Locate 15, (120 - Len(Answer$)) / 2: Print Coded$
  171.     Color 11
  172.     Locate 16, (120 - Len(Answer$)) / 2
  173.     For i = 1 To Len(Answer$)
  174.         w$ = Mid$(Working$, i, 1): c$ = Mid$(Coded$, i, 1)
  175.         a$ = Mid$(Answer$, i, 1): h$ = Letters$(HighLited)
  176.         If w$ = "*" Then
  177.             pc$ = "*": If h$ = c$ Then Color 14, 0 Else Color 10, 2
  178.         Else
  179.             Color 10, 2: If w$ = UCase$(a$) Then pc$ = a$ Else pc$ = w$
  180.         End If
  181.         Print pc$;
  182.     Next
  183.     spaces = 9
  184.     For i = 1 To 26
  185.         If i = HighLited Then Color 14, 0 Else Color 4, 2
  186.         Locate 19, spaces: Print Letters$(i)
  187.         If i = HighLited Then Color 14, 0 Else Color 10, 2
  188.         Locate 20, spaces: Print Guesses$(i)
  189.         spaces = spaces + 4
  190.     Next
  191.     Color 15, 2: Locate 24, 40
  192.     If Mode Then Print "Guess Letter|Menu#" Else Print "Select Code Letter"
  193.  
  194. Sub cp (row, text$) ' center text on text screen
  195.     Locate row, (_Width - Len(text$)) / 2: Print text$
  196.  
  197. Function GetInput$ (LocateCol, LocateRow)
  198.     Dim g$(5)
  199.     g$(0) = "_ABCDE_"
  200.     g$(1) = "_FGHIJ_"
  201.     g$(2) = "_KLMNO_"
  202.     g$(3) = "_PQRST_"
  203.     g$(4) = "_UVWXY_"
  204.     g$(5) = "_Z1234_"
  205.     py = 0: px = 0
  206.     Do
  207.         If _KeyDown(27) Then System ' quit
  208.         GoSub show
  209.         lp = lp + 1
  210.         If lp = 60 Then
  211.             lp = 0
  212.             px = px + 1
  213.             If px > 6 Then px = 0
  214.         End If
  215.         If InKey$ = " " Then
  216.             If pick$ = "_" Then
  217.                 py = py + 1
  218.                 If py > 5 Then py = 0
  219.             Else
  220.                 GetInput$ = pick$: Exit Function
  221.             End If
  222.         Else
  223.         End If
  224.         'Locate 1, 40: Print py, px
  225.         _Limit 60
  226.     Loop
  227.     show:
  228.     For row = 0 To 5
  229.         For col = 0 To 6
  230.             If col = px And row = py Then Color 0, 15: pick$ = Mid$(g$(row), col + 1, 1) Else Color 15, 0
  231.             Locate LocateRow + row, LocateCol + col: Print Mid$(g$(row), col + 1, 1);
  232.         Next
  233.     Next
  234.     Color 15, 0
  235.     Return
  236.  
  237.  
  238.  

What do ya think? Competition ready? QB64 embarrassment?
Title: Re: Competition
Post by: SMcNeill on October 03, 2021, 08:58:39 am
Mini-golf would be great for this competition.

Imagine a bar with a slider going back and forth.  Click a button to stop it to set your angle.

Like this is my bar:  [……………………]

And then the slider moves back and forth:  […………………|…]

In this case, that’s to the far right.  (The | is my slider.)

Now, do the same thing a second time for power.

You now can shoot a ball, at various angles, with different levels of power, and try and get it to the target up the screen.


Simple interface.  One button interactive.  It’s a game — especially if you code it where 2 people can compete in it. 
Title: Re: Competition
Post by: bplus on October 03, 2021, 09:34:36 am
Sounds interesting Steve, look forward to seeing it coded up ;-))
Title: Re: Competition
Post by: bplus on October 03, 2021, 10:02:37 am
How about a competition here? 

Rules: One key, lets just say spacebar, and Screen 0 are only restrictions I can think of, by Halloween.
Maybe bonus consideration for Halloween themed game or puzzle.
Title: Re: Competition
Post by: TempodiBasic on October 03, 2021, 11:51:28 am
Hi boys and girls

@Steve you have described a my boxes demo with a power punch bar increasing pressing key and decreasing by time
So I could resume it from Ongoing folder.

@bplus  yes one key but not one key of keyboard, we can use also one button of mouse or one button of joystick....
so with buttons and menu you can do many things.

@All QB64 coders....
in programs folder  that ships with QB64 there is an ASCII game with loud sound, I have no found any reference to its author but he is Spanish or Latin people speaking Spanish language. I can argue watching the text used as output for users.
Right, the game can be optimized for output in ASCII graphic, for sound output, for input (now it uses two key, ESCAPE and UpArrow).
But it is politically uncorrect because the enemy to hit by bomb is always an antagonist of U.S.A.  So I think to change the framework story using the Spectre of 007 as bomber and adding some others countries in the list of enemies of Spectre.
Title: Re: Competition
Post by: bplus on October 03, 2021, 12:49:12 pm
Hi boys and girls

@Steve you have described a my boxes demo with a power punch bar increasing pressing key and decreasing by time
So I could resume it from Ongoing folder.

@bplus  yes one key but not one key of keyboard, we can use also one button of mouse or one button of joystick....
so with buttons and menu you can do many things.

@All QB64 coders....
in programs folder  that ships with QB64 there is an ASCII game with loud sound, I have no found any reference to its author but he is Spanish or Latin people speaking Spanish language. I can argue watching the text used as output for users.
Right, the game can be optimized for output in ASCII graphic, for sound output, for input (now it uses two key, ESCAPE and UpArrow).
But it is politically uncorrect because the enemy to hit by bomb is always an antagonist of U.S.A.  So I think to change the framework story using the Spectre of 007 as bomber and adding some others countries in the list of enemies of Spectre.

Yeah, Steve's thing sounds great for a gorilla throwing bananas at buildings sort of thing ;-))

Quote
@bplus  yes one key but not one key of keyboard, we can use also one button of mouse or one button of joystick....
so with buttons and menu you can do many things.

What?
I am hoping to get a little forum competition going:
* one key (the spacebar)
* screen 0
* Halloween Theme is plus
* Done by Halloween
Are you interested?

@TempodiBasic  the game you are describing from Samples sounds like something I dabbled with. Missile Command:
https://www.qb64.org/forum/index.php?topic=3978.msg133192#msg133192

It also reminds me of the throwing rocks thing with @SierraKen (Are you still looking in?)
Title: Re: Competition
Post by: johnno56 on October 03, 2021, 03:11:42 pm
The difficulty with 'one button' could all go away by using one simple neural interface... Am I wrong? (bplus... say nothing... lol)
Title: Re: Competition
Post by: SMcNeill on October 03, 2021, 03:37:51 pm
Here’s an idea for a one-button Halloween game:  CANDY SUBMARINE!


Gameplay involves using the spacebar to inflate or deflate the ballasts on a sub to make it go up and down.  The game is naturally a side scroller, which ceaselessly scrolls automatically.

The goal is to grab the various candies that have spilled overboard off a massive Halloween cargo ship in a storm and sunk into the ocean.

The challenge comes in maintaining your oxygen levels (it refills to 100% when you’re at the surface, decreases every second fully submerged), and avoiding the hazards of the deep — sharks, octopuses, squids, old war world ii mines…

Salvage all the candy you possibly can on the CANDY SUBMARINE!!



As you can probably tell, I’ve been working on writing and publishing my next book again…. At the moment I’m stuck in “creative mode”, instead of “technical mode” — that comes during the editing phase of the story, pre-publishing.   Right now, I can brainstorm a thousand game ideas…. I’m just not in the right stage of mind to actually sit down and program them.  LOL!!

Feel free to make use of any idea I share that one of you guys might want to take a run at making.  😉
Title: Re: Competition
Post by: SMcNeill on October 03, 2021, 04:23:29 pm
CURSE MASTER!

You’re a witch with a goal!  Curse all the kids on Halloween night!

Gameplay is again a simple continual side scroller as you fly over the kids heads on your broom.

Kids come in four variations: boy/girl, young/old

To curse them, you have to use the right magic while they’re on the screen…

young boys require a press-hold-press action of the spacebar.
young girls are hold-press-press.
older boys are hold-press-hold.
Older girls are press-hold-hold.

Presses are generated by a quick up and down of the space bar.
Holds require the spacebar to go down for 0.2 seconds or more, then up.

You have a set amount of magic to curse an increasing number of children each level.  As you progress, number of children increases per level, and so does your flying speed.  Magic is renewed at the start of each new level.

Can you be the witch who curses the most children?  Will you become The Curse Master?!!
Title: Re: Competition
Post by: SMcNeill on October 03, 2021, 04:45:40 pm
HILLBILLY HORSESHOES

A one-click game based off one we used to play here on the farm after the fall harvest, so it fits the Halloween theme somewhat.  Now what we used to do involved a lot of drinking and spinning…. You grab a horseshoe, spin around in a circle and toss!!  Whichever idiot lost had to drink a shot of fresh green apple shine!

Needless to say, it’s a Redneck Classic!  Drinking and hurling heavy iron projectiles!  What can go wrong??

To save you guys from learning, a one-click version of this would be simple:

Place two targets on the screen.  Your goal is to hit as close to that target as possible.  To do so, the player avatar stands behind their horseshoe and spins in a circle building up momentum.  When ready, release the shoe and aim for the heavens!

Gameplay:

Press the spacebar to spin.  The longer you hold it, the faster you spin and the farther the horseshoe travels.
Release to hurl in that direction, at that speed, and see how close you get to the target!

Bonus points for killing spectators!
Even more points if they’re on your side!
Title: Re: Competition
Post by: SMcNeill on October 03, 2021, 05:05:05 pm
Here’s an idea @bplus might enjoy making: WORD BUMP

Take a dictionary to gather a list of words. 
Scroll one across the screen from left to right.
As it passed the center target area of the screen, you can hit the spacebar to BUMP out a letter to make a new word.

For example: PETE scrolls across the screen.  As the T crosses the target, you hit the spacebar and bump it out to spell PEE.  1 word made via bumping!

The word then scrolls across the screen a second time.  Bump the first E and make PET!

For a secondary challenge, you can form words with the discard letters as well.

Example: Word is BPLUS…

Bump the S, U, and B to make SUB!

You can form words from left to right, or from right to left, but the game ends when you fail to form a new word  from either direction on your turn.

How many words can you form??
Title: Re: Competition
Post by: TempodiBasic on October 03, 2021, 05:14:04 pm
@bplus
yes it is not so near to Missile Command (fine!)
as you can see from the source code posted here
Code: QB64: [Select]
  1. DECLARE SUB CentrarTexto (t$, y%)
  2.  
  3.  
  4. menu:
  5. Color 10, 0
  6. CentrarTexto "ÛÛÛÛÛÛ»           ÛÛÛÛÛÛÛ» ÛÛ» ÛÛ»", 2
  7. CentrarTexto "ÛÛÉÍÍÛÛ» ÛÛ»  ÛÛ» ÛÛÉÍÍÍͼ ÛÛº ÛÛº", 3
  8. CentrarTexto "ÛÛÛÛÛÛɼ ÛÛº  ÛÛº ÛÛÛÛÛÛÛ» ÛÛÛÛÛÛº", 4
  9. CentrarTexto "ÛÛÉÍÍÛÛ» ÛÛº  ÛÛº ÈÍÍÍÍÛÛº ÛÛÉ ÛÛº", 5
  10. CentrarTexto "ÛÛÛÛÛÛɼ ÛÛÛÛÛÛÛº ÛÛÛÛÛÛÛº ÛÛº ÛÛº", 6
  11. CentrarTexto "ÈÍÍÍÍͼ  ÈÍÍÍÍÍͼ ÈÍÍÍÍÍͼ Èͼ Èͼ", 7
  12. CentrarTexto "BOMBER - BOMBER - BOMBER - BOMBER", 8
  13. CentrarTexto "Ayuda a Bush en su mision de matar inocentes por el mundo!", 10
  14. CentrarTexto "Pero ten cuidado! La gente cada vez corre mas rapido...", 11
  15. CentrarTexto "Y tu helicoptero tambien!", 12
  16.  
  17. CentrarTexto "La unica tecla necesaria es Arriba (para dejar bombas).", 13
  18. CentrarTexto "Este programa esta hecho 100% en Qbasic, y es un poco aburrido...", 14
  19.  
  20. Play "o2 l16 df+af+df+af+df+af+df+af+eac+aeac+aeac+aeac+adf+bf+df+bf+df+bf+df+bf+d-f+ap16 d-f+ap16 d-f+ap16 d-f+aa"
  21. CentrarTexto "(Presione cualquier tecla para continuar, ESC para salir)", 20
  22.  
  23.         Case Chr$(27)
  24.             End
  25.     End Select
  26.  
  27. bombas = 50
  28. ac = 16000
  29. columna = 1
  30. linea = 3
  31. lineaa = 3
  32. x = 0
  33. mn = 30
  34. op = 4
  35. dd = 1
  36. we = 0
  37.  
  38.  
  39.     If dd = 1 Then
  40.         Color 31
  41.         CentrarTexto "Afghanistan", 10
  42.     End If
  43.  
  44.     If dd = 2 Then
  45.         Color 31
  46.         CentrarTexto "Irak", 10
  47.     End If
  48.  
  49.     If dd = 3 Then
  50.         Color 31
  51.         CentrarTexto "Iran", 10
  52.     End If
  53.  
  54.     If dd = 4 Then
  55.         Color 31
  56.         CentrarTexto "Arabia Saudita", 10
  57.     End If
  58.  
  59.     If dd = 5 Then
  60.         Color 31
  61.         CentrarTexto "Venezuela", 10
  62.     End If
  63.  
  64.     If dd = 6 Then
  65.         Color 31
  66.         CentrarTexto "Colombia", 10
  67.     End If
  68.  
  69.     If dd = 7 Then
  70.         Color 31
  71.         CentrarTexto "Brasil", 10
  72.     End If
  73.  
  74.     If dd = 8 Then
  75.         Color 31
  76.         CentrarTexto "Cuba", 10
  77.     End If
  78.  
  79.     If dd = 9 Then
  80.         Color 31
  81.         CentrarTexto "Uruguay", 10
  82.     End If
  83.  
  84.     If dd = 10 Then
  85.         Color 31
  86.         CentrarTexto "India", 10
  87.     End If
  88.  
  89.     If dd = 11 Then
  90.         Color 31
  91.         CentrarTexto "Libia", 10
  92.     End If
  93.  
  94.     If dd = 12 Then
  95.         Color 31
  96.         CentrarTexto "Sudafrica", 10
  97.     End If
  98.  
  99.     If dd = 13 Then
  100.         Color 31
  101.         CentrarTexto "Alemania", 10
  102.     End If
  103.  
  104.     If dd = 14 Then
  105.         Color 31
  106.         CentrarTexto "Japon", 10
  107.     End If
  108.  
  109.     If dd = 15 Then
  110.         Color 31
  111.         CentrarTexto "Rusia", 10
  112.     End If
  113.  
  114.  
  115.     If bombas = 0 Then
  116.         Color 4
  117.         CentrarTexto "Sin municiones!", 12
  118.         op = op - 1
  119.         bombas = 50
  120.         Do While InKey$ = ""
  121.         Loop
  122.     End If
  123.  
  124.     Color 12
  125.     Locate 1, 1
  126.     Print "Nivel: "
  127.     Locate 1, 8
  128.     Print dd
  129.  
  130.     If op = 0 Then
  131.         Color 2, 0
  132.         Cls
  133.         CentrarTexto "Perdiste!", 12
  134.         Do While InKey$ = ""
  135.         Loop
  136.         Sleep
  137.         GoTo menu
  138.     End If
  139.  
  140.     Locate 1, 30
  141.     Color 9
  142.     Print "Oportunidades:"
  143.     Locate 1, 45
  144.     Print op
  145.  
  146.     Locate 1, 60
  147.     Color 10
  148.     Print "Bombas:"
  149.     Locate 1, 69
  150.     Print bombas
  151.  
  152.     If we = 15 Then
  153.         Color 30
  154.         CentrarTexto "Ultimo Nivel!", 12
  155.     End If
  156.  
  157.     If we = 16 Then
  158.         Color 4, 0
  159.         Cls
  160.         Color 15
  161.         CentrarTexto "È=XO", 10
  162.         Color 4
  163.         CentrarTexto "*", 14
  164.         Color 10
  165.         Locate 23, 45
  166.         Print ""
  167.         Locate 23, 46
  168.         Print ""
  169.         Locate 23, 33
  170.         Print ""
  171.         Locate 23, 34
  172.         Print ""
  173.         Color 9
  174.         CentrarTexto "ÉÍÍÍÍÍÍ»", 16
  175.         CentrarTexto "ºÍþÍþÍþº", 17
  176.         CentrarTexto "ºþÍþÍþͺ", 18
  177.         CentrarTexto "ºÍþÍþÍþº", 19
  178.         CentrarTexto "ºþÍþÍþͺ", 20
  179.         CentrarTexto "ºÍþÍþÍþº", 21
  180.         CentrarTexto "ºþÍþÍþͺ", 22
  181.         CentrarTexto "ºÍþÍÛÍþº", 23
  182.         Color 28
  183.         CentrarTexto "Congratulations!", 1
  184.         Color 2
  185.         CentrarTexto "Lo has hecho, ahora todo el petroleo del mundo es de Bush!", 3
  186.         CentrarTexto "Los Bush vuelven a ganar... Pero no se si felicitarte", 4
  187.         CentrarTexto "por matar gente... Que deberia hacer?", 5
  188.         CentrarTexto "Ganaste! GRACIAS POR JUGAR!", 6
  189.         Play "T120 O2 L4"
  190.         Play "F8 D8 <B- >D F B-2 >D8 C8 <B- D E F2 F8 F8 >D. C8 <B-"
  191.         Play "A2 G8 A8 B- B- F D <B- >F8 D8 <B- >D F B-2 >D8 C8"
  192.         Play "<B- D E F2 F8 F8 >D. C8 <B- A2 G8 A8 B- B- F D <B-"
  193.         Play ">>D8 D8 D D E- F2. E-8 D8 C C D E-2 E- D2 C8 <B-8"
  194.         Play "A2 G8 A8 B- D E F2 F B- B- B-8 A8 G G G"
  195.         Play ">C E-8 D8 C8 <B-8 B- A2 P4"
  196.         Play "F8 F8 B-. >C8 D8 E-8 F2 <B-8 >C8 D. E-8 C <B-2"
  197.  
  198.         GoTo menu
  199.     End If
  200.  
  201.     If m = 1 Then
  202.         lineaa = lineaa + 1
  203.  
  204.  
  205.         If lineaa = 23 Then
  206.             If tipitoc = mn Then
  207.                 Color 9
  208.                 CentrarTexto "                                    ", 10
  209.                 Color 4
  210.                 CentrarTexto "Le diste!", 10
  211.                 Play "o3 l15 cc < b > cc < b > cc < b > cc < b > c < b > c < bffeffeffeffefefg"
  212.                 dd = dd + 1
  213.                 we = we + 1
  214.                 bombas = 50
  215.             End If
  216.  
  217.             If tipitoc = sd Then
  218.                 we = we + 1
  219.                 dd = dd + 1
  220.                 ac = ac - 1000
  221.                 Color 9
  222.                 CentrarTexto "                                    ", 10
  223.                 Color 4
  224.                 CentrarTexto "Le diste!", 10
  225.                 bombas = 50
  226.                 Play "o3 l15 cc < b > cc < b > cc < b > cc < b > c < b > c < bffeffeffeffefefg"
  227.             End If
  228.  
  229.             If tipitoc = fd Then
  230.                 Color 4
  231.                 ac = ac - 1000
  232.                 Color 9
  233.                 CentrarTexto "                                    ", 10
  234.                 Color 4
  235.                 CentrarTexto "Le diste!", 10
  236.                 dd = dd + 1
  237.                 we = we + 1
  238.                 Play "o3 l15 cc < b > cc < b > cc < b > cc < b > c < b > c < bffeffeffeffefefg"
  239.                 bombas = 50
  240.             End If
  241.  
  242.  
  243.             m = 2
  244.             lineaa = 2
  245.         End If
  246.  
  247.         Locate lineaa, tipitoc
  248.         Color 4
  249.         Print "*"
  250.     End If
  251.  
  252.     Color 15, 9
  253.     columna = columna + 1
  254.     If columna = 78 Then
  255.         columna = 1
  256.     End If
  257.     Locate linea, columna
  258.     Print "È=XO"
  259.     Beep
  260.  
  261.     For i = 1 To ac
  262.     Next i
  263.  
  264.     Cls
  265.     vuelta:
  266.  
  267.     If we = 1 Then
  268.         we = 2
  269.     End If
  270.  
  271.     If x = 1 Then
  272.         Color x
  273.         Locate 23, z
  274.         Print ""
  275.         Locate 23, zy
  276.         Print ""
  277.         Locate 23, zu
  278.         Print ""
  279.         Locate 23, zi
  280.         Print ""
  281.         Locate 23, zo
  282.         Print ""
  283.     End If
  284.  
  285.         Case Chr$(0) + Chr$(72)
  286.             tipitoc = columna
  287.             m = 1
  288.             bombas = bombas - 1
  289.         Case Chr$(27)
  290.             End
  291.     End Select
  292.  
  293.  
  294.     h = Int(Rnd * 2) + 1
  295.     sd = mn + 1
  296.     fd = mn + 2
  297.  
  298.     If h = 1 Then
  299.         mn = mn + 1
  300.         sd = sd + 1
  301.         fd = fd + 1
  302.     End If
  303.     If h = 2 Then
  304.         mn = mn - 1
  305.     End If
  306.  
  307.     If mn = 0 Then
  308.         mn = mn + 1
  309.     End If
  310.  
  311.     Color we
  312.     Locate 23, mn
  313.     Print ""
  314.  
  315.     If mn = 0 Then
  316.         mn = mn + 1
  317.     End If
  318.  
  319.     If mn = 70 Then
  320.         mn = mn - 1
  321.     End If
  322.  
  323.  
  324. Sub CentrarTexto (t$, y%)
  325.     xnum% = (80 - Len(t$)) / 2
  326.     xspc% = Int((80 - Len(t$)) / 2)
  327.     If y% = 0 Then Print Tab(xspc%); t$: Exit Sub
  328.     Locate y%, xnum%: Print t$
  329.     '
  330.  
  331.  

About competition: it is a good thing ASCII + one keyboard Key for all the game + Halloween theme (colors and  NPCs and User)
IMHO it need to define what is the game.... splashscreen/title  and or music and or sounds and or options panel and or hall of fame and or kind/type of game   any or a specified group [text game?, ASCII graphic ? Shooter? puzzle? Adventure? Dugeon? race? Fight?etc etc]
Title: Re: Competition
Post by: TempodiBasic on October 03, 2021, 05:25:12 pm
@SMcNeill
Great Steve! Your brainstorm is releasing good fruits:
1-  WORD BUMP 1.0
2-  WORD BUMP 2.0
3-  HILLBILLY HORSESHOES
4-  CURSE MASTER!
5-  CANDY SUBMARINE!

who do take one of these ideas of Steve to develop and so he shares credits with Steve?
Title: Re: Competition
Post by: bplus on October 03, 2021, 08:30:38 pm
Quote
As you can probably tell, I’ve been working on writing and publishing my next book again…. At the moment I’m stuck in “creative mode”, instead of “technical mode” — that comes during the editing phase of the story, pre-publishing.   Right now, I can brainstorm a thousand game ideas…. I’m just not in the right stage of mind to actually sit down and program them.  LOL!!

Luv those moments, good idea to write them down.

Title: Re: Competition
Post by: bplus on October 03, 2021, 08:33:04 pm
Quote
IMHO it need to define what is the game.... splashscreen/title  and or music and or sounds and or options panel and or hall of fame and or kind/type of game   any or a specified group [text game?, ASCII graphic ? Shooter? puzzle? Adventure? Dugeon? race? Fight?etc etc]

Might be over-thinking this just a bit @TempodiBasic having only the spacebar to press and screen 0 (non graphics) is pretty restrictive already.
Title: Re: Competition
Post by: bplus on October 03, 2021, 10:55:44 pm
@johnno56

I came up with genius solution for easier input of letters with spacebar. I have puzzle reworked but it needs your assets magic specially for Halloween Theme. It would be really cool if a ghostly voice read back the selected letters or 1 thru 4 digits for verification, plus, any other effects that Moo ha ha mind of yours may come up with.

Title: Re: Competition
Post by: johnno56 on October 04, 2021, 12:39:21 am
Hmm... Manipulating sound files; To make them sound 'creepy'; 26 letters and 4 digits; For a Halloween theme you say?

There is a clueless percentage of the Australian population that seems to want to 'acquire' that dubious celebration... But 'this' household does not and will not support those sugar-craving little urchins... Sorry. I digress... Discussion for another time...

I am not a wizard, when it comes to sound files, but I can "give it a shot". Sounds (no pun intended) like fun...

Did you have a "background" track in mind (eg: graveyard sounds; music etc)?
Title: Re: Competition
Post by: Pete on October 04, 2021, 02:37:27 am
I tried programming Steve's Candy Submarine in SCREEN 0, but so far all I've got is a CANDY ASCII SUB.

     t
Pe   e
Title: Re: Competition
Post by: bplus on October 04, 2021, 08:41:21 am
Hmm... Manipulating sound files; To make them sound 'creepy'; 26 letters and 4 digits; For a Halloween theme you say?
Yes  :)

There is a clueless percentage of the Australian population that seems to want to 'acquire' that dubious celebration... But 'this' household does not and will not support those sugar-craving little urchins... Sorry. I digress... Discussion for another time...
Remember Trick or Treat is 2 options, if you are not into rotting out children's teeth then you must treat them with a trick, something that will scare them away permanently eg, tell them how much coffee you drink every day! ;-))

I am not a wizard, when it comes to sound files, but I can "give it a shot". Sounds (no pun intended) like fun...
Did you have a "background" track in mind (eg: graveyard sounds; music etc)?
Nothing particular in my mind, I will leave it up to the Moo ha ha Dept.

I will post my Halloween Challenge game here with Screen 0 and start working on some graphics effects for Syntax where Screen 0 is not required. I found myself limited by weird color pallet of Screen 0 high red (12) looks pink to me.
Title: Re: Competition
Post by: johnno56 on October 04, 2021, 09:21:13 am
Fascinating. Trick OR treat, you say?

Ok. No sugar it is... My next question, in regards to 'Tricks', I wonder if it is illegal to set 'man traps' in Australia? I'm thinking of camouflaged, bamboo spiked, snake pits.... None of these woosie jumping spiders or meat-starved pit bulls.... Oh. Hang on. The parents may have developed an attachment to the little terrors and they may want them back... Ok. Scratch the woosie spiders...
Title: Re: Competition
Post by: SMcNeill on October 04, 2021, 09:53:46 am
@bplus Remember, with _PALETTECOLOR, you can set your own custom colors for a SCREEN 0 program.  Might be important for setting the right tone for your game, since you're limited to a max of 16 colors.
Title: Re: Competition
Post by: bplus on October 04, 2021, 10:07:26 am
Great! Thanks @Steve  ha, ha @SMcNeill






Title: Re: Competition
Post by: TempodiBasic on October 04, 2021, 07:53:24 pm
@bplus
ok man, so ANY kind of game is welcome, text adventure, dugeon, puzzle, card game, platform, shooter, fighting and so on... all in ASCII with 16 color plus blinking! (0-31 = 32 colors to use), yes sound and music.
Let's go!
Title: Re: Competition
Post by: bplus on October 04, 2021, 08:21:48 pm
@bplus
ok man, so ANY kind of game is welcome, text adventure, dugeon, puzzle, card game, platform, shooter, fighting and so on... all in ASCII with 16 color plus blinking! (0-31 = 32 colors to use), yes sound and music.
Let's go!

Great, and the most important thing, One Key only (except maybe an esc to quit).
Title: Re: Competition
Post by: bplus on October 05, 2021, 03:32:39 am
You know, I was saying Screen 0 (Text) for Competition for this forum challenge but I am having 2nd thoughts.

It really should be Halloween Themed and for that graphic freedom is essential.

I was saying Screen 0 (Text) to maybe get @Pete involved but he was kidding and my program needs some graphics distractions :-)) (In fact the one key requirement makes it a bit of a pig that probably won't be fixed by graphics lipstick. I need to find some idea made for one key control like Flappy Bird.)

So if OK with you guys forget Screen 0 Text only requirement unless you've already started on something. Let's say extra points if you do pull off a Screen 0 Text only Game and that wouldn't need to be so Halloween themed.

So either one key control text game or one key control Halloween theme game and extra credit for doing both text and Halloween.

(Yeah, I want to get @Dav latest game qualified.)
Title: Re: Competition
Post by: johnno56 on October 05, 2021, 07:22:49 am
I have created 62 audio files.
Complete alphabet - includes 1-4 in wav and ogg (2 files)
30 individual letters - including 1-2 in wav and ogg (60 files)

They total to just over 6mb. Voice is female. No special effects.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
(sample - alphabet + 1 to 4)

If this is ok, let me know, and I will post the rest.

J
Title: Re: Competition
Post by: bplus on October 05, 2021, 09:46:42 am
Thanks @johnno56  I'll get to work on it today.
Title: Re: Competition
Post by: bplus on October 05, 2021, 01:16:31 pm
Hi @johnno56

Oh! It's just one sample ogg.

I thought you said 60 files, well what can I say didn't have my coffee yet.

Is it possible to get a deep, dark, Moo ha ha kind of voice saying or implying:
"So, you've selected B, (Moo ha ha, well let's just see how that works out for you, Moo ha ha)."

Or we could do good voice (female computer like when the guess is correct), bad voice (Moo ha ha devil may care like when the guess is wrong!) routine.
Title: Re: Competition
Post by: bplus on October 05, 2021, 01:32:01 pm
Hi @johnno56

Oh! It's just one sample ogg.

I thought you said 60 files, well what can I say didn't have my coffee yet.

Is it possible to get a deep, dark, Moo ha ha kind of voice saying or implying:
"So, you've selected B, (Moo ha ha, well let's just see how that works out for you, Moo ha ha)."

Or we could do good voice (female computer like when the guess is correct), bad voice (Moo ha ha devil may care like when the guess is wrong!) routine.

Oh man, I've been watching to much TV, too much Me Too political correctness???
ie female = good, masculine deep voiced male = bad

Please reverse good and bad characterization stereotypes, please, let's buck this trend!
Title: Re: Competition
Post by: SMcNeill on October 05, 2021, 01:36:39 pm
@bplus So here's a quick question: Would something like this work as a valid entry for the One Input challenge?

Code: QB64: [Select]
  1. Screen _NewImage(640, 480, 32)
  2.  
  3.     x = OneInput
  4.     Print x; Chr$(x)
  5.     _Limit 30
  6.  
  7. Function OneInput
  8.     Static InputScreen
  9.     If StaticScreen = 0 Then
  10.         StaticScreen = _NewImage(400, 400, 32)
  11.         D = _Dest
  12.         _Dest StaticScreen
  13.         For i = 1 To 26
  14.             x = 200 + 150 * Sin(_D2R(13.85 * i))
  15.             y = 200 + 150 * Cos(_D2R(13.85 * i))
  16.             CircleFill x, y, 16, &HFFFFFF00
  17.             Color &HFFFF0000, 0
  18.             _PrintString (x - 8, y - 4), Chr$(64 + i)
  19.         Next
  20.         temp$ = "Move mouse to choice"
  21.         l = _PrintWidth(temp$)
  22.         _Dest StaticScreen
  23.         _PrintString ((400 - l) / 2, 196), temp$
  24.         _Dest D
  25.     End If
  26.  
  27.  
  28.     PCopy 0, 1
  29.     _PutImage ((_Width - 400) / 2, (_Height - 400) / 2), StaticScreen
  30.     _MouseMove _Width / 2, _Height / 2
  31.     _Delay .2
  32.     While _MouseInput: Wend 'clear mousebuffer after move
  33.     Do
  34.         While _MouseInput: Wend
  35.         mx = _MouseX: my = _MouseY
  36.         For i = 1 To 26
  37.             x = _Width / 2 + 150 * Sin(_D2R(13.85 * i))
  38.             y = _Height / 2 + 150 * Cos(_D2R(13.85 * i))
  39.             If InCircle(mx, my, x, y, 16) Then Exit Do
  40.         Next
  41.     Loop
  42.     OneInput = 64 + i
  43.     PCopy 1, 0
  44.  
  45. Sub CircleFill (CX As Integer, CY As Integer, R As Integer, C As _Unsigned Long)
  46.     ' CX = center x coordinate
  47.     ' CY = center y coordinate
  48.     '  R = radius
  49.     '  C = fill color
  50.     Dim Radius As Integer, RadiusError As Integer
  51.     Dim X As Integer, Y As Integer
  52.     Radius = Abs(R)
  53.     RadiusError = -Radius
  54.     X = Radius
  55.     Y = 0
  56.     If Radius = 0 Then PSet (CX, CY), C: Exit Sub
  57.     Line (CX - X, CY)-(CX + X, CY), C, BF
  58.     While X > Y
  59.         RadiusError = RadiusError + Y * 2 + 1
  60.         If RadiusError >= 0 Then
  61.             If X <> Y + 1 Then
  62.                 Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  63.                 Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  64.             End If
  65.             X = X - 1
  66.             RadiusError = RadiusError - X * 2
  67.         End If
  68.         Y = Y + 1
  69.         Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  70.         Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  71.     Wend
  72.  
  73. Function InCircle (px, py, cx, cy, r)
  74.     distX = px - cx
  75.     distY = py - cy
  76.     distance = Sqr((distX * distX) + (distY * distY))
  77.     If (distance <= r) Then temp = -1
  78.     InCircle = temp
  79.  

I'm only using one input feed for my program here -- the mouse position itself.  It doesn't care about mouseclicks, or up or down positions, or anything of that sort...  Just how you move the trackball itself.

Is there any reason why a trackball wouldn't count as "One Input", since it's only that one input segment of a mouse, much like the "Spacebar" is only that single segment of our keyboard??

Personally, I find this to be perhaps the most intuitive of input methods that I can come up with that only involves a single input feed.
Title: Re: Competition
Post by: bplus on October 05, 2021, 02:01:34 pm
Hi Steve,

I had something like that in mind too, when I first read of this competition at Syntax.

I ruled it out for myself because I was sure that this part:
Code: QB64: [Select]
  1.     DO
  2.         WHILE _MOUSEINPUT: WEND
  3.         mx = _MOUSEX: my = _MOUSEY
  4.         FOR i = 1 TO 26
  5.             x = _WIDTH / 2 + 150 * SIN(_D2R(13.85 * i))
  6.             y = _HEIGHT / 2 + 150 * COS(_D2R(13.85 * i))
  7.             IF InCircle(mx, my, x, y, 16) THEN EXIT DO
  8.         NEXT
  9.     LOOP
  10.  

Decides in an analog manner by position instead of a simple On/Off signal from a button eg you can use the fact the mouse was clicked, On/Off, but you can't use the place where it was clicked, that would be analog position control.

If you want to appeal my ruling I can take your case to the Syntax Bomb forum for the Supreme Court judge to rule ie, just link Qube to this discussion. I am pretty sure he would agree with me, but again I could be wrong, it wouldn't be the first time.
Title: Re: Competition
Post by: bplus on October 05, 2021, 02:07:32 pm
@SMcNeill

BTW that is a nice realization in code of what I was thinking and I know you want to stress that you didn't click anything!

You could alternately use Atan2 after the mouse is a certain distance away to pick up the general direction of choice so that it's not forced to remain in a the circle.
Title: Re: Competition
Post by: SMcNeill on October 05, 2021, 02:09:49 pm
@SMcNeill

BTW that is a nice realization in code of what I was thinking and I know you want to stress that you didn't click anything!

You could alternately use Atan2 after the mouse is a certain distance away to pick up the general direction of choice so that it's not forced to remain in a the circle.


Quote from: MikeHart on August 14, 2021, 06:56:10
Question: does one feature of a controlling device include an axxis of a Mouse or a Stick on a gamepad, an analog button on a gamepad? Or are we bound to Buttons with 2 states, on and off?

Answer:
Single on / off state be it a key on a keyboard, click on a mouse, button on a joystick / joypad ( X Y etc ). No analog input for main gameplay.
Title: Re: Competition
Post by: SMcNeill on October 05, 2021, 02:11:55 pm
So I guess the timed spacebar method is my best input idea so far. 

Or morse code.  LOL!
Title: Re: Competition
Post by: bplus on October 05, 2021, 02:25:50 pm
So I guess the timed spacebar method is my best input idea so far. 

Or morse code.  LOL!

Yes! Morse code I think is OK because timers are OK. Even though something in time is a position, whether it's past a certain point or not is On/Off or Yes/No or True/False = Digital. So Morse code would be acceptable but who wants to learn it. The game would have to teach it in fun way to be a winner. It's a possibility.

Title: Re: Competition
Post by: johnno56 on October 05, 2021, 03:33:56 pm
Oh, a neural interface is looking better all the time... Moo Ha Ha...  "Igor!  Throw the switch!"  "Yes, master."
Title: Re: Competition
Post by: johnno56 on October 05, 2021, 03:37:38 pm
bplus,

Here is another "sample". Added a slight echo and modified the pitch... If you like it then I will whip up a batch....

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

In reference to, "So you have selected..."  Maybe better to have a small "pool" of responses rather than "selected B", "chosen B" "picked B". Play a random 'pool' response followed by the letter? Just a thought. By the way... The voice does not have a sinister laugh... Cool if it did... I will look for one... *sigh*
Title: Re: Competition
Post by: bplus on October 05, 2021, 05:20:39 pm
@johnno56

000.ogg is getting close, lower and stretch out more?

Yes, like idea of random Your selection was X, you chose X, OK x it is... I don't know how much work I am asking of you.

I don't know if I should encourage this but: (Moo ha ha help from Petr and something from Sound Bible I think.)
Title: Re: Competition
Post by: johnno56 on October 05, 2021, 07:46:12 pm
Slightly modified (deeper). Also a sample of comments.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
  [ This attachment cannot be displayed inline in 'Print Page' view ]  

Cool laugh tracks....
Title: Re: Competition
Post by: bplus on October 05, 2021, 09:06:53 pm
Yeah ominous nonhuman voice, pretty good. :)
Title: Re: Competition
Post by: random1 on October 05, 2021, 09:48:10 pm
This is a game I built a while back for my grand kids.   It's controlled completely by left
mouse button. It has 10 repeating levels where the amount of time the shooter has is
reduced for each level.  I think I made it to level 4 once.   I did however add a cheat
that allowed me to kill all the bugs in time.
The only thing with entering the contest was that several of the background screens,
music and sounds downloaded from the web.   

R1

Picture
https://i.postimg.cc/x1Qk9tmC/BUGS.png (https://i.postimg.cc/x1Qk9tmC/BUGS.png)

level 10
https://i.postimg.cc/Y2gnVCzH/level-10.png (https://i.postimg.cc/Y2gnVCzH/level-10.png)
   
Title: Re: Competition
Post by: johnno56 on October 05, 2021, 11:35:56 pm
bplus,

Here is the complete set of 'version 2' audio files. Alphabet, digits and comments.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

Let me know about the comments. It may be just my hearing, but some of them can be a little hard to make out. Let me know which ones and I will make them a bit louder.

J
Title: Re: Competition
Post by: bplus on October 06, 2021, 08:58:02 am
Thanks @johnno56

I just started converting to a graphics screen so I can add visual effects. I found some old code by Petr that was reading off letters from words input using data stored in the program. Voice too nice though. I also found a worm screen eater by @RhoSigma that seemed like a good idea for a Crypt setting. Probably code it my own way.

Title: Re: Competition
Post by: bplus on October 06, 2021, 09:03:27 am
This is a game I built a while back for my grand kids.   It's controlled completely by left
mouse button. It has 10 repeating levels where the amount of time the shooter has is
reduced for each level.  I think I made it to level 4 once.   I did however add a cheat
that allowed me to kill all the bugs in time.
The only thing with entering the contest was that several of the background screens,
music and sounds downloaded from the web.   

R1

Picture
https://i.postimg.cc/x1Qk9tmC/BUGS.png (https://i.postimg.cc/x1Qk9tmC/BUGS.png)

level 10
https://i.postimg.cc/Y2gnVCzH/level-10.png (https://i.postimg.cc/Y2gnVCzH/level-10.png)
 

Did you use a rail gun that just went back and forth across the screen automatically, you shoot with spacebar for the one key control?  Did bugs move?

Missile Command could be setup like that, you have to anticipate where your missile collides with enemy missile or bomb coming down.
Title: Re: Competition
Post by: bplus on October 06, 2021, 01:14:25 pm
bplus,

Here is the complete set of 'version 2' audio files. Alphabet, digits and comments.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

Let me know about the comments. It may be just my hearing, but some of them can be a little hard to make out. Let me know which ones and I will make them a bit louder.

J

The most garbled confirmation of Choice to my ears is "The Letter Is", the rest are good or good enough.

Letter W is horrible! Try 2 words "Double You"??
N, U, X are weak, the rest are good or good enough.

Thank the gods that oggs are working a little better in Windows 10, not crashing but File Explorer not exactly happy with so many in one folder and sometimes hangs and sometimes just exits the folder. At least no crash! :)

I hope everyone knows even though this dialog is seems mostly between Johnno and I, the files can be shared (between QB64 forum members for Hobby Programming purposes only), right @johnno56 ?
Title: Re: Competition
Post by: johnno56 on October 06, 2021, 10:04:07 pm
I think that lowering the pitch of the audio may be the problem. I will attempt to "tweak" them or try your "double you" trick or even use a different comment...
Title: Re: Competition
Post by: Pete on October 07, 2021, 12:43:11 am
There's always my game...

Code: QB64: [Select]
  1. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  2. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits
  3.  
  4. imaxalienforce = 6
  5. imaxalienmissiles = 3
  6. lmargin% = 2
  7. rmargin% = 79
  8. topmargin% = 3
  9. ialiencolstat = 6
  10. iwin = 3
  11. screenwidth% = rmargin% - lmargin% + 1
  12. ibk = 1
  13.  
  14. DIM SHARED a(imaxalienforce) AS STRING * 68
  15.  
  16. SCREEN 0, 0, 0, 0
  17. COLOR 7, 1: CLS
  18.  
  19. REM Make aliens
  20. a1$ = "-<" + CHR$(237) + ">-  "
  21. a$ = a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$
  22.  
  23. CALL qbide
  24. CALL instructions
  25.  
  26.     IF inextrnd = -1 THEN PCOPY 3, 0
  27.     tank$ = CHR$(218) + CHR$(127) + CHR$(191): icolor = 7
  28.     REDIM SHARED bullet%(5), bulletcol%(5), bulletdelay%(5), iltalien(imaxalienforce)
  29.     REDIM SHARED ia(imaxalienmissiles), iy(imaxalienmissiles), ix(imaxalienmissiles)
  30.     REDIM SHARED matrix(imaxalienforce) AS STRING * 10
  31.     alienforce% = imaxalienforce
  32.     level = .65
  33.     iround = iround + 1
  34.     level = level - iround / 15
  35.     inextrnd = -1
  36.     COLOR 7, ibk
  37.  
  38.     REM Set up aliens
  39.     ialiencol = ialiencolstat
  40.     LOCATE 2, ialiencol
  41.     FOR i = 1 TO imaxalienforce
  42.         IF i MOD 1 = 0 THEN PRINT
  43.         LOCATE , ialiencol
  44.         IF i = imaxalienforce THEN ileadingrow = CSRLIN: ileadingmax = ileadingrow
  45.         a(i) = a$
  46.         PRINT a(i)
  47.     NEXT
  48.  
  49.     REM Station
  50.     LOCATE 24, 40, 1, 7, 7
  51.     PRINT tank$;: LOCATE , POS(1) - 2: tanky% = CSRLIN: tankx% = POS(1) + 1
  52.     key$ = INKEY$: SLEEP 1
  53.  
  54.     DO
  55.         z1 = TIMER
  56.         DO
  57.             IF topmargin% + ileadingmax - (imaxalienforce * 2) >= topmargin% + 2 THEN
  58.                 IF imothership <> 0 THEN CALL mship(imothership)
  59.             END IF
  60.             IF ABS(TIMER - z1aliens) > level THEN
  61.                 CALL movealiens(ialiencol, ialiencolstat, iresults)
  62.                 z1aliens = TIMER
  63.             END IF
  64.             IF iresults < 0 THEN EXIT DO
  65.             IF ABS(TIMER - z1ia) > .3 THEN CALL alienmissile(iresults): z1ia = TIMER
  66.  
  67.             DEF SEG = 0
  68.             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  69.                 key$ = CHR$(32) ' Alt
  70.             ELSE
  71.                 key$ = ""
  72.             END IF
  73.             DEF SEG
  74.  
  75.             SELECT CASE key$
  76.                 CASE CHR$(32)
  77.                     IF flag = 0 THEN switch = switch * -1 - 1: flag = -1
  78.                     SELECT CASE switch
  79.                         CASE 0
  80.                             IF ABS(z9 - TIMER) > .15 THEN
  81.                                 IF POS(1) < screenwidth% THEN COLOR icolor, ibk: LOCATE , POS(1) - 1: PRINT " " + tank$;: LOCATE , POS(1) - 2
  82.                                 tanky% = CSRLIN: tankx% = POS(1)
  83.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  84.                                 z9 = TIMER
  85.                             END IF
  86.                         CASE -1
  87.                             IF ABS(z9 - TIMER) > .15 THEN
  88.                                 IF POS(1) > lmargin% + 1 THEN COLOR icolor, ibk: LOCATE , POS(1) - 2: PRINT tank$ + " ";: LOCATE , POS(1) - 3
  89.                                 tanky% = CSRLIN: tankx% = POS(1)
  90.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  91.                                 z9 = TIMER
  92.                             END IF
  93.                     END SELECT
  94.                     IF icolor = 7 THEN
  95.                         FOR i2 = 1 TO 5
  96.                             IF bullet%(i2) = 0 THEN
  97.                                 icolor = 12: COLOR icolor, ibk: GOSUB redraw
  98.                                 bullet%(i2) = -1: reload = TIMER: EXIT FOR
  99.                             END IF
  100.                         NEXT
  101.                     END IF
  102.                 CASE ""
  103.                     IF flag THEN skip = 0: flag = 0
  104.                 CASE CHR$(27): SYSTEM
  105.             END SELECT
  106.  
  107.             IF ABS(z1 - reload) > .6 AND reload <> 0 THEN
  108.                 GOSUB redraw
  109.                 icolor = 7: reload = 0
  110.             END IF
  111.  
  112.             REM Fire
  113.             FOR i = 1 TO 5
  114.                 SELECT CASE bullet%(i)
  115.                     CASE -1: bullet%(i) = tanky% - 1: bulletcol%(i) = tankx%
  116.                     CASE IS > 0
  117.                         IF bulletdelay%(i) = -1 OR bullet%(i) = tanky% - 1 THEN
  118.                             CALL checkcollision(ihitaliens, ialiencol, i4, i)
  119.                             z2bullet = TIMER: bulletdelay%(i) = 0
  120.                             COLOR 7, ibk
  121.                             LOCATE bullet%(i), bulletcol%(i)
  122.                             IF bullet%(i) = topmargin% AND imothership <> 0 THEN
  123.                                 IF SCREEN(ABS(bullet%(i)), bulletcol%(i)) <> 32 THEN
  124.                                     SOUND 1000, .75
  125.                                     LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  126.                                     imothership = 0
  127.                                 END IF
  128.                             END IF
  129.                             PRINT CHR$(24)
  130.                             IF CSRLIN <> 24 THEN LOCATE , bulletcol%(i): PRINT " ";
  131.                             IF ihitaliens <> 0 THEN CALL reprintaliens(ialiencol, ihitaliens, iresults, i4, i, imothership)
  132.                             LOCATE tanky%, tankx%
  133.                             IF bullet%(i) > topmargin% THEN
  134.                                 bullet%(i) = bullet%(i) - 1
  135.                             ELSE
  136.                                 GOSUB erasebullet
  137.                             END IF
  138.                         END IF
  139.                 END SELECT
  140.             NEXT
  141.  
  142.             REM Bullet timer delay
  143.             IF z2bullet <> 0 THEN
  144.                 IF z1 < z2bullet THEN z2bullet = z2bullet - 86400
  145.                 IF z1 - z2bullet >= .06 THEN
  146.                     FOR i2 = 1 TO 5
  147.                         IF bullet%(i2) <> 0 THEN bulletdelay%(i2) = -1
  148.                     NEXT i2
  149.                 END IF
  150.                 EXIT DO
  151.             END IF
  152.         LOOP
  153.         IF iresults < 0 THEN EXIT DO
  154.         IF alienforce% = 0 OR iresults = iwin THEN
  155.             FOR i = 1 TO imaxalienmissiles
  156.                 IF ia(i) <> 0 THEN EXIT FOR
  157.             NEXT
  158.             IF i > imaxalienmissiles THEN iwait = -1
  159.             IF iwait = -1 THEN
  160.                 EXIT DO
  161.             END IF
  162.         ELSE
  163.             iwait = 1
  164.         END IF
  165.     LOOP
  166.  
  167.     key$ = INKEY$
  168.     SLEEP 2
  169.     IF iresults = iwin OR iresults < 0 THEN
  170.         REM end game
  171.         EXIT DO
  172.     END IF
  173.     inextrnd = -1
  174. SELECT CASE iresults
  175.     CASE IS < 0
  176.         COLOR 7, ibk
  177.         LOCATE tanky% - 1, lmargin%
  178.         PRINT SPACE$(screenwidth%);
  179.         LOCATE tanky%, lmargin%
  180.         PRINT SPACE$(screenwidth%);
  181.         key$ = INKEY$
  182.         SOUND 140, 2
  183.         SLEEP 2
  184. CALL qbide
  185. CALL instructions
  186.  
  187. erasebullet:
  188. LOCATE ABS(bullet%(i)), bulletcol%(i): PRINT " ";
  189. bullet%(i) = 0: bulletcol%(i) = 0: bulletdelay%(i) = 0
  190. LOCATE tanky%, tankx%
  191.  
  192. redraw:
  193. COLOR , ibk: LOCATE tanky%, tankx% - 1: PRINT tank$;: LOCATE tanky%, tankx%: COLOR 7, ibk
  194.  
  195. DATA " Loading..."
  196. DATA "EOF"
  197. DATA "Game Over. Thanks for playing..."
  198. DATA "EOF2"
  199.  
  200. SUB alienattack (ialiencolstat, ialiencol)
  201.     z2alienfire = TIMER
  202.  
  203.     i3 = INT(RND * 10)
  204.     FOR i = 1 TO imaxalienmissiles
  205.         IF ia(i) = 0 THEN
  206.             FOR i2 = imaxalienforce TO 1 STEP -1
  207.                 IF RTRIM$(a(i2)) <> "" THEN
  208.                     IF MID$(matrix(i2), i3 + 1, 1) <> "0" THEN
  209.                         i4 = INSTR(i3 * 7 + 1, a(i2), CHR$(237)) + ialiencol
  210.                         EXIT FOR
  211.                     END IF
  212.                 END IF
  213.             NEXT i2
  214.             IF i4 <> 0 THEN
  215.                 ia(i) = (ileadingmax - (imaxalienforce - i2) * 2) * 80 + i4
  216.                 EXIT FOR
  217.             END IF
  218.         END IF
  219.     NEXT i
  220.  
  221.  
  222. SUB alienmissile (iresults)
  223.     irow = CSRLIN: icol = POS(1)
  224.     FOR i = 1 TO imaxalienmissiles
  225.         IF ia(i) <> 0 THEN
  226.             IF iy(i) = 0 THEN
  227.                 iy(i) = ia(i) \ 80: ix(i) = ia(i) MOD 80
  228.                 IF ix(i) = 0 THEN ix(i) = screenwidth%
  229.             END IF
  230.             LOCATE iy(i) + 1, ix(i)
  231.             COLOR 7, ibk
  232.             IF CSRLIN <= 24 THEN
  233.                 IF CSRLIN = 24 THEN IF SCREEN(CSRLIN, ix(i)) <> 32 THEN iresults = -1
  234.                 PRINT CHR$(25);
  235.             ELSE
  236.                 ia(i) = 0
  237.                 LOCATE iy(i), ix(i)
  238.                 PRINT " ";: iy(i) = 0
  239.                 ia(i) = 0
  240.                 LOCATE irow, icol
  241.                 EXIT SUB
  242.             END IF
  243.             LOCATE iy(i), ix(i): PRINT " ";
  244.             iy(i) = iy(i) + 1
  245.         END IF
  246.     NEXT
  247.     LOCATE irow, icol
  248.  
  249.  
  250. SUB checkcollision (ihitaliens, ialiencol, i4, i)
  251.     ihitaliens = 0
  252.     IF ileadingmax MOD 2 = bullet%(i) MOD 2 THEN
  253.         i4 = imaxalienforce - (ileadingmax - bullet%(i)) \ 2
  254.         IF bullet%(i) <= ileadingrow AND i4 > 0 AND i4 <= imaxalienforce THEN
  255.             IF RTRIM$(a(i4)) <> "" THEN
  256.                 IF bulletcol%(i) >= iltalien(i4) AND bulletcol%(i) - ialiencol <= LEN(RTRIM$(a(i4))) THEN
  257.                     IF MID$(a(i4), bulletcol%(i) - ialiencol, 1) > CHR$(32) THEN
  258.                         ihitaliens = bulletcol%(i) - ialiencol + 1
  259.                         i3 = ihitaliens - 7 + 1: IF i3 < 1 THEN i3 = 1: REM count from the "<" symbol.
  260.                         i2 = INSTR(i3 + 1, a(i4), "<") - 1
  261.                         MID$(a(i4), i2, 7) = SPACE$(7)
  262.                         MID$(matrix(i4), (i2 + 1) \ 7 + 1, 1) = "0"
  263.                     END IF
  264.                 END IF
  265.             END IF
  266.         END IF
  267.     END IF
  268.  
  269.     FOR i2 = 1 TO imaxalienmissiles
  270.         IF ia(i2) <> 0 THEN
  271.             IF iy(i2) >= bullet%(i) AND ix(i2) = bulletcol%(i) THEN
  272.                 ihitaliens = -i2
  273.                 EXIT FOR
  274.             END IF
  275.         END IF
  276.     NEXT
  277.  
  278.  
  279. SUB instructions
  280.  
  281.     ''in$ = "EOF"
  282.     IF in$ = "" THEN
  283.         key$ = INKEY$
  284.         LOCATE 3, 3, 1, 7, 7: COLOR 7, ibk
  285.         SLEEP 2
  286.         DO
  287.             READ in$
  288.             IF MID$(in$, 1, 3) = "EOF" THEN EXIT DO
  289.             FOR i = 1 TO LEN(in$)
  290.                 SOUND 400, .1
  291.                 LOCATE , 2 + i
  292.                 PRINT MID$(in$, i, 1);
  293.                 z = TIMER
  294.                 DO
  295.                     IF ABS(z - TIMER) > .1 THEN EXIT DO
  296.                 LOOP
  297.             NEXT
  298.             LOCATE , , 0, 7, 0
  299.             key$ = INKEY$
  300.             SLEEP 1
  301.             PRINT
  302.             LOCATE , 3
  303.         LOOP
  304.         key$ = INKEY$
  305.         SLEEP 1
  306.     END IF
  307.  
  308.     IF in$ = "EOF" THEN
  309.         COLOR 7, 1
  310.         FOR i = 1 TO 5
  311.             LOCATE 2 + i, 2: PRINT SPACE$(78)
  312.         NEXT
  313.         FOR i = 3 TO 24
  314.             LOCATE i, 80: PRINT CHR$(179);
  315.         NEXT
  316.         LOCATE 21, 2: PRINT STRING$(78, " ");
  317.         LOCATE 22, 1: PRINT CHR$(179);
  318.         LOCATE 22, 80: PRINT CHR$(179);
  319.         LOCATE 22, 2: PRINT STRING$(78, " ");
  320.     ELSE
  321.         COLOR 0, 3
  322.     END IF
  323.  
  324.     COLOR 0, 3
  325.     yy% = CSRLIN: xx% = POS(1)
  326.     LOCATE 25, 76 - LEN(LTRIM$(STR$(ihits)))
  327.     PRINT LTRIM$(STR$(ihits));
  328.     LOCATE 25, 80 - LEN(LTRIM$(STR$(imaxalienforce - alienforce%)))
  329.     PRINT "0";
  330.     LOCATE yy%, xx%
  331.  
  332.     PCOPY 0, 3: REM save skin
  333.  
  334.  
  335. SUB marchdown (ialiencol, ialiencolstat, imotion, iresults)
  336.     COLOR 7, ibk
  337.     ileadingrow = ileadingrow + 1
  338.     ileadingmax = ileadingmax + 1
  339.     COLOR 7, ibk
  340.     FOR i = 1 TO imaxalienforce
  341.         IF RTRIM$(a(i)) <> "" THEN
  342.             ialiencol = ialiencolstat + imotion
  343.             LOCATE ileadingmax - (imaxalienforce * 2) + i * 2 - 1, lmargin%
  344.             PRINT STRING$(screenwidth%, " ")
  345.             LOCATE , ialiencol + INSTR(a(i), "-")
  346.             iltalien(i) = POS(1)
  347.             PRINT LTRIM$(RTRIM$(a(i)))
  348.         END IF
  349.     NEXT
  350.     LOCATE irow, icol
  351.     level = level - .025
  352.     IF ileadingrow = 22 THEN iresults = -2
  353.  
  354. SUB movealiens (ialiencol, ialiencolstat, iresults)
  355.     STATIC imotion, imarch, imotiondir
  356.     IF inextrnd = -1 THEN inextrnd = 0: imotion = 0: imarch = 0: imotiondir = 0
  357.     irow = CSRLIN: icol = POS(1)
  358.     yy% = CSRLIN: xx% = POS(1)
  359.     PCOPY 0, 1: SCREEN 0, 0, 1, 0: LOCATE yy%, xx%, 0, 7, 0
  360.     IF imotiondir = 0 THEN imotion = imotion - 1 ELSE imotion = imotion + 1
  361.     COLOR 7, ibk
  362.  
  363.     FOR i = imaxalienforce TO 1 STEP -1
  364.         IF RTRIM$(a(i)) <> "" THEN
  365.             i2 = i2 + 2
  366.             SOUND 400, .03
  367.             ialiencol = ialiencolstat + imotion
  368.             LOCATE ileadingmax - (imaxalienforce - i) * 2, ialiencol + INSTR(a(i), "-")
  369.             IF POS(1) = lmargin% THEN imarch = 1
  370.             iltalien(i) = POS(1)
  371.             IF imotiondir = 0 THEN
  372.                 PRINT LTRIM$(RTRIM$(a(i))); " "
  373.             ELSE
  374.                 LOCATE , POS(1) - 1
  375.                 PRINT " "; LTRIM$(RTRIM$(a(i)))
  376.             END IF
  377.             IF ialiencol + LEN(RTRIM$(a(i))) = screenwidth% THEN imarch = -1
  378.         END IF
  379.     NEXT
  380.  
  381.     IF imarch = 1 THEN imotiondir = 1: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  382.     IF imarch = -1 THEN imotiondir = 0: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  383.     IF imarch = 0 THEN
  384.         IF ABS(TIMER - z2alienfire) > firerate THEN
  385.             firerate = (INT(RND * 10) + 1) / 20
  386.             IF iwait = 0 THEN CALL alienattack(ialiencolstat, ialiencol)
  387.         END IF
  388.     ELSE
  389.         imarch = 0
  390.     END IF
  391.     PCOPY 1, 0: SCREEN 0, 0, 0, 0
  392.     LOCATE irow, icol, 1, 7, 7
  393.  
  394. SUB mship (imothership)
  395.     STATIC x%, mov%, z4, mothership$
  396.  
  397.     yy% = CSRLIN: xx% = POS(1): COLOR 7, ibk
  398.     IF imothership = -1 THEN
  399.         imothership = 1
  400.         x% = lmargin%
  401.         mothership$ = CHR$(254) + CHR$(254) + "O" + CHR$(254) + CHR$(254)
  402.         mov% = 1
  403.     END IF
  404.  
  405.     IF ABS(TIMER - z4) > .05 THEN GOSUB mothership: z4 = TIMER: LOCATE yy%, xx%: EXIT SUB
  406.     ''IF ABS(TIMER - z2) > .2 THEN GOSUB bullets: z2 = TIMER
  407.     LOCATE yy%, xx%
  408.     EXIT SUB
  409.  
  410.     mothership:
  411.     IF x% + LEN(mothership$) = screenwidth% + lmargin% THEN mov% = -1 ELSE IF x% = lmargin% THEN mov% = 1
  412.     x% = x% + mov%
  413.     LOCATE topmargin%, x%
  414.     PRINT mothership$;
  415.     IF x% > 1 AND mov% = 1 THEN
  416.         LOCATE , POS(1) - LEN(mothership$) - 1: PRINT " ";
  417.     END IF
  418.     IF mov% = -1 THEN PRINT " ";
  419.     RETURN
  420.  
  421.  
  422. DEFINT A-H, J-Z
  423. SUB qbide
  424.     PALETTE 2, 59
  425.     COLOR 15, 1
  426.     CLS
  427.  
  428.     COLOR 0, 7
  429.     LOCATE 1, 1
  430.     PRINT SPACE$(80)
  431.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  432.  
  433.     COLOR 7, 1
  434.  
  435.     LOCATE 2, 1: PRINT CHR$(218)
  436.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  437.     LOCATE 2, 80: PRINT CHR$(191)
  438.  
  439.     LOCATE 2, 76: PRINT CHR$(180)
  440.     LOCATE 2, 78: PRINT CHR$(195)
  441.  
  442.     COLOR 1, 7
  443.     LOCATE 2, 77: PRINT CHR$(24)
  444.     LOCATE 2, 36: PRINT " Untitled "
  445.  
  446.     COLOR 7, 1
  447.     FOR Rows = 3 TO 24
  448.         LOCATE Rows, 1: PRINT CHR$(179);
  449.         LOCATE Rows, 80: PRINT CHR$(179);
  450.     NEXT Rows
  451.  
  452.     LOCATE 22, 1: PRINT CHR$(195)
  453.     LOCATE 22, 80: PRINT CHR$(180)
  454.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  455.     LOCATE 22, 35
  456.     PRINT " Immediate "
  457.  
  458.     COLOR 0, 7
  459.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  460.     LOCATE 21, 2: PRINT CHR$(27)
  461.     LOCATE 21, 3: PRINT CHR$(219)
  462.     LOCATE 21, 79: PRINT CHR$(26)
  463.     FOR Rows = 4 TO 19
  464.         LOCATE Rows, 80: PRINT CHR$(176)
  465.     NEXT Rows
  466.     LOCATE 3, 80: PRINT CHR$(24)
  467.     LOCATE 4, 80: PRINT CHR$(219)
  468.     LOCATE 20, 80: PRINT CHR$(25)
  469.  
  470.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  471.     LOCATE 25, 59: PRINT SPACE$(4);
  472.     COLOR 0, 3
  473.     LOCATE 25, 63: PRINT CHR$(179);
  474.     LOCATE 25, 64: PRINT SPACE$(6);
  475.     LOCATE 25, 68: PRINT "C  00001:001 ";
  476.  
  477.  
  478. DEFSNG A-H, J-Z
  479. SUB reprintaliens (ialiencol, ihitaliens, iresults, i4, i, imothership)
  480.     IF ihitaliens > 0 THEN
  481.         ihits = ihits + 1
  482.         IF (ihits + 15) MOD 20 = 0 AND imothership = 0 THEN imothership = -1
  483.         LOCATE bullet%(i), lmargin%: PRINT SPACE$(screenwidth%);
  484.         iltalien(i4) = POS(1)
  485.  
  486.         IF RTRIM$(a(i4)) = "" THEN
  487.             alienforce% = alienforce% - 1
  488.             IF alienforce% = 0 THEN iresults = iresults + 1
  489.             IF bullet%(i) = ileadingrow THEN ileadingrow = ileadingrow - 2
  490.         ELSE
  491.             LOCATE bullet%(i), ialiencol + INSTR(a(i4), "-"): PRINT LTRIM$(RTRIM$(a(i4)))
  492.         END IF
  493.     ELSE
  494.         i2 = ABS(ihitaliens)
  495.         LOCATE iy(i2), ix(i2)
  496.         PRINT " ";: iy(i2) = 0
  497.         ia(i2) = 0
  498.         LOCATE irow, icol
  499.         SOUND 1000, .5
  500.     END IF
  501.  
  502.     ihitaliens = 0
  503.     bullet%(i) = -bullet%(i)
  504.  
  505.     COLOR 0, 3
  506.     yy% = CSRLIN: xx% = POS(1)
  507.     LOCATE 25, 76 - LEN(LTRIM$(STR$(ihits)))
  508.     PRINT LTRIM$(STR$(ihits));
  509.     LOCATE 25, 80 - LEN(LTRIM$(STR$(imaxalienforce - alienforce%)))
  510.     PRINT LTRIM$(STR$(imaxalienforce - alienforce%));
  511.     LOCATE yy%, xx%
  512.     COLOR 7, ibk
  513.  

One key: Alt

Hold down to mve and shoot. Release to stop. Hold down again to reverse direction and shoot.

Pete
Title: Re: Competition
Post by: bplus on October 07, 2021, 12:52:31 am
Definitely nice one key game! Nice to see that every now and then.
Title: Re: Competition
Post by: Pete on October 07, 2021, 12:57:25 am
Thanks! I removed the mouse control option and got rid of the arrow right and left. Thanks to PEEK / POKE support, it which doesn't miss key held status, a single key can b used. It's actually more challenging this way. Not bad for a half days work, made over 12 years ago, as a spoof on why Rob hadn't got around to finishing the compiler!

Pete
Title: Re: Competition
Post by: johnno56 on October 07, 2021, 03:43:32 am
Cool game... Cleared the "first wave" (without dying!!!) but not so lucky with the second... A game that I could play without dying too much... A score / hiscore would be nice... I cannot boast about the fact that I survived without a score to convince others... This is so sad...
Title: Re: Competition
Post by: bplus on October 07, 2021, 11:37:38 am
@Pete  Yeah add a high score record keeper, maybe update the spoof for less niche audience.

This game is real contender, it seemsmuch improved with one key control over the version using arrow keys.
You should see the cost cutting they did on my keyboard for arrow keys! I am considering recommending to Qwerkey for Samples, such a Classic in a new improved light, specially now that Johnno says you can actually get through level 1.
Title: Re: Competition
Post by: Pete on October 07, 2021, 03:26:25 pm
It would need some tweaking to be an actual game. BTW - I only tested it on level 1. Got through it, and I think the next two levels add a bit more difficulty. It's been so long since I've played the real Space Invaders, on an Atari. I think there was a bonus for each time you blew up the mother ship, and probably a set number of points for each alien fighter destroyed. I believe the game also had three barriers you could hide behind, but they were progressively broken apart by alien missiles. I can't remember if they regenerated or not in subsequent levels.

Anyway, if I had to give this thing a name, I'd guess I'd call it, QB64 ASCII Invaders

Pete
Title: Re: Competition
Post by: bplus on October 07, 2021, 03:36:49 pm
Hmm... what if mother ship were an ascii witch or harvest man in the moon and the alien fighters ascii bats?

You know, to get into Halloween spirit and extra credit ;-))
Title: Re: Competition
Post by: Pete on October 07, 2021, 04:24:25 pm
Consider you guys lucky I didn't code ASCII fighters as: (_|_)

And no, that's not a pumpkin.

Pete
Title: Re: Competition
Post by: Pete on October 07, 2021, 08:10:57 pm
Okay, fine...

Halloween theme engaged. Watch out for stormy weather.

Code: QB64: [Select]
  1. DIM SHARED intro%: intro% = -1
  2. skip_intro:
  3. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  4. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits, score$
  5.  
  6. score$ = "000000"
  7. imaxalienforce = 6
  8. imaxalienmissiles = 3
  9. lmargin% = 2
  10. rmargin% = 79
  11. topmargin% = 3
  12. ialiencolstat = 6
  13. iwin = 3 ' 3 Levels.
  14. screenwidth% = rmargin% - lmargin% + 1
  15. ibk = 0 ' Background color
  16.  
  17. DIM SHARED a(imaxalienforce) AS STRING * 68
  18.  
  19. SCREEN 0, 0, 0, 0
  20. COLOR 7, 0: CLS
  21.  
  22. REM Make aliens
  23. a1$ = "^^" + CHR$(79) + "^^  "
  24. a$ = a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$
  25.  
  26. IF intro% THEN
  27.     SCREEN 0, 0, 1, 1
  28.     CALL qbideOrig
  29.  
  30.     SCREEN 0, 0, 2, 0
  31.     CALL qbide
  32.  
  33.     SCREEN 0, 0, 1, 1
  34.     _DELAY 2
  35.  
  36.     SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  37.     FOR i = 1 TO 15
  38.         _DELAY i / 150
  39.         IF i / 2 = i \ 2 THEN
  40.             SOUND 250, .1
  41.             SCREEN 0, 0, 1, 1
  42.         ELSE
  43.             SCREEN 0, 0, 2, 2
  44.             IF i < 13 THEN _DELAY i / 100: SCREEN 0, 0, 3, 3: COLOR 0, 7: CLS
  45.         END IF
  46.     NEXT
  47.     PCOPY 2, 0
  48.     SCREEN 0, 0, 0, 0
  49.     CALL qbide
  50.  
  51. IF intro% = -1 THEN RESTORE first_play ELSE RESTORE replay
  52.  
  53. CALL instructions
  54.  
  55.     IF inextrnd = -1 THEN PCOPY 3, 0
  56.     tank$ = CHR$(218) + CHR$(127) + CHR$(191): icolor = 6
  57.     REDIM SHARED bullet%(5), bulletcol%(5), bulletdelay%(5), iltalien(imaxalienforce)
  58.     REDIM SHARED ia(imaxalienmissiles), iy(imaxalienmissiles), ix(imaxalienmissiles)
  59.     REDIM SHARED matrix(imaxalienforce) AS STRING * 10
  60.     alienforce% = imaxalienforce
  61.     level = .65
  62.     iround = iround + 1
  63.     level = level - iround / 15
  64.     inextrnd = -1
  65.     COLOR 6, ibk
  66.  
  67.     REM Set up aliens
  68.     ialiencol = ialiencolstat
  69.     LOCATE 2, ialiencol
  70.     FOR i = 1 TO imaxalienforce
  71.         IF i MOD 1 = 0 THEN PRINT
  72.         LOCATE , ialiencol
  73.         IF i = imaxalienforce THEN ileadingrow = CSRLIN: ileadingmax = ileadingrow
  74.         a(i) = a$
  75.         PRINT a(i)
  76.     NEXT
  77.  
  78.     COLOR 0 + 16, 3
  79.     LOCATE 25, 68: PRINT "Score ";
  80.     COLOR 0, 3
  81.     PRINT score$;
  82.     COLOR 6, ibk
  83.  
  84.     REM Station
  85.     LOCATE 24, 40
  86.     tanky% = CSRLIN: tankx% = POS(0) + 1
  87.     PRINT tank$;: LOCATE , POS(0) - 2
  88.  
  89.     _DELAY 1
  90.  
  91.     DO
  92.         z1 = TIMER
  93.         DO
  94.             IF zbonus THEN
  95.                 IF ABS(zbonus - TIMER) > 1.5 THEN
  96.                     yy% = CSRLIN: xx% = POS(0)
  97.                     COLOR 6, 0: LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  98.                     LOCATE yy%, xx%
  99.                     zbonus = 0
  100.                 END IF
  101.             END IF
  102.  
  103.             IF topmargin% + ileadingmax - (imaxalienforce * 2) >= topmargin% + 2 THEN
  104.                 IF imothership <> 0 THEN CALL mship(imothership)
  105.             END IF
  106.             IF ABS(TIMER - z1aliens) > level THEN
  107.                 CALL movealiens(ialiencol, ialiencolstat, iresults)
  108.                 z1aliens = TIMER
  109.             END IF
  110.             IF iresults < 0 THEN EXIT DO
  111.             IF ABS(TIMER - z1ia) > .3 THEN CALL alienmissile(iresults): z1ia = TIMER
  112.  
  113.             DEF SEG = 0
  114.             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  115.                 key$ = CHR$(32) ' Alt
  116.             ELSE
  117.                 key$ = ""
  118.             END IF
  119.             DEF SEG
  120.  
  121.             SELECT CASE key$
  122.                 CASE CHR$(32)
  123.                     IF flag = 0 THEN switch = switch * -1 - 1: flag = -1
  124.                     SELECT CASE switch
  125.                         CASE 0
  126.                             IF ABS(z9 - TIMER) > .15 THEN
  127.                                 IF POS(0) < screenwidth% THEN COLOR icolor, ibk: LOCATE , POS(0) - 1: PRINT " " + tank$;: LOCATE , POS(0) - 2
  128.                                 tanky% = CSRLIN: tankx% = POS(0)
  129.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  130.                                 z9 = TIMER
  131.                             END IF
  132.                         CASE -1
  133.                             IF ABS(z9 - TIMER) > .15 THEN
  134.                                 IF POS(0) > lmargin% + 1 THEN COLOR icolor, ibk: LOCATE , POS(0) - 2: PRINT tank$ + " ";: LOCATE , POS(0) - 3
  135.                                 tanky% = CSRLIN: tankx% = POS(0)
  136.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  137.                                 z9 = TIMER
  138.                             END IF
  139.                     END SELECT
  140.                     IF icolor = 6 THEN
  141.                         FOR i2 = 1 TO 5
  142.                             IF bullet%(i2) = 0 THEN
  143.                                 icolor = 12: COLOR icolor, ibk: GOSUB redraw
  144.                                 bullet%(i2) = -1: reload = TIMER: EXIT FOR
  145.                             END IF
  146.                         NEXT
  147.                     END IF
  148.                 CASE ""
  149.                     IF flag THEN skip = 0: flag = 0
  150.                 CASE CHR$(27): SYSTEM
  151.             END SELECT
  152.  
  153.             IF ABS(z1 - reload) > .6 AND reload <> 0 THEN
  154.                 GOSUB redraw
  155.                 icolor = 6: reload = 0
  156.             END IF
  157.  
  158.             REM Fire
  159.             FOR i = 1 TO 5
  160.                 SELECT CASE bullet%(i)
  161.                     CASE -1: bullet%(i) = tanky% - 1: bulletcol%(i) = tankx%
  162.                     CASE IS > 0
  163.                         IF bulletdelay%(i) = -1 OR bullet%(i) = tanky% - 1 THEN
  164.                             CALL checkcollision(ihitaliens, ialiencol, i4, i)
  165.                             z2bullet = TIMER: bulletdelay%(i) = 0
  166.                             COLOR 6, ibk
  167.                             LOCATE bullet%(i), bulletcol%(i)
  168.                             IF bullet%(i) = topmargin% AND imothership <> 0 THEN ' Hit mother ship.
  169.                                 IF SCREEN(ABS(bullet%(i)), bulletcol%(i)) <> 32 THEN
  170.                                     SOUND 1000, .75
  171.                                     SELECT CASE iresults + 1
  172.                                         CASE 1: bonus = 1500
  173.                                         CASE 2: bonus = 2500
  174.                                         CASE 3: bonus = 5000
  175.                                     END SELECT
  176.                                     score$ = LTRIM$(STR$(VAL(score$) + bonus))
  177.                                     score$ = STRING$(6 - LEN(score$), "0") + score$
  178.                                     yy% = CSRLIN: xx% = POS(0)
  179.                                     SOUND 800, .5: SOUND 1600, .5: SOUND 2400, .5
  180.                                     LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  181.                                     kbonus = bulletcol%(i) - 4
  182.                                     IF kbonus < lmargin% THEN kbonus = lmargin%
  183.                                     IF kbonus + 10 > screenwidth% THEN kbonus = screenwidth% - 11
  184.                                     zbonus = TIMER
  185.                                     LOCATE yy%, xx%
  186.                                     imothership = 0
  187.                                 END IF
  188.                             END IF
  189.                             PRINT CHR$(24) ' Tank missile.
  190.                             IF CSRLIN <> 24 THEN LOCATE , bulletcol%(i): PRINT " ";
  191.                             IF ihitaliens <> 0 THEN CALL reprintaliens(ialiencol, ihitaliens, iresults, i4, i, imothership)
  192.                             LOCATE tanky%, tankx%
  193.                             IF bullet%(i) > topmargin% THEN
  194.                                 bullet%(i) = bullet%(i) - 1
  195.                             ELSE
  196.                                 GOSUB erasebullet
  197.                             END IF
  198.  
  199.                             IF zbonus THEN
  200.                                 yy% = CSRLIN: xx% = POS(0)
  201.                                 LOCATE topmargin%, kbonus: COLOR 2 + 16: PRINT "BONUS " + LTRIM$(STR$(bonus));
  202.                                 LOCATE yy%, xx%
  203.                             END IF
  204.  
  205.                         END IF
  206.                 END SELECT
  207.             NEXT
  208.  
  209.             REM Bullet timer delay
  210.             IF z2bullet <> 0 THEN
  211.                 IF z1 < z2bullet THEN z2bullet = z2bullet - 86400
  212.                 IF z1 - z2bullet >= .06 THEN
  213.                     FOR i2 = 1 TO 5
  214.                         IF bullet%(i2) <> 0 THEN bulletdelay%(i2) = -1
  215.                     NEXT i2
  216.                 END IF
  217.                 EXIT DO
  218.             END IF
  219.         LOOP
  220.         IF iresults < 0 THEN EXIT DO
  221.         IF alienforce% = 0 OR iresults = iwin THEN
  222.             FOR i = 1 TO imaxalienmissiles
  223.                 IF ia(i) <> 0 THEN EXIT FOR
  224.             NEXT
  225.             IF i > imaxalienmissiles THEN iwait = -1
  226.             IF iwait = -1 THEN
  227.                 EXIT DO
  228.             END IF
  229.         ELSE
  230.             iwait = 1
  231.         END IF
  232.     LOOP
  233.  
  234.     IF iresults = iwin OR iresults < 0 THEN
  235.         REM end game
  236.         EXIT DO
  237.     END IF
  238.     inextrnd = -1
  239.  
  240. SELECT CASE iresults
  241.     CASE -1 ' Tank destroyed!
  242.         SOUND 800, .3: SOUND 250, 1
  243.  
  244.         FOR i = 1 TO 5
  245.             COLOR 14, 4
  246.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  247.             _DELAY .1
  248.  
  249.             COLOR 8, ibk
  250.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  251.             _DELAY .1
  252.         NEXT
  253.  
  254.         COLOR 6, ibk
  255.         LOCATE tanky% - 1, lmargin%
  256.         PRINT SPACE$(screenwidth%);
  257.         LOCATE tanky%, lmargin%
  258.         PRINT SPACE$(screenwidth%);
  259.  
  260.         _DELAY 2
  261.  
  262.         CALL qbide
  263.  
  264.     CASE -2 ' Aliens have landed!
  265.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  266.  
  267.         COLOR 7, 0
  268.         FOR i = 0 TO 21 ' Blank out screen.
  269.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  270.         NEXT
  271.  
  272.         COLOR 6, ibk
  273.         LOCATE tanky% - 1, lmargin%
  274.         PRINT SPACE$(screenwidth%);
  275.         LOCATE tanky%, lmargin%
  276.         PRINT SPACE$(screenwidth%);
  277.  
  278.         COLOR 8, ibk
  279.  
  280.         FOR j = imaxalienforce TO 1 STEP -1
  281.             IF a(j) <> "" THEN EXIT FOR
  282.         NEXT
  283.  
  284.         FOR i = j TO 1 STEP -1
  285.             LOCATE , ialiencol + INSTR(a(i), "^^")
  286.             PRINT LTRIM$(RTRIM$(a(i)));
  287.             LOCATE CSRLIN - 1
  288.         NEXT
  289.  
  290.         _DELAY 2.5
  291.  
  292.     CASE ELSE ' Winner.
  293.  
  294.         l$ = "12"
  295.         n$ = "n29": PLAY "L" + l$ + n$: _DELAY .5
  296.         n$ = "n24": PLAY "L" + l$ + n$: _DELAY .5
  297.         n$ = "n33": PLAY "L" + l$ + n$: _DELAY .5
  298.         n$ = "n29": PLAY "L" + l$ + n$
  299.  
  300.         CALL qbide
  301.  
  302.         RESTORE winner
  303.  
  304.  
  305.  
  306. COLOR 0, 3
  307. LOCATE 25, 68: PRINT "Score "; score$;
  308.  
  309. CALL instructions
  310.  
  311. COLOR 6, 0
  312. LOCATE 5, 3: PRINT "Score "; score$
  313.  
  314. DEF SEG = 0
  315.     _LIMIT 30
  316.     b$ = INKEY$
  317.     IF b$ = CHR$(27) THEN SYSTEM
  318.     IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN EXIT DO
  319.  
  320. RUN skip_intro
  321.  
  322. erasebullet:
  323. LOCATE ABS(bullet%(i)), bulletcol%(i): PRINT " ";
  324. bullet%(i) = 0: bulletcol%(i) = 0: bulletdelay%(i) = 0
  325. LOCATE tanky%, tankx%
  326.  
  327. redraw:
  328. COLOR , ibk: LOCATE tanky%, tankx% - 1: PRINT tank$;: LOCATE tanky%, tankx%: COLOR 7, ibk
  329.  
  330. first_play:
  331. DATA "The Great Pumpkin is coming and has fired an EM pulse."
  332. DATA ""
  333. DATA "All that's left working is your Alt key."
  334. DATA ""
  335. DATA "Happy Halloween!"
  336. DATA ""
  337. replay:
  338. DATA "Loading..."
  339. DATA "EOF"
  340. DATA "Game Over. Thanks for playing..."
  341. DATA "EOF2"
  342. winner:
  343. DATA "Congratulations, you saved the planet!"
  344. DATA "EOF3"
  345.  
  346.  
  347. SUB alienattack (ialiencol)
  348.     z2alienfire = TIMER
  349.  
  350.     i3 = INT(RND * 10)
  351.     FOR i = 1 TO imaxalienmissiles
  352.         IF ia(i) = 0 THEN
  353.             FOR i2 = imaxalienforce TO 1 STEP -1
  354.                 IF RTRIM$(a(i2)) <> "" THEN
  355.                     IF MID$(matrix(i2), i3 + 1, 1) <> "0" THEN
  356.                         i4 = INSTR(i3 * 7 + 1, a(i2), CHR$(79)) + ialiencol
  357.                         EXIT FOR
  358.                     END IF
  359.                 END IF
  360.             NEXT i2
  361.             IF i4 <> 0 THEN
  362.                 ia(i) = (ileadingmax - (imaxalienforce - i2) * 2) * 80 + i4
  363.                 EXIT FOR
  364.             END IF
  365.         END IF
  366.     NEXT i
  367.  
  368.  
  369. SUB alienmissile (iresults)
  370.     irow = CSRLIN: icol = POS(0)
  371.     FOR i = 1 TO imaxalienmissiles
  372.         IF ia(i) <> 0 THEN
  373.             IF iy(i) = 0 THEN
  374.                 iy(i) = ia(i) \ 80: ix(i) = ia(i) MOD 80
  375.                 IF ix(i) = 0 THEN ix(i) = screenwidth%
  376.             END IF
  377.             LOCATE iy(i) + 1, ix(i)
  378.             COLOR 6, ibk
  379.             IF CSRLIN <= 24 THEN
  380.                 IF CSRLIN = 24 THEN IF SCREEN(CSRLIN, ix(i)) <> 32 THEN iresults = -1
  381.                 PRINT CHR$(25);
  382.             ELSE
  383.                 ia(i) = 0
  384.                 LOCATE iy(i), ix(i)
  385.                 PRINT " ";: iy(i) = 0
  386.                 ia(i) = 0
  387.                 LOCATE irow, icol
  388.                 EXIT SUB
  389.             END IF
  390.             LOCATE iy(i), ix(i): PRINT " ";
  391.             iy(i) = iy(i) + 1
  392.         END IF
  393.     NEXT
  394.     LOCATE irow, icol
  395.  
  396.  
  397. SUB checkcollision (ihitaliens, ialiencol, i4, i)
  398.     ihitaliens = 0
  399.     IF ileadingmax MOD 2 = bullet%(i) MOD 2 THEN
  400.         i4 = imaxalienforce - (ileadingmax - bullet%(i)) \ 2
  401.         IF bullet%(i) <= ileadingrow AND i4 > 0 AND i4 <= imaxalienforce THEN
  402.             IF RTRIM$(a(i4)) <> "" THEN
  403.                 IF bulletcol%(i) >= iltalien(i4) AND bulletcol%(i) - ialiencol <= LEN(RTRIM$(a(i4))) THEN
  404.                     IF MID$(a(i4), bulletcol%(i) - ialiencol, 1) > CHR$(32) THEN
  405.                         ihitaliens = bulletcol%(i) - ialiencol + 1
  406.                         i3 = ihitaliens - 7 + 1: IF i3 < 1 THEN i3 = 1: REM count from the "<" symbol.
  407.                         i2 = INSTR(i3 + 1, a(i4), "^" + CHR$(79)) - 1
  408.                         MID$(a(i4), i2, 7) = SPACE$(7)
  409.                         MID$(matrix(i4), (i2 + 1) \ 7 + 1, 1) = "0"
  410.                     END IF
  411.                 END IF
  412.             END IF
  413.         END IF
  414.     END IF
  415.  
  416.     FOR i2 = 1 TO imaxalienmissiles
  417.         IF ia(i2) <> 0 THEN
  418.             IF iy(i2) >= bullet%(i) AND ix(i2) = bulletcol%(i) THEN
  419.                 ihitaliens = -i2
  420.                 EXIT FOR
  421.             END IF
  422.         END IF
  423.     NEXT
  424.  
  425.  
  426. SUB instructions
  427.     IF in$ = "" THEN
  428.         key$ = INKEY$
  429.         LOCATE 3, 3, 1, 7, 0: COLOR 6, ibk
  430.         _DELAY 2
  431.         DO
  432.             READ in$
  433.             IF MID$(in$, 1, 3) = "EOF" THEN EXIT DO
  434.             FOR i = 1 TO LEN(in$)
  435.                 SOUND 400, .07
  436.                 LOCATE , 2 + i
  437.                 PRINT MID$(in$, i, 1);
  438.                 z = TIMER
  439.                 DO
  440.                     IF ABS(z - TIMER) > .08 THEN EXIT DO
  441.                 LOOP
  442.             NEXT
  443.             LOCATE , , 0, 7, 0
  444.             _DELAY 1
  445.             PRINT
  446.             LOCATE , 3
  447.         LOOP
  448.         _DELAY 1
  449.     END IF
  450.  
  451.     IF in$ = "EOF" THEN
  452.         COLOR 7, 0
  453.         FOR i = 0 TO 19 ' Blank out intro message space.
  454.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  455.         NEXT
  456.         FOR i = 3 TO 24
  457.             LOCATE i, 80: PRINT CHR$(179);
  458.         NEXT
  459.         LOCATE 21, 2: PRINT STRING$(screenwidth%, " ");
  460.         LOCATE 22, 1: PRINT CHR$(179);
  461.         LOCATE 22, 80: PRINT CHR$(179);
  462.         LOCATE 22, 2: PRINT STRING$(screenwidth%, " ");
  463.     ELSE
  464.         COLOR 0, 3
  465.     END IF
  466.  
  467.     IF in$ <> "EOF2" AND iresults <> iwin THEN COLOR 0 + 16, 3 ELSE COLOR 0, 3
  468.     yy% = CSRLIN: xx% = POS(0)
  469.     LOCATE 25, 68: PRINT "Score ";
  470.     COLOR 0, 3
  471.     PRINT score$;
  472.     LOCATE yy%, xx%
  473.  
  474.     PCOPY 0, 3: REM save skin
  475.  
  476.  
  477. SUB marchdown (ialiencol, ialiencolstat, imotion, iresults)
  478.     COLOR 6, ibk
  479.     ileadingrow = ileadingrow + 1
  480.     ileadingmax = ileadingmax + 1
  481.     COLOR 6, ibk
  482.     FOR i = 1 TO imaxalienforce
  483.         REM SOUND 400, .2 ' Level down.
  484.         IF RTRIM$(a(i)) <> "" THEN
  485.             ialiencol = ialiencolstat + imotion
  486.             LOCATE ileadingmax - (imaxalienforce * 2) + i * 2 - 1, lmargin%
  487.             PRINT STRING$(screenwidth%, " ")
  488.             LOCATE , ialiencol + INSTR(a(i), "^^")
  489.             iltalien(i) = POS(0)
  490.             PRINT LTRIM$(RTRIM$(a(i)))
  491.         END IF
  492.     NEXT
  493.     LOCATE irow, icol
  494.     level = level - .025
  495.     IF ileadingrow = 22 THEN iresults = -2 ' Aliens have landed!
  496.  
  497. SUB movealiens (ialiencol, ialiencolstat, iresults)
  498.     STATIC imotion, imarch, imotiondir
  499.  
  500.     SOUND 800, .1: SOUND 200, .33 ' Marching sound.
  501.  
  502.     IF inextrnd = -1 THEN inextrnd = 0: imotion = 0: imarch = 0: imotiondir = 0
  503.     irow = CSRLIN: icol = POS(0)
  504.     yy% = CSRLIN: xx% = POS(0)
  505.     PCOPY 0, 1: SCREEN 0, 0, 1, 0: LOCATE yy%, xx%, 0, 7, 0
  506.     IF imotiondir = 0 THEN imotion = imotion - 1 ELSE imotion = imotion + 1
  507.     COLOR 6, ibk
  508.  
  509.     FOR i = imaxalienforce TO 1 STEP -1
  510.         IF RTRIM$(a(i)) <> "" THEN
  511.             i2 = i2 + 2
  512.             ialiencol = ialiencolstat + imotion
  513.             LOCATE ileadingmax - (imaxalienforce - i) * 2, ialiencol + INSTR(a(i), "^^")
  514.             IF POS(0) = lmargin% THEN imarch = 1
  515.             iltalien(i) = POS(0)
  516.             IF imotiondir = 0 THEN
  517.                 PRINT LTRIM$(RTRIM$(a(i))); " "
  518.             ELSE
  519.                 LOCATE , POS(0) - 1
  520.                 PRINT " "; LTRIM$(RTRIM$(a(i)))
  521.             END IF
  522.             IF ialiencol + LEN(RTRIM$(a(i))) = screenwidth% THEN imarch = -1
  523.         END IF
  524.     NEXT
  525.  
  526.     IF imarch = 1 THEN imotiondir = 1: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  527.     IF imarch = -1 THEN imotiondir = 0: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  528.     IF imarch = 0 THEN
  529.         IF ABS(TIMER - z2alienfire) > firerate THEN
  530.             firerate = (INT(RND * 10) + 1) / 20
  531.             IF iwait = 0 THEN CALL alienattack(ialiencol)
  532.         END IF
  533.     ELSE
  534.         imarch = 0
  535.     END IF
  536.     PCOPY 1, 0: SCREEN 0, 0, 0, 0
  537.     LOCATE irow, icol, 1, 7, 0
  538.  
  539. SUB mship (imothership)
  540.     STATIC x%, mov%, z4, mothership$
  541.  
  542.     yy% = CSRLIN: xx% = POS(0): COLOR 6, ibk
  543.     IF imothership = -1 THEN
  544.         imothership = 1
  545.         x% = lmargin%
  546.         mothership$ = CHR$(254) + CHR$(254) + "O" + CHR$(254) + CHR$(254)
  547.         mov% = 1
  548.     END IF
  549.  
  550.     IF ABS(TIMER - z4) > .05 THEN GOSUB mothership: z4 = TIMER: LOCATE yy%, xx%: EXIT SUB
  551.     LOCATE yy%, xx%
  552.     EXIT SUB
  553.  
  554.     mothership:
  555.     IF x% + LEN(mothership$) = screenwidth% + lmargin% THEN mov% = -1 ELSE IF x% = lmargin% THEN mov% = 1
  556.     x% = x% + mov%
  557.     LOCATE topmargin%, x%
  558.     PRINT mothership$;
  559.     IF x% > 1 AND mov% = 1 THEN
  560.         LOCATE , POS(0) - LEN(mothership$) - 1: PRINT " ";
  561.     END IF
  562.     IF mov% = -1 THEN PRINT " ";
  563.     RETURN
  564.  
  565.  
  566. DEFINT A-H, J-Z
  567. SUB qbide
  568.     PALETTE 2, 59
  569.     COLOR 15, 0
  570.     CLS
  571.  
  572.     COLOR 0, 7
  573.     LOCATE 1, 1
  574.     PRINT SPACE$(80)
  575.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  576.  
  577.     COLOR 7, 0 ' Black background.
  578.  
  579.     LOCATE 2, 1: PRINT CHR$(218)
  580.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  581.     LOCATE 2, 80: PRINT CHR$(191)
  582.  
  583.     LOCATE 2, 76: PRINT CHR$(180)
  584.     LOCATE 2, 78: PRINT CHR$(195)
  585.  
  586.     COLOR 0, 7
  587.     LOCATE 2, 77: PRINT CHR$(24)
  588.     LOCATE 2, 36: PRINT " Untitled "
  589.  
  590.     COLOR 7, 0
  591.     FOR Rows = 3 TO 24
  592.         LOCATE Rows, 1: PRINT CHR$(179);
  593.         LOCATE Rows, 80: PRINT CHR$(179);
  594.     NEXT Rows
  595.  
  596.     LOCATE 22, 1: PRINT CHR$(195)
  597.     LOCATE 22, 80: PRINT CHR$(180)
  598.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  599.     LOCATE 22, 35
  600.     PRINT " Immediate "
  601.  
  602.     COLOR 0, 7
  603.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  604.     LOCATE 21, 2: PRINT CHR$(27)
  605.     LOCATE 21, 3: PRINT CHR$(219)
  606.     LOCATE 21, 79: PRINT CHR$(26)
  607.     FOR Rows = 4 TO 19
  608.         LOCATE Rows, 80: PRINT CHR$(176)
  609.     NEXT Rows
  610.     LOCATE 3, 80: PRINT CHR$(24)
  611.     LOCATE 4, 80: PRINT CHR$(219)
  612.     LOCATE 20, 80: PRINT CHR$(25)
  613.  
  614.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  615.     LOCATE 25, 59: PRINT SPACE$(4);
  616.     COLOR 0, 3
  617.     LOCATE 25, 63: PRINT CHR$(179);
  618.     LOCATE 25, 64: PRINT SPACE$(6);
  619.     LOCATE 25, 68: PRINT "C  00001:001 ";
  620.  
  621.  
  622. DEFSNG A-H, J-Z
  623. SUB reprintaliens (ialiencol, ihitaliens, iresults, i4, i, imothership)
  624.     IF ihitaliens > 0 THEN
  625.         ihits = ihits + 1
  626.  
  627.         SELECT CASE iresults + 1
  628.             CASE 1: score$ = LTRIM$(STR$(VAL(score$) + 150))
  629.             CASE 2: score$ = LTRIM$(STR$(VAL(score$) + 250))
  630.             CASE 3: score$ = LTRIM$(STR$(VAL(score$) + 350))
  631.         END SELECT
  632.  
  633.         score$ = STRING$(6 - LEN(score$), "0") + score$
  634.         IF (ihits + 15) MOD 20 = 0 AND imothership = 0 THEN imothership = -1
  635.         LOCATE bullet%(i), lmargin%: PRINT SPACE$(screenwidth%);
  636.         iltalien(i4) = POS(0)
  637.  
  638.         IF RTRIM$(a(i4)) = "" THEN
  639.             alienforce% = alienforce% - 1
  640.             IF alienforce% = 0 THEN iresults = iresults + 1 ' Level completed. Goto to next level.
  641.             IF bullet%(i) = ileadingrow THEN ileadingrow = ileadingrow - 2
  642.         ELSE
  643.             LOCATE bullet%(i), ialiencol + INSTR(a(i4), "^^"): PRINT LTRIM$(RTRIM$(a(i4)))
  644.         END IF
  645.     ELSE
  646.         i2 = ABS(ihitaliens)
  647.         LOCATE iy(i2), ix(i2)
  648.         PRINT " ";: iy(i2) = 0
  649.         ia(i2) = 0
  650.         LOCATE irow, icol
  651.         SOUND 1000, .5
  652.     END IF
  653.  
  654.     ihitaliens = 0
  655.     bullet%(i) = -bullet%(i)
  656.  
  657.     COLOR 0, 3
  658.     yy% = CSRLIN: xx% = POS(0)
  659.     LOCATE 25, 74: PRINT score$;
  660.     LOCATE yy%, xx%
  661.     COLOR 6, ibk
  662.  
  663.  
  664. SUB qbideOrig
  665.     PALETTE 2, 59
  666.     COLOR 15, 1
  667.     CLS
  668.  
  669.     COLOR 0, 7
  670.     LOCATE 1, 1
  671.     PRINT SPACE$(80)
  672.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  673.  
  674.     COLOR 7, 1
  675.  
  676.     LOCATE 2, 1: PRINT CHR$(218)
  677.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  678.     LOCATE 2, 80: PRINT CHR$(191)
  679.  
  680.     LOCATE 2, 76: PRINT CHR$(180)
  681.     LOCATE 2, 78: PRINT CHR$(195)
  682.  
  683.     COLOR 1, 7
  684.     LOCATE 2, 77: PRINT CHR$(24)
  685.     LOCATE 2, 36: PRINT " Untitled "
  686.  
  687.     COLOR 7, 1
  688.     FOR Rows = 3 TO 24
  689.         LOCATE Rows, 1: PRINT CHR$(179);
  690.         LOCATE Rows, 80: PRINT CHR$(179);
  691.     NEXT Rows
  692.  
  693.     LOCATE 22, 1: PRINT CHR$(195)
  694.     LOCATE 22, 80: PRINT CHR$(180)
  695.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  696.     LOCATE 22, 35
  697.     PRINT " Immediate "
  698.  
  699.     COLOR 0, 7
  700.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  701.     LOCATE 21, 2: PRINT CHR$(27)
  702.     LOCATE 21, 3: PRINT CHR$(219)
  703.     LOCATE 21, 79: PRINT CHR$(26)
  704.     FOR Rows = 4 TO 19
  705.         LOCATE Rows, 80: PRINT CHR$(176)
  706.     NEXT Rows
  707.     LOCATE 3, 80: PRINT CHR$(24)
  708.     LOCATE 4, 80: PRINT CHR$(219)
  709.     LOCATE 20, 80: PRINT CHR$(25)
  710.  
  711.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  712.     LOCATE 25, 59: PRINT SPACE$(4);
  713.     COLOR 0, 3
  714.     LOCATE 25, 63: PRINT CHR$(179);
  715.     LOCATE 25, 64: PRINT SPACE$(6);
  716.     LOCATE 25, 68: PRINT "C  00001:001 ";
  717.  

Edited: Added scoring with 50 per hit and 500 bonus for mother ship.

Edited: Some sound and visual effects added. You can replay without the intro. Just press the Alt key at Game Over message.  To end, you have to click the "x" in the program window.
Title: Re: Competition
Post by: bplus on October 07, 2021, 10:23:19 pm
Hey I got through level 1 and almost all level 2 with the bats.

Do miss a "Pete" comment at start :-))

Could be colorized a little? Even some Black and White would make the screen pop.
Title: Re: Competition
Post by: Pete on October 08, 2021, 04:05:46 pm
@bplus Ah color? Orange and black are Halloween colors, so I'm not sure what color scheme you are thinking of.

I added a couple of other effects, see edit info.

I wish I was better with SOUND. I would love to have a thunder sound at the beginning, but without including an .ogg file. I added a short note playing routine if the player completes level 3 for the win.

The counter looks like I should truncate it a bit, or maybe try a progressive scoring algorithm. Something simple like 5o- pts per hit on level 1, 200 pts per hit on level 2, and 500 pts per hit on level 3. Same with mother ship. 1000, 2000, and 5000 pt bonus based on level. Any thoughts on scoring?

Pete
Title: Re: Competition
Post by: bplus on October 08, 2021, 08:09:21 pm
Yeah nice changes @Pete. Haven't played game enough for help with scoring, numbers you have look OK.
Title: Re: Competition
Post by: Pete on October 08, 2021, 08:58:33 pm
I found one big, and fixed it. Also added a progressive scoring system.

Pete
Title: Re: Competition
Post by: johnno56 on October 08, 2021, 09:12:19 pm
Cool game... Nicely done... Yep. The Alt key does need a little practice... I actually got through the first wave!! For me that's 'Woo Hoo'... lol
Title: Re: Competition
Post by: Pete on October 08, 2021, 09:39:43 pm
@johnno56 Careful about saying Woo Hoo around here! (Someone could abuse his post privileges).

TheBOB added his thunder sound effects. I did a quick update at QBF and added them: https://www.tapatalk.com/groups/qbasic/viewtopic.php?p=213778#p213778

It made the intro sooooo much better. I left the initial afffect for anyone who does not include the .0gg files.

Pete

Title: Re: Competition
Post by: Pete on October 08, 2021, 11:08:03 pm
Some more cool-aberation with TheBOB. Remember I mentioned "The Great Pumpkin?"

Code: QB64: [Select]
  1. DIM SHARED intro%: intro% = -1
  2. skip_intro:
  3. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  4. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits, score$
  5.  
  6. score$ = "000000"
  7. imaxalienforce = 6
  8. imaxalienmissiles = 3
  9. lmargin% = 2
  10. rmargin% = 79
  11. topmargin% = 3
  12. ialiencolstat = 6
  13. iwin = 3 ' 3 Levels.
  14. screenwidth% = rmargin% - lmargin% + 1
  15. ibk = 0 ' Background color
  16.  
  17. DIM SHARED a(imaxalienforce) AS STRING * 68
  18.  
  19. SCREEN 0, 0, 0, 0
  20. COLOR 7, 0: CLS
  21.  
  22. REM Make aliens
  23. a1$ = "^^" + CHR$(79) + "^^  "
  24. a$ = a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$
  25.  
  26. IF intro% THEN
  27.     SCREEN 0, 0, 1, 1
  28.     CALL qbideOrig
  29.  
  30.     SCREEN 0, 0, 2, 0
  31.     CALL qbide
  32.  
  33.     SCREEN 0, 0, 1, 1
  34.     _DELAY 2
  35.  
  36.     IF _FILEEXISTS("Thunder6.ogg") THEN
  37.         Rain& = _SNDOPEN("RainBk.ogg", "SYNC")
  38.         T1& = _SNDOPEN("Thunder1.ogg", "SYNC")
  39.         T2& = _SNDOPEN("Thunder2.ogg", "SYNC")
  40.         T3& = _SNDOPEN("Thunder3.ogg", "SYNC")
  41.         T4& = _SNDOPEN("Thunder4.ogg", "SYNC")
  42.         T5& = _SNDOPEN("Thunder5.ogg", "SYNC")
  43.         T6& = _SNDOPEN("Thunder6.ogg", "SYNC")
  44.         T7& = _SNDOPEN("Thunder7.ogg", "SYNC")
  45.         T8& = _SNDOPEN("Thunder8.ogg", "SYNC")
  46.  
  47.         _SNDPLAY T6&
  48.         _DELAY .1
  49.         _SNDPLAY T7&
  50.         _DELAY .1
  51.         _SNDPLAY T8&
  52.     ELSE
  53.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  54.     END IF
  55.  
  56.     FOR i = 1 TO 15
  57.         _DELAY i / 150
  58.         IF i / 2 = i \ 2 THEN
  59.             SOUND 250, .1
  60.             SCREEN 0, 0, 1, 1
  61.         ELSE
  62.             SCREEN 0, 0, 2, 2
  63.             IF i < 13 THEN _DELAY i / 100: SCREEN 0, 0, 3, 3: COLOR 0, 7: CLS
  64.         END IF
  65.     NEXT
  66.  
  67.     PCOPY 2, 0
  68.     SCREEN 0, 0, 0, 0
  69.     _DELAY 1
  70.  
  71.     CALL TheBOB
  72.  
  73.     CALL qbide
  74.  
  75.     CALL qbide
  76.  
  77. IF intro% = -1 THEN RESTORE first_play ELSE RESTORE replay
  78.  
  79. CALL instructions
  80.  
  81.     IF inextrnd = -1 THEN PCOPY 3, 0
  82.     tank$ = CHR$(218) + CHR$(127) + CHR$(191): icolor = 6
  83.     REDIM SHARED bullet%(5), bulletcol%(5), bulletdelay%(5), iltalien(imaxalienforce)
  84.     REDIM SHARED ia(imaxalienmissiles), iy(imaxalienmissiles), ix(imaxalienmissiles)
  85.     REDIM SHARED matrix(imaxalienforce) AS STRING * 10
  86.     alienforce% = imaxalienforce
  87.     level = .65
  88.     iround = iround + 1
  89.     level = level - iround / 15
  90.     inextrnd = -1
  91.     COLOR 6, ibk
  92.  
  93.     REM Set up aliens
  94.     ialiencol = ialiencolstat
  95.     LOCATE 2, ialiencol
  96.     FOR i = 1 TO imaxalienforce
  97.         IF i MOD 1 = 0 THEN PRINT
  98.         LOCATE , ialiencol
  99.         IF i = imaxalienforce THEN ileadingrow = CSRLIN: ileadingmax = ileadingrow
  100.         a(i) = a$
  101.         PRINT a(i)
  102.     NEXT
  103.  
  104.     COLOR 0 + 16, 3
  105.     LOCATE 25, 68: PRINT "Score ";
  106.     COLOR 0, 3
  107.     PRINT score$;
  108.     COLOR 6, ibk
  109.  
  110.     REM Station
  111.     LOCATE 24, 40
  112.     tanky% = CSRLIN: tankx% = POS(0) + 1
  113.     PRINT tank$;: LOCATE , POS(0) - 2
  114.  
  115.     _DELAY 1
  116.  
  117.     DO
  118.         z1 = TIMER
  119.         DO
  120.             IF zbonus THEN
  121.                 IF ABS(zbonus - TIMER) > 1.5 THEN
  122.                     yy% = CSRLIN: xx% = POS(0)
  123.                     COLOR 6, 0: LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  124.                     LOCATE yy%, xx%
  125.                     zbonus = 0
  126.                 END IF
  127.             END IF
  128.  
  129.             IF topmargin% + ileadingmax - (imaxalienforce * 2) >= topmargin% + 2 THEN
  130.                 IF imothership <> 0 THEN CALL mship(imothership)
  131.             END IF
  132.             IF ABS(TIMER - z1aliens) > level THEN
  133.                 CALL movealiens(ialiencol, ialiencolstat, iresults)
  134.                 z1aliens = TIMER
  135.             END IF
  136.             IF iresults < 0 THEN EXIT DO
  137.             IF ABS(TIMER - z1ia) > .3 THEN CALL alienmissile(iresults): z1ia = TIMER
  138.  
  139.             DEF SEG = 0
  140.             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  141.                 key$ = CHR$(32) ' Alt
  142.             ELSE
  143.                 key$ = ""
  144.             END IF
  145.             DEF SEG
  146.  
  147.             SELECT CASE key$
  148.                 CASE CHR$(32)
  149.                     IF flag = 0 THEN switch = switch * -1 - 1: flag = -1
  150.                     SELECT CASE switch
  151.                         CASE 0
  152.                             IF ABS(z9 - TIMER) > .15 THEN
  153.                                 IF POS(0) < screenwidth% THEN COLOR icolor, ibk: LOCATE , POS(0) - 1: PRINT " " + tank$;: LOCATE , POS(0) - 2
  154.                                 tanky% = CSRLIN: tankx% = POS(0)
  155.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  156.                                 z9 = TIMER
  157.                             END IF
  158.                         CASE -1
  159.                             IF ABS(z9 - TIMER) > .15 THEN
  160.                                 IF POS(0) > lmargin% + 1 THEN COLOR icolor, ibk: LOCATE , POS(0) - 2: PRINT tank$ + " ";: LOCATE , POS(0) - 3
  161.                                 tanky% = CSRLIN: tankx% = POS(0)
  162.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  163.                                 z9 = TIMER
  164.                             END IF
  165.                     END SELECT
  166.                     IF icolor = 6 THEN
  167.                         FOR i2 = 1 TO 5
  168.                             IF bullet%(i2) = 0 THEN
  169.                                 icolor = 12: COLOR icolor, ibk: GOSUB redraw
  170.                                 bullet%(i2) = -1: reload = TIMER: EXIT FOR
  171.                             END IF
  172.                         NEXT
  173.                     END IF
  174.                 CASE ""
  175.                     IF flag THEN skip = 0: flag = 0
  176.                 CASE CHR$(27): SYSTEM
  177.             END SELECT
  178.  
  179.             IF ABS(z1 - reload) > .6 AND reload <> 0 THEN
  180.                 GOSUB redraw
  181.                 icolor = 6: reload = 0
  182.             END IF
  183.  
  184.             REM Fire
  185.             FOR i = 1 TO 5
  186.                 SELECT CASE bullet%(i)
  187.                     CASE -1: bullet%(i) = tanky% - 1: bulletcol%(i) = tankx%
  188.                     CASE IS > 0
  189.                         IF bulletdelay%(i) = -1 OR bullet%(i) = tanky% - 1 THEN
  190.                             CALL checkcollision(ihitaliens, ialiencol, i4, i)
  191.                             z2bullet = TIMER: bulletdelay%(i) = 0
  192.                             COLOR 6, ibk
  193.                             LOCATE bullet%(i), bulletcol%(i)
  194.                             IF bullet%(i) = topmargin% AND imothership <> 0 THEN ' Hit mother ship.
  195.                                 IF SCREEN(ABS(bullet%(i)), bulletcol%(i)) <> 32 THEN
  196.                                     SOUND 1000, .75
  197.                                     SELECT CASE iresults + 1
  198.                                         CASE 1: bonus = 1500
  199.                                         CASE 2: bonus = 2500
  200.                                         CASE 3: bonus = 5000
  201.                                     END SELECT
  202.                                     score$ = LTRIM$(STR$(VAL(score$) + bonus))
  203.                                     score$ = STRING$(6 - LEN(score$), "0") + score$
  204.                                     yy% = CSRLIN: xx% = POS(0)
  205.                                     SOUND 800, .5: SOUND 1600, .5: SOUND 2400, .5
  206.                                     LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  207.                                     kbonus = bulletcol%(i) - 4
  208.                                     IF kbonus < lmargin% THEN kbonus = lmargin%
  209.                                     IF kbonus + 10 > screenwidth% THEN kbonus = screenwidth% - 11
  210.                                     zbonus = TIMER
  211.                                     LOCATE yy%, xx%
  212.                                     imothership = 0
  213.                                 END IF
  214.                             END IF
  215.                             PRINT CHR$(24) ' Tank missile.
  216.                             IF CSRLIN <> 24 THEN LOCATE , bulletcol%(i): PRINT " ";
  217.                             IF ihitaliens <> 0 THEN CALL reprintaliens(ialiencol, ihitaliens, iresults, i4, i, imothership)
  218.                             LOCATE tanky%, tankx%
  219.                             IF bullet%(i) > topmargin% THEN
  220.                                 bullet%(i) = bullet%(i) - 1
  221.                             ELSE
  222.                                 GOSUB erasebullet
  223.                             END IF
  224.  
  225.                             IF zbonus THEN
  226.                                 yy% = CSRLIN: xx% = POS(0)
  227.                                 LOCATE topmargin%, kbonus: COLOR 2 + 16: PRINT "BONUS " + LTRIM$(STR$(bonus));
  228.                                 LOCATE yy%, xx%
  229.                             END IF
  230.  
  231.                         END IF
  232.                 END SELECT
  233.             NEXT
  234.  
  235.             REM Bullet timer delay
  236.             IF z2bullet <> 0 THEN
  237.                 IF z1 < z2bullet THEN z2bullet = z2bullet - 86400
  238.                 IF z1 - z2bullet >= .06 THEN
  239.                     FOR i2 = 1 TO 5
  240.                         IF bullet%(i2) <> 0 THEN bulletdelay%(i2) = -1
  241.                     NEXT i2
  242.                 END IF
  243.                 EXIT DO
  244.             END IF
  245.         LOOP
  246.         IF iresults < 0 THEN EXIT DO
  247.         IF alienforce% = 0 OR iresults = iwin THEN
  248.             FOR i = 1 TO imaxalienmissiles
  249.                 IF ia(i) <> 0 THEN EXIT FOR
  250.             NEXT
  251.             IF i > imaxalienmissiles THEN iwait = -1
  252.             IF iwait = -1 THEN
  253.                 EXIT DO
  254.             END IF
  255.         ELSE
  256.             iwait = 1
  257.         END IF
  258.     LOOP
  259.  
  260.     IF iresults = iwin OR iresults < 0 THEN
  261.         REM end game
  262.         EXIT DO
  263.     END IF
  264.     inextrnd = -1
  265.  
  266. SELECT CASE iresults
  267.     CASE -1 ' Tank destroyed!
  268.         SOUND 800, .3: SOUND 250, 1
  269.  
  270.         FOR i = 1 TO 5
  271.             COLOR 14, 4
  272.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  273.             _DELAY .1
  274.  
  275.             COLOR 8, ibk
  276.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  277.             _DELAY .1
  278.         NEXT
  279.  
  280.         COLOR 6, ibk
  281.         LOCATE tanky% - 1, lmargin%
  282.         PRINT SPACE$(screenwidth%);
  283.         LOCATE tanky%, lmargin%
  284.         PRINT SPACE$(screenwidth%);
  285.  
  286.         _DELAY 2
  287.  
  288.         CALL qbide
  289.  
  290.     CASE -2 ' Aliens have landed!
  291.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  292.  
  293.         COLOR 7, 0
  294.         FOR i = 0 TO 21 ' Blank out screen.
  295.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  296.         NEXT
  297.  
  298.         COLOR 6, ibk
  299.         LOCATE tanky% - 1, lmargin%
  300.         PRINT SPACE$(screenwidth%);
  301.         LOCATE tanky%, lmargin%
  302.         PRINT SPACE$(screenwidth%);
  303.  
  304.         COLOR 8, ibk
  305.  
  306.         FOR j = imaxalienforce TO 1 STEP -1
  307.             IF a(j) <> "" THEN EXIT FOR
  308.         NEXT
  309.  
  310.         FOR i = j TO 1 STEP -1
  311.             LOCATE , ialiencol + INSTR(a(i), "^^")
  312.             PRINT LTRIM$(RTRIM$(a(i)));
  313.             LOCATE CSRLIN - 1
  314.         NEXT
  315.  
  316.         _DELAY 2.5
  317.  
  318.     CASE ELSE ' Winner.
  319.  
  320.         l$ = "12"
  321.         n$ = "n29": PLAY "L" + l$ + n$: _DELAY .5
  322.         n$ = "n24": PLAY "L" + l$ + n$: _DELAY .5
  323.         n$ = "n33": PLAY "L" + l$ + n$: _DELAY .5
  324.         n$ = "n29": PLAY "L" + l$ + n$
  325.  
  326.         CALL qbide
  327.  
  328.         RESTORE winner
  329.  
  330.  
  331.  
  332. COLOR 0, 3
  333. LOCATE 25, 68: PRINT "Score "; score$;
  334.  
  335. CALL instructions
  336.  
  337. COLOR 6, 0
  338. LOCATE 5, 3: PRINT "Score "; score$
  339.  
  340. DEF SEG = 0
  341.     _LIMIT 30
  342.     b$ = INKEY$
  343.     IF b$ = CHR$(27) THEN SYSTEM
  344.     IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN EXIT DO
  345.  
  346. RUN skip_intro
  347.  
  348. erasebullet:
  349. LOCATE ABS(bullet%(i)), bulletcol%(i): PRINT " ";
  350. bullet%(i) = 0: bulletcol%(i) = 0: bulletdelay%(i) = 0
  351. LOCATE tanky%, tankx%
  352.  
  353. redraw:
  354. COLOR , ibk: LOCATE tanky%, tankx% - 1: PRINT tank$;: LOCATE tanky%, tankx%: COLOR 7, ibk
  355.  
  356. first_play:
  357. DATA "The Great Pumpkin has fired an EM pulse at your computer."
  358. DATA ""
  359. DATA "All that's left working is your Alt key."
  360. DATA ""
  361. DATA "Happy Halloween!"
  362. DATA ""
  363. replay:
  364. DATA "Loading..."
  365. DATA "EOF"
  366. DATA "Game Over. Thanks for playing..."
  367. DATA "EOF2"
  368. winner:
  369. DATA "Congratulations, you saved the planet!"
  370. DATA "EOF3"
  371.  
  372.  
  373. SUB alienattack (ialiencol)
  374.     z2alienfire = TIMER
  375.  
  376.     i3 = INT(RND * 10)
  377.     FOR i = 1 TO imaxalienmissiles
  378.         IF ia(i) = 0 THEN
  379.             FOR i2 = imaxalienforce TO 1 STEP -1
  380.                 IF RTRIM$(a(i2)) <> "" THEN
  381.                     IF MID$(matrix(i2), i3 + 1, 1) <> "0" THEN
  382.                         i4 = INSTR(i3 * 7 + 1, a(i2), CHR$(79)) + ialiencol
  383.                         EXIT FOR
  384.                     END IF
  385.                 END IF
  386.             NEXT i2
  387.             IF i4 <> 0 THEN
  388.                 ia(i) = (ileadingmax - (imaxalienforce - i2) * 2) * 80 + i4
  389.                 EXIT FOR
  390.             END IF
  391.         END IF
  392.     NEXT i
  393.  
  394.  
  395. SUB alienmissile (iresults)
  396.     irow = CSRLIN: icol = POS(0)
  397.     FOR i = 1 TO imaxalienmissiles
  398.         IF ia(i) <> 0 THEN
  399.             IF iy(i) = 0 THEN
  400.                 iy(i) = ia(i) \ 80: ix(i) = ia(i) MOD 80
  401.                 IF ix(i) = 0 THEN ix(i) = screenwidth%
  402.             END IF
  403.             LOCATE iy(i) + 1, ix(i)
  404.             COLOR 6, ibk
  405.             IF CSRLIN <= 24 THEN
  406.                 IF CSRLIN = 24 THEN IF SCREEN(CSRLIN, ix(i)) <> 32 THEN iresults = -1
  407.                 PRINT CHR$(25);
  408.             ELSE
  409.                 ia(i) = 0
  410.                 LOCATE iy(i), ix(i)
  411.                 PRINT " ";: iy(i) = 0
  412.                 ia(i) = 0
  413.                 LOCATE irow, icol
  414.                 EXIT SUB
  415.             END IF
  416.             LOCATE iy(i), ix(i): PRINT " ";
  417.             iy(i) = iy(i) + 1
  418.         END IF
  419.     NEXT
  420.     LOCATE irow, icol
  421.  
  422.  
  423. SUB checkcollision (ihitaliens, ialiencol, i4, i)
  424.     ihitaliens = 0
  425.     IF ileadingmax MOD 2 = bullet%(i) MOD 2 THEN
  426.         i4 = imaxalienforce - (ileadingmax - bullet%(i)) \ 2
  427.         IF bullet%(i) <= ileadingrow AND i4 > 0 AND i4 <= imaxalienforce THEN
  428.             IF RTRIM$(a(i4)) <> "" THEN
  429.                 IF bulletcol%(i) >= iltalien(i4) AND bulletcol%(i) - ialiencol <= LEN(RTRIM$(a(i4))) THEN
  430.                     IF MID$(a(i4), bulletcol%(i) - ialiencol, 1) > CHR$(32) THEN
  431.                         ihitaliens = bulletcol%(i) - ialiencol + 1
  432.                         i3 = ihitaliens - 7 + 1: IF i3 < 1 THEN i3 = 1: REM count from the "<" symbol.
  433.                         i2 = INSTR(i3 + 1, a(i4), "^" + CHR$(79)) - 1
  434.                         MID$(a(i4), i2, 7) = SPACE$(7)
  435.                         MID$(matrix(i4), (i2 + 1) \ 7 + 1, 1) = "0"
  436.                     END IF
  437.                 END IF
  438.             END IF
  439.         END IF
  440.     END IF
  441.  
  442.     FOR i2 = 1 TO imaxalienmissiles
  443.         IF ia(i2) <> 0 THEN
  444.             IF iy(i2) >= bullet%(i) AND ix(i2) = bulletcol%(i) THEN
  445.                 ihitaliens = -i2
  446.                 EXIT FOR
  447.             END IF
  448.         END IF
  449.     NEXT
  450.  
  451.  
  452. SUB instructions
  453.     IF in$ = "" THEN
  454.         key$ = INKEY$
  455.         LOCATE 3, 3, 1, 7, 0: COLOR 6, ibk
  456.         _DELAY 2
  457.         DO
  458.             READ in$
  459.             IF MID$(in$, 1, 3) = "EOF" THEN EXIT DO
  460.             FOR i = 1 TO LEN(in$)
  461.                 SOUND 400, .07
  462.                 LOCATE , 2 + i
  463.                 PRINT MID$(in$, i, 1);
  464.                 z = TIMER
  465.                 DO
  466.                     IF ABS(z - TIMER) > .08 THEN EXIT DO
  467.                 LOOP
  468.             NEXT
  469.             LOCATE , , 0, 7, 0
  470.             _DELAY 1
  471.             PRINT
  472.             LOCATE , 3
  473.         LOOP
  474.         _DELAY 1
  475.     END IF
  476.  
  477.     IF in$ = "EOF" THEN
  478.         COLOR 7, 0
  479.         FOR i = 0 TO 19 ' Blank out intro message space.
  480.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  481.         NEXT
  482.         FOR i = 3 TO 24
  483.             LOCATE i, 80: PRINT CHR$(179);
  484.         NEXT
  485.         LOCATE 21, 2: PRINT STRING$(screenwidth%, " ");
  486.         LOCATE 22, 1: PRINT CHR$(179);
  487.         LOCATE 22, 80: PRINT CHR$(179);
  488.         LOCATE 22, 2: PRINT STRING$(screenwidth%, " ");
  489.     ELSE
  490.         COLOR 0, 3
  491.     END IF
  492.  
  493.     IF in$ <> "EOF2" AND iresults <> iwin THEN COLOR 0 + 16, 3 ELSE COLOR 0, 3
  494.     yy% = CSRLIN: xx% = POS(0)
  495.     LOCATE 25, 68: PRINT "Score ";
  496.     COLOR 0, 3
  497.     PRINT score$;
  498.     LOCATE yy%, xx%
  499.  
  500.     PCOPY 0, 3: REM save skin
  501.  
  502.  
  503. SUB marchdown (ialiencol, ialiencolstat, imotion, iresults)
  504.     COLOR 6, ibk
  505.     ileadingrow = ileadingrow + 1
  506.     ileadingmax = ileadingmax + 1
  507.     COLOR 6, ibk
  508.     FOR i = 1 TO imaxalienforce
  509.         REM SOUND 400, .2 ' Level down.
  510.         IF RTRIM$(a(i)) <> "" THEN
  511.             ialiencol = ialiencolstat + imotion
  512.             LOCATE ileadingmax - (imaxalienforce * 2) + i * 2 - 1, lmargin%
  513.             PRINT STRING$(screenwidth%, " ")
  514.             LOCATE , ialiencol + INSTR(a(i), "^^")
  515.             iltalien(i) = POS(0)
  516.             PRINT LTRIM$(RTRIM$(a(i)))
  517.         END IF
  518.     NEXT
  519.     LOCATE irow, icol
  520.     level = level - .025
  521.     IF ileadingrow = 22 THEN iresults = -2 ' Aliens have landed!
  522.  
  523. SUB movealiens (ialiencol, ialiencolstat, iresults)
  524.     STATIC imotion, imarch, imotiondir
  525.  
  526.     SOUND 800, .1: SOUND 200, .33 ' Marching sound.
  527.  
  528.     IF inextrnd = -1 THEN inextrnd = 0: imotion = 0: imarch = 0: imotiondir = 0
  529.     irow = CSRLIN: icol = POS(0)
  530.     yy% = CSRLIN: xx% = POS(0)
  531.     PCOPY 0, 1: SCREEN 0, 0, 1, 0: LOCATE yy%, xx%, 0, 7, 0
  532.     IF imotiondir = 0 THEN imotion = imotion - 1 ELSE imotion = imotion + 1
  533.     COLOR 6, ibk
  534.  
  535.     FOR i = imaxalienforce TO 1 STEP -1
  536.         IF RTRIM$(a(i)) <> "" THEN
  537.             i2 = i2 + 2
  538.             ialiencol = ialiencolstat + imotion
  539.             LOCATE ileadingmax - (imaxalienforce - i) * 2, ialiencol + INSTR(a(i), "^^")
  540.             IF POS(0) = lmargin% THEN imarch = 1
  541.             iltalien(i) = POS(0)
  542.             IF imotiondir = 0 THEN
  543.                 PRINT LTRIM$(RTRIM$(a(i))); " "
  544.             ELSE
  545.                 LOCATE , POS(0) - 1
  546.                 PRINT " "; LTRIM$(RTRIM$(a(i)))
  547.             END IF
  548.             IF ialiencol + LEN(RTRIM$(a(i))) = screenwidth% THEN imarch = -1
  549.         END IF
  550.     NEXT
  551.  
  552.     IF imarch = 1 THEN imotiondir = 1: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  553.     IF imarch = -1 THEN imotiondir = 0: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  554.     IF imarch = 0 THEN
  555.         IF ABS(TIMER - z2alienfire) > firerate THEN
  556.             firerate = (INT(RND * 10) + 1) / 20
  557.             IF iwait = 0 THEN CALL alienattack(ialiencol)
  558.         END IF
  559.     ELSE
  560.         imarch = 0
  561.     END IF
  562.     PCOPY 1, 0: SCREEN 0, 0, 0, 0
  563.     LOCATE irow, icol, 1, 7, 0
  564.  
  565. SUB mship (imothership)
  566.     STATIC x%, mov%, z4, mothership$
  567.  
  568.     yy% = CSRLIN: xx% = POS(0): COLOR 6, ibk
  569.     IF imothership = -1 THEN
  570.         imothership = 1
  571.         x% = lmargin%
  572.         mothership$ = CHR$(254) + CHR$(254) + "O" + CHR$(254) + CHR$(254)
  573.         mov% = 1
  574.     END IF
  575.  
  576.     IF ABS(TIMER - z4) > .05 THEN GOSUB mothership: z4 = TIMER: LOCATE yy%, xx%: EXIT SUB
  577.     LOCATE yy%, xx%
  578.     EXIT SUB
  579.  
  580.     mothership:
  581.     IF x% + LEN(mothership$) = screenwidth% + lmargin% THEN mov% = -1 ELSE IF x% = lmargin% THEN mov% = 1
  582.     x% = x% + mov%
  583.     LOCATE topmargin%, x%
  584.     PRINT mothership$;
  585.     IF x% > 1 AND mov% = 1 THEN
  586.         LOCATE , POS(0) - LEN(mothership$) - 1: PRINT " ";
  587.     END IF
  588.     IF mov% = -1 THEN PRINT " ";
  589.     RETURN
  590.  
  591.  
  592. DEFINT A-H, J-Z
  593. SUB qbide
  594.     PALETTE 2, 59
  595.     COLOR 15, 0
  596.     CLS
  597.  
  598.     COLOR 0, 7
  599.     LOCATE 1, 1
  600.     PRINT SPACE$(80)
  601.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  602.  
  603.     COLOR 7, 0 ' Black background.
  604.  
  605.     LOCATE 2, 1: PRINT CHR$(218)
  606.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  607.     LOCATE 2, 80: PRINT CHR$(191)
  608.  
  609.     LOCATE 2, 76: PRINT CHR$(180)
  610.     LOCATE 2, 78: PRINT CHR$(195)
  611.  
  612.     COLOR 0, 7
  613.     LOCATE 2, 77: PRINT CHR$(24)
  614.     LOCATE 2, 36: PRINT " Untitled "
  615.  
  616.     COLOR 7, 0
  617.     FOR Rows = 3 TO 24
  618.         LOCATE Rows, 1: PRINT CHR$(179);
  619.         LOCATE Rows, 80: PRINT CHR$(179);
  620.     NEXT Rows
  621.  
  622.     LOCATE 22, 1: PRINT CHR$(195)
  623.     LOCATE 22, 80: PRINT CHR$(180)
  624.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  625.     LOCATE 22, 35
  626.     PRINT " Immediate "
  627.  
  628.     COLOR 0, 7
  629.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  630.     LOCATE 21, 2: PRINT CHR$(27)
  631.     LOCATE 21, 3: PRINT CHR$(219)
  632.     LOCATE 21, 79: PRINT CHR$(26)
  633.     FOR Rows = 4 TO 19
  634.         LOCATE Rows, 80: PRINT CHR$(176)
  635.     NEXT Rows
  636.     LOCATE 3, 80: PRINT CHR$(24)
  637.     LOCATE 4, 80: PRINT CHR$(219)
  638.     LOCATE 20, 80: PRINT CHR$(25)
  639.  
  640.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  641.     LOCATE 25, 59: PRINT SPACE$(4);
  642.     COLOR 0, 3
  643.     LOCATE 25, 63: PRINT CHR$(179);
  644.     LOCATE 25, 64: PRINT SPACE$(6);
  645.     LOCATE 25, 68: PRINT "C  00001:001 ";
  646.  
  647.  
  648. DEFSNG A-H, J-Z
  649. SUB reprintaliens (ialiencol, ihitaliens, iresults, i4, i, imothership)
  650.     IF ihitaliens > 0 THEN
  651.         ihits = ihits + 1
  652.  
  653.         SELECT CASE iresults + 1
  654.             CASE 1: score$ = LTRIM$(STR$(VAL(score$) + 150))
  655.             CASE 2: score$ = LTRIM$(STR$(VAL(score$) + 250))
  656.             CASE 3: score$ = LTRIM$(STR$(VAL(score$) + 350))
  657.         END SELECT
  658.  
  659.         score$ = STRING$(6 - LEN(score$), "0") + score$
  660.         IF (ihits + 15) MOD 20 = 0 AND imothership = 0 THEN imothership = -1
  661.         LOCATE bullet%(i), lmargin%: PRINT SPACE$(screenwidth%);
  662.         iltalien(i4) = POS(0)
  663.  
  664.         IF RTRIM$(a(i4)) = "" THEN
  665.             alienforce% = alienforce% - 1
  666.             IF alienforce% = 0 THEN iresults = iresults + 1 ' Level completed. Goto to next level.
  667.             IF bullet%(i) = ileadingrow THEN ileadingrow = ileadingrow - 2
  668.         ELSE
  669.             LOCATE bullet%(i), ialiencol + INSTR(a(i4), "^^"): PRINT LTRIM$(RTRIM$(a(i4)))
  670.         END IF
  671.     ELSE
  672.         i2 = ABS(ihitaliens)
  673.         LOCATE iy(i2), ix(i2)
  674.         PRINT " ";: iy(i2) = 0
  675.         ia(i2) = 0
  676.         LOCATE irow, icol
  677.         SOUND 1000, .5
  678.     END IF
  679.  
  680.     ihitaliens = 0
  681.     bullet%(i) = -bullet%(i)
  682.  
  683.     COLOR 0, 3
  684.     yy% = CSRLIN: xx% = POS(0)
  685.     LOCATE 25, 74: PRINT score$;
  686.     LOCATE yy%, xx%
  687.     COLOR 6, ibk
  688.  
  689.  
  690. SUB qbideOrig
  691.     PALETTE 2, 59
  692.     COLOR 15, 1
  693.     CLS
  694.  
  695.     COLOR 0, 7
  696.     LOCATE 1, 1
  697.     PRINT SPACE$(80)
  698.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  699.  
  700.     COLOR 7, 1
  701.  
  702.     LOCATE 2, 1: PRINT CHR$(218)
  703.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  704.     LOCATE 2, 80: PRINT CHR$(191)
  705.  
  706.     LOCATE 2, 76: PRINT CHR$(180)
  707.     LOCATE 2, 78: PRINT CHR$(195)
  708.  
  709.     COLOR 1, 7
  710.     LOCATE 2, 77: PRINT CHR$(24)
  711.     LOCATE 2, 36: PRINT " Untitled "
  712.  
  713.     COLOR 7, 1
  714.     FOR Rows = 3 TO 24
  715.         LOCATE Rows, 1: PRINT CHR$(179);
  716.         LOCATE Rows, 80: PRINT CHR$(179);
  717.     NEXT Rows
  718.  
  719.     LOCATE 22, 1: PRINT CHR$(195)
  720.     LOCATE 22, 80: PRINT CHR$(180)
  721.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  722.     LOCATE 22, 35
  723.     PRINT " Immediate "
  724.  
  725.     COLOR 0, 7
  726.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  727.     LOCATE 21, 2: PRINT CHR$(27)
  728.     LOCATE 21, 3: PRINT CHR$(219)
  729.     LOCATE 21, 79: PRINT CHR$(26)
  730.     FOR Rows = 4 TO 19
  731.         LOCATE Rows, 80: PRINT CHR$(176)
  732.     NEXT Rows
  733.     LOCATE 3, 80: PRINT CHR$(24)
  734.     LOCATE 4, 80: PRINT CHR$(219)
  735.     LOCATE 20, 80: PRINT CHR$(25)
  736.  
  737.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  738.     LOCATE 25, 59: PRINT SPACE$(4);
  739.     COLOR 0, 3
  740.     LOCATE 25, 63: PRINT CHR$(179);
  741.     LOCATE 25, 64: PRINT SPACE$(6);
  742.     LOCATE 25, 68: PRINT "C  00001:001 ";
  743.  
  744.  
  745. SUB TheBOB
  746.    ' This sub routine created by Bob Seguin of the QBasic Forum.
  747.    SCREEN 12
  748.  
  749.     OUT &H3C8, 1: OUT &H3C9, 40: OUT &H3C9, 12: OUT &H3C9, 0
  750.     OUT &H3C8, 2: OUT &H3C9, 6: OUT &H3C9, 12: OUT &H3C9, 0
  751.     OUT &H3C8, 3: OUT &H3C9, 30: OUT &H3C9, 8: OUT &H3C9, 0
  752.     OUT &H3C8, 4: OUT &H3C9, 3: OUT &H3C9, 8: OUT &H3C9, 0
  753.     OUT &H3C8, 7: OUT &H3C9, 63: OUT &H3C9, 0: OUT &H3C9, 0
  754.     OUT &H3C8, 8: OUT &H3C9, 46: OUT &H3C9, 0: OUT &H3C9, 0
  755.     OUT &H3C8, 9: OUT &H3C9, 63: OUT &H3C9, 63: OUT &H3C9, 63
  756.     OUT &H3C8, 12: OUT &H3C9, 20: OUT &H3C9, 20: OUT &H3C9, 20
  757.     OUT &H3C8, 13: OUT &H3C9, 0: OUT &H3C9, 0: OUT &H3C9, 0
  758.     OUT &H3C8, 14: OUT &H3C9, 55: OUT &H3C9, 35: OUT &H3C9, 0
  759.  
  760.     CIRCLE (320, 240), 100, 3, , , .9
  761.     PAINT (320, 240), 3
  762.     CIRCLE (320, 230), 90, 1, , , .9
  763.     PAINT (320, 230), 1
  764.     FOR Reps = 1 TO 4
  765.         SELECT CASE Reps
  766.             DATA 1,1.2,1.8,5
  767.             CASE 1: Elipse = 1
  768.             CASE 2: Elipse = 1.2
  769.             CASE 3: Elipse = 1.8
  770.             CASE 4: Elipse = 5
  771.         END SELECT
  772.         FOR E = Elipse TO Elipse + .1 STEP .01
  773.             CIRCLE (320, 240), 100, 3, , , E
  774.         NEXT E
  775.     NEXT Reps
  776.     FOR Radius = 38 TO 43
  777.         CIRCLE (320, 160), Radius, 3, , , .4
  778.     NEXT Radius
  779.     CIRCLE (320, 160), 40, 14, 3.3, 6, .4
  780.     CIRCLE (320, 240), 100, 5, , , .9
  781.     PAINT (0, 0), 5
  782.     CIRCLE (320, 240), 100, 0, , , .9
  783.     PAINT (0, 0), 0
  784.     FOR Radius = 12 TO 18
  785.         CIRCLE (320, 153), Radius, 2, , , .3
  786.     NEXT Radius
  787.     CIRCLE (320, 150), 12, 2, , , .6
  788.     PAINT STEP(0, 0), 2
  789.     CIRCLE (300, 143), 32, 2, 6, 1.1
  790.     CIRCLE (276, 143), 32, 2, 6, .6
  791.     DRAW "BM302,125 C2 M+15,-10 BD10 P2,2"
  792.     PAINT (320, 145), 2
  793.     CIRCLE (282, 143), 32, 4, 6, .73
  794.     CIRCLE (266, 156), 60, 4, .1, .68
  795.     CIRCLE (320, 150), 12, 4, 3.14159, 0, .2
  796.     DRAW "BM302,125 C4 M+15,-10 BD10"
  797.     CIRCLE (276, 143), 32, 4, 6, .6
  798.     PAINT STEP(35, 0), 4
  799.     'Face begins
  800.     CIRCLE (303, 316), 100, 14, 1.5, 2
  801.     CIRCLE (337, 316), 100, 14, 1.1, 1.64
  802.     PSET (310, 215), 14
  803.     DRAW "H30 M-20,+40 M+12,-4 M+14,-29 BL2 P14,14 BF12 P15,14"
  804.     PSET (330, 215), 14
  805.     DRAW "E30 M+20,+40 M-12,-4 M-14,-29 BR2 P14,14 BG12 P15,14"
  806.     PSET (320, 246), 14
  807.     DRAW "R20 H20 G20 R20 U nL19 nR19 BU2 P15,14"
  808.     CIRCLE (320, 170), 100, 14, 3.8, 4.1
  809.     CIRCLE (320, 170), 100, 14, 4.42, 5.01
  810.     CIRCLE (320, 170), 100, 14, 5.33, 5.62
  811.     CIRCLE (320, 220), 80, 14, 3.29, 4.5
  812.     CIRCLE (320, 220), 80, 14, 4.66, 6.15
  813.     PSET (260, 250), 14
  814.     DRAW "D10 F8 U13 M+10,+5 D12 M+12,+6 U12 BR60"
  815.     DRAW "D12 M+12,-6 U12 M+10,-5 D13 E8 U10"
  816.     PSET (300, 297), 14
  817.     DRAW "U14 R16 D16"
  818.     CIRCLE (320, 212), 80, 14, 3.42, 4.5
  819.     CIRCLE (320, 212), 80, 14, 4.66, 6
  820.     LINE (300, 280)-(316, 283), 14, BF
  821.     PAINT (320, 296), 14
  822.     PAINT (290, 292), 14
  823.     PAINT (300, 278), 15, 14
  824.     CIRCLE (100, 240), 32, 13
  825.     PAINT STEP(0, 0), 13
  826.     FOR x% = 58 TO 142
  827.         FOR y% = 198 TO 282
  828.             IF POINT(x%, y%) = 13 THEN
  829.                 IF POINT(x% + 220, y%) = 15 THEN PSET (x% + 220, y%), 9
  830.             END IF
  831.         NEXT y%
  832.     NEXT x%
  833.  
  834.     COLOR 13: LOCATE 1, 1: PRINT "HAPPY HALLOWEEN!"
  835.     xx = 64: yy = 360
  836.     FOR x% = 0 TO 300
  837.         FOR y% = 0 TO 16
  838.             IF POINT(x%, y%) = 13 THEN
  839.                 IF y% > 6 THEN Colr = 8 ELSE Colr = 7
  840.                 LINE (x% * 4 + xx, y% * 4 + yy)-(x% * 4 + xx + 3, y% * 4 + yy + 3), Colr, BF
  841.             END IF
  842.         NEXT y%
  843.     NEXT x%
  844.     FOR x% = 0 TO 639
  845.         IF POINT(x%, 368) <> 0 THEN PSET (x%, 368), 14
  846.     NEXT x%
  847.     LINE (5, 5)-(634, 474), 12, B
  848.     LINE (8, 8)-(631, 471), 12, B
  849.     LINE (50, 354)-(580, 420), 15, B
  850.  
  851.     z1 = TIMER
  852.     DO UNTIL ABS(TIMER - z1) > 4
  853.         FOR Reps = 1 TO 3
  854.             WAIT &H3DA, 8
  855.             WAIT &H3DA, 8, 8
  856.         NEXT Reps
  857.  
  858.         Flicker = FIX(RND * 20)
  859.         OUT &H3C8, 14
  860.         OUT &H3C9, 40 + Flicker
  861.         OUT &H3C9, 25 + Flicker
  862.         OUT &H3C9, 10 + Flicker
  863.  
  864.         OUT &H3C8, 15
  865.         OUT &H3C9, 43 + Flicker
  866.         OUT &H3C9, 38 + Flicker
  867.         OUT &H3C9, 20 + Flicker
  868.     LOOP
  869.     SCREEN 0, 0, 0, 0

 [ This attachment cannot be displayed inline in 'Print Page' view ]

Pete
Title: Re: Competition
Post by: bplus on October 08, 2021, 11:33:18 pm
@Pete Great (Pumpkin) Opening!

24750 is a level and almost the 2nd. Was it Black and Red before? good choice.
Title: Re: Competition
Post by: johnno56 on October 09, 2021, 12:48:52 am
Pete,

My apologies for my shameless display of ebullience. You are correct. Quite out of order.

J
Title: Re: Competition
Post by: Pete on October 09, 2021, 01:32:55 am
@johnno56 Did you see this thread from this link to page 2? https://www.qb64.org/forum/index.php?topic=4243.msg136169#msg136169

That's the one that also lead to my Elton John song parody. Quite logical!

Pete
Title: Re: Competition
Post by: SMcNeill on October 09, 2021, 03:26:16 am
Pete,

My apologies for my shameless display of ebullience. You are correct. Quite out of order.

J

E-bullies are NOT nice!  No matter what you and your auto-correct might say. 
Title: Re: Competition
Post by: johnno56 on October 09, 2021, 06:39:17 am
Did I miss something?
Title: Re: Competition
Post by: SMcNeill on October 09, 2021, 06:51:15 am
Did I miss something?

ebullience -- e-bullie nce!  I can tell, you were saying “e-bullies, nice!”, and your autocorrect kicked in.  Praising those mean old e-bullies!  Bad johnno!  Bad!

😂🤣😂

Nobody such use such dang confluting language round here!
Title: Re: Competition
Post by: johnno56 on October 09, 2021, 08:50:03 am
Ebullient = "cheerful and full of energy"... but I see what you mean...
Title: Re: Competition
Post by: bplus on October 09, 2021, 08:55:56 am
Is it just US patriots that like to take high faluting English sounding words and say things like, whats e bull'n ennce for anyway? What did ence every do to em?
Title: Re: Competition
Post by: bplus on October 09, 2021, 08:57:23 am
With there best English accent they can manage, of course.
Title: Re: Competition
Post by: johnno56 on October 09, 2021, 04:06:28 pm
Umm... 'their' ("Their" is a positive pronoun - "their car is red" and "there" can be used as an adjective - "he is always there for me" or a adverb - "stop right there"
But, my guess is, you had deliberately chosen that word to prove a point... Nicely done (should be - "well done") lol.
Title: Re: Competition
Post by: SMcNeill on October 09, 2021, 04:34:48 pm
Umm... 'their' ("Their" is a positive pronoun - "their car is red" and "there" can be used as an adjective - "he is always there for me" or a adverb - "stop right there"
But, my guess is, you had deliberately chosen that word to prove a point... Nicely done (should be - "well done") lol.

Don’t be so uptight.  It's just a typo.  Everyone knows he meant to type they’re!
Title: Re: Competition
Post by: bplus on October 09, 2021, 06:44:37 pm
Don’t be so uptight.  It's just a typo.  Everyone knows he meant to type they’re!

LOL!

@johnno56
Yeah, umm... trying really hard to cut back on my edits. I guess my habit of posting had been to write, post, edit, edit, edit... until I'm accused of abusing the Modify privilege's. Hope this old dog can learn at least one new good habit.
Title: Re: Competition
Post by: bplus on October 09, 2021, 06:46:00 pm
It does look so much neater without and edit line at the bottom.
Title: Re: Competition
Post by: bplus on October 09, 2021, 06:50:51 pm
PS you missed one:

Quote
What did ence every do to em?

Meant to say "ever" not "every" and it's driving me crazy!

Well maybe just one, no, there was the usual "to" but meaning "too" back there to.  ;-))
Title: Re: Competition
Post by: FellippeHeitor on October 09, 2021, 06:56:17 pm
Please, don't get me wrong. Fixing a typo is expected usage. Changing the contents after replies had already been posted was what was annoying.

The feature is back, it's just a matter of dosing usage really.
Title: Re: Competition
Post by: johnno56 on October 10, 2021, 09:04:06 am
My apologies. I will endeavour to do my best so as to not "poke at that hornets nest again".
Title: Re: Competition
Post by: Pete on October 11, 2021, 10:04:26 pm
My apologies. I will endeavour to do my best so as to not "poke at that hornets nest again".

When I was 9, I learned throwing crab apples at a hornet next was not a good idea, either. I also learned I could out run hornets. My cousin and I were having a contest, and I won. I hit the hornet nest first. We both saw a big black cloud emerge, and then we had our second, unscheduled event... we tied at that one. We both hit the woodshed door at the same time!

No hornets where I live now, but f there were, I'd recommend gasoline and fire. We do love barbecuing in California.

Pete
Title: Re: Competition
Post by: johnno56 on October 12, 2021, 05:00:25 am
Mmmm... barbecue...
Title: Re: Competition
Post by: Pete on October 12, 2021, 11:21:47 pm
Dogs and burgers tonight on the grill. I make the burgers with sauteed onions and mushrooms. 6 oz patties with garlic, onion, and seasonings.

Pete
Title: Re: Competition
Post by: bplus on October 12, 2021, 11:56:24 pm
BTW I've been wondering how this thing might be judged. I think all who have participated earn the right to vote. If everyone votes for them self or there is a tie, a person could be nominated and voted by for by the participants after Halloween to break the tie.

I was going to say voting day is November 2 but need a week after Halloween to try out the others to form a fair and balanced decision for your creation ha, ha! So yeah, that might be a rule, you aren't allowed to vote for yourself. And therefore the votes are to be made publicly. Or is all this just too formal for you guys?

Prize, did I hear someone wonder about that? How about a very strong recommendation by me to Qwerkey to immortalize your work in the Library?
Title: Re: Competition
Post by: Pete on October 13, 2021, 03:58:36 pm
Anyone up for invaders with FLAPPY BATS? Oh, and just edited in, The Great Pumpkin as the "Mother ship."

Code: QB64: [Select]
  1. DIM SHARED intro%: intro% = -1
  2. skip_intro:
  3. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  4. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits, score$
  5.  
  6.  
  7. score$ = "000000"
  8. imaxalienforce = 6
  9. imaxalienmissiles = 3
  10. lmargin% = 2
  11. rmargin% = 79
  12. topmargin% = 3
  13. ialiencolstat = 6
  14. iwin = 3 ' 3 Levels.
  15. screenwidth% = rmargin% - lmargin% + 1
  16. ibk = 0 ' Background color
  17.  
  18. DIM SHARED a(imaxalienforce) AS STRING * 68
  19.  
  20. SCREEN 0, 0, 0, 0
  21.  
  22. 'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.
  23. 'font& = _LOADFONT(fontpath$, 25, "monospace")
  24. '_FONT font&
  25.  
  26. COLOR 7, 0: CLS
  27.  
  28. REM Make aliens
  29. a1$ = "^^" + CHR$(79) + "^^  "
  30. a$ = a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$
  31. alt1$ = "--" + CHR$(79) + "--  "
  32. a$ = a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$
  33. alt$ = alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$
  34.  
  35. IF intro% THEN
  36.     SCREEN 0, 0, 1, 1
  37.     CALL qbideOrig
  38.  
  39.     SCREEN 0, 0, 2, 0
  40.     CALL qbide
  41.  
  42.     SCREEN 0, 0, 1, 1
  43.     _DELAY 2
  44.  
  45.     IF _FILEEXISTS("Thunder6.ogg") THEN
  46.         Rain& = _SNDOPEN("RainBk.ogg", "SYNC")
  47.         T1& = _SNDOPEN("Thunder1.ogg", "SYNC")
  48.         T2& = _SNDOPEN("Thunder2.ogg", "SYNC")
  49.         T3& = _SNDOPEN("Thunder3.ogg", "SYNC")
  50.         T4& = _SNDOPEN("Thunder4.ogg", "SYNC")
  51.         T5& = _SNDOPEN("Thunder5.ogg", "SYNC")
  52.         T6& = _SNDOPEN("Thunder6.ogg", "SYNC")
  53.         T7& = _SNDOPEN("Thunder7.ogg", "SYNC")
  54.         T8& = _SNDOPEN("Thunder8.ogg", "SYNC")
  55.  
  56.         _SNDPLAY T6&
  57.         _DELAY .1
  58.         _SNDPLAY T7&
  59.         _DELAY .1
  60.         _SNDPLAY T8&
  61.     ELSE
  62.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  63.     END IF
  64.  
  65.     FOR i = 1 TO 15
  66.         _DELAY i / 150
  67.         IF i / 2 = i \ 2 THEN
  68.             SOUND 250, .1
  69.             SCREEN 0, 0, 1, 1
  70.         ELSE
  71.             SCREEN 0, 0, 2, 2
  72.             IF i < 13 THEN _DELAY i / 100: SCREEN 0, 0, 3, 3: COLOR 0, 7: CLS
  73.         END IF
  74.     NEXT
  75.  
  76.     PCOPY 2, 0
  77.     SCREEN 0, 0, 0, 0
  78.     _DELAY 1.5
  79.  
  80.     CALL TheBOB
  81.  
  82.     '_FREEFONT font&
  83.     'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.
  84.     'font& = _LOADFONT(fontpath$, 25, "monospace")
  85.     '_FONT font&
  86.  
  87.     CALL qbide
  88.  
  89.     CALL qbide
  90.  
  91.  
  92. IF intro% = -1 THEN RESTORE first_play ELSE RESTORE replay
  93.  
  94. CALL instructions
  95.  
  96.     IF inextrnd = -1 THEN PCOPY 3, 0
  97.     tank$ = CHR$(218) + CHR$(127) + CHR$(191): icolor = 6
  98.     REDIM SHARED bullet%(5), bulletcol%(5), bulletdelay%(5), iltalien(imaxalienforce)
  99.     REDIM SHARED ia(imaxalienmissiles), iy(imaxalienmissiles), ix(imaxalienmissiles)
  100.     REDIM SHARED matrix(imaxalienforce) AS STRING * 10
  101.     alienforce% = imaxalienforce
  102.     level = .65
  103.     iround = iround + 1
  104.     level = level - iround / 15
  105.     inextrnd = -1
  106.     COLOR 6, ibk
  107.  
  108.     REM Set up aliens
  109.     ialiencol = ialiencolstat
  110.     LOCATE 2, ialiencol
  111.     FOR i = 1 TO imaxalienforce
  112.         IF i MOD 1 = 0 THEN PRINT
  113.         LOCATE , ialiencol
  114.         IF i = imaxalienforce THEN
  115.             ileadingrow = CSRLIN: ileadingmax = ileadingrow
  116.         END IF
  117.         IF i \ 2 = i / 2 THEN a(i) = a$ ELSE a(i) = alt$
  118.         PRINT a(i)
  119.     NEXT
  120.  
  121.     COLOR 0 + 16, 3
  122.     LOCATE 25, 68: PRINT "Score ";
  123.     COLOR 0, 3
  124.     PRINT score$;
  125.     COLOR 6, ibk
  126.  
  127.     REM Station
  128.     LOCATE 24, 40
  129.     tanky% = CSRLIN: tankx% = POS(0) + 1
  130.     PRINT tank$;: LOCATE , POS(0) - 2
  131.  
  132.     _DELAY 1
  133.  
  134.     DO
  135.         z1 = TIMER
  136.         DO
  137.             IF zbonus THEN
  138.                 IF ABS(zbonus - TIMER) > 1.5 THEN
  139.                     yy% = CSRLIN: xx% = POS(0)
  140.                     COLOR 6, 0: LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  141.                     LOCATE yy%, xx%
  142.                     zbonus = 0
  143.                 END IF
  144.             END IF
  145.  
  146.             IF topmargin% + ileadingmax - (imaxalienforce * 2) >= topmargin% + 2 THEN
  147.                 IF imothership <> 0 THEN CALL mship(imothership)
  148.             END IF
  149.             IF ABS(TIMER - z1aliens) > level THEN
  150.                 CALL movealiens(ialiencol, ialiencolstat, iresults)
  151.                 z1aliens = TIMER
  152.             END IF
  153.             IF iresults < 0 THEN EXIT DO
  154.             IF ABS(TIMER - z1ia) > .3 THEN CALL alienmissile(iresults): z1ia = TIMER
  155.  
  156.             DEF SEG = 0
  157.             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  158.                 key$ = CHR$(32) ' Alt
  159.             ELSE
  160.                 key$ = ""
  161.             END IF
  162.             DEF SEG
  163.  
  164.             SELECT CASE key$
  165.                 CASE CHR$(32)
  166.                     IF flag = 0 THEN switch = switch * -1 - 1: flag = -1
  167.                     SELECT CASE switch
  168.                         CASE 0
  169.                             IF ABS(z9 - TIMER) > .15 THEN
  170.                                 IF POS(0) < screenwidth% THEN COLOR icolor, ibk: LOCATE , POS(0) - 1: PRINT " " + tank$;: LOCATE , POS(0) - 2
  171.                                 tanky% = CSRLIN: tankx% = POS(0)
  172.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  173.                                 z9 = TIMER
  174.                             END IF
  175.                         CASE -1
  176.                             IF ABS(z9 - TIMER) > .15 THEN
  177.                                 IF POS(0) > lmargin% + 1 THEN COLOR icolor, ibk: LOCATE , POS(0) - 2: PRINT tank$ + " ";: LOCATE , POS(0) - 3
  178.                                 tanky% = CSRLIN: tankx% = POS(0)
  179.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  180.                                 z9 = TIMER
  181.                             END IF
  182.                     END SELECT
  183.                     IF icolor = 6 THEN
  184.                         FOR i2 = 1 TO 5
  185.                             IF bullet%(i2) = 0 THEN
  186.                                 icolor = 12: COLOR icolor, ibk: GOSUB redraw
  187.                                 bullet%(i2) = -1: reload = TIMER: EXIT FOR
  188.                             END IF
  189.                         NEXT
  190.                     END IF
  191.                 CASE ""
  192.                     IF flag THEN skip = 0: flag = 0
  193.                 CASE CHR$(27): SYSTEM
  194.             END SELECT
  195.  
  196.             IF ABS(z1 - reload) > .6 AND reload <> 0 THEN
  197.                 GOSUB redraw
  198.                 icolor = 6: reload = 0
  199.             END IF
  200.  
  201.             REM Fire
  202.             FOR i = 1 TO 5
  203.                 SELECT CASE bullet%(i)
  204.                     CASE -1: bullet%(i) = tanky% - 1: bulletcol%(i) = tankx%
  205.                     CASE IS > 0
  206.                         IF bulletdelay%(i) = -1 OR bullet%(i) = tanky% - 1 THEN
  207.                             CALL checkcollision(ihitaliens, ialiencol, i4, i)
  208.                             z2bullet = TIMER: bulletdelay%(i) = 0
  209.                             COLOR 6, ibk
  210.                             LOCATE bullet%(i), bulletcol%(i)
  211.                             IF bullet%(i) = topmargin% AND imothership <> 0 THEN ' Hit mother ship.
  212.                                 IF SCREEN(ABS(bullet%(i)), bulletcol%(i)) <> 32 THEN
  213.                                     SOUND 1000, .75
  214.                                     SELECT CASE iresults + 1
  215.                                         CASE 1: bonus = 1500
  216.                                         CASE 2: bonus = 2500
  217.                                         CASE 3: bonus = 5000
  218.                                     END SELECT
  219.                                     score$ = LTRIM$(STR$(VAL(score$) + bonus))
  220.                                     score$ = STRING$(6 - LEN(score$), "0") + score$
  221.                                     yy% = CSRLIN: xx% = POS(0)
  222.                                     SOUND 800, .5: SOUND 1600, .5: SOUND 2400, .5
  223.                                     LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  224.                                     kbonus = bulletcol%(i) - 4
  225.                                     IF kbonus < lmargin% THEN kbonus = lmargin%
  226.                                     IF kbonus + 10 > screenwidth% THEN kbonus = screenwidth% - 11
  227.                                     zbonus = TIMER
  228.                                     LOCATE yy%, xx%
  229.                                     imothership = 0
  230.                                 END IF
  231.                             END IF
  232.                             PRINT CHR$(24) ' Tank missile.
  233.                             IF CSRLIN <> 24 THEN LOCATE , bulletcol%(i): PRINT " ";
  234.                             IF ihitaliens <> 0 THEN CALL reprintaliens(ialiencol, ihitaliens, iresults, i4, i, imothership)
  235.                             LOCATE tanky%, tankx%
  236.                             IF bullet%(i) > topmargin% THEN
  237.                                 bullet%(i) = bullet%(i) - 1
  238.                             ELSE
  239.                                 GOSUB erasebullet
  240.                             END IF
  241.  
  242.                             IF zbonus THEN
  243.                                 yy% = CSRLIN: xx% = POS(0)
  244.                                 LOCATE topmargin%, kbonus: COLOR 2 + 16: PRINT "BONUS " + LTRIM$(STR$(bonus));
  245.                                 LOCATE yy%, xx%
  246.                             END IF
  247.  
  248.                         END IF
  249.                 END SELECT
  250.             NEXT
  251.  
  252.             REM Bullet timer delay
  253.             IF z2bullet <> 0 THEN
  254.                 IF z1 < z2bullet THEN z2bullet = z2bullet - 86400
  255.                 IF z1 - z2bullet >= .06 THEN
  256.                     FOR i2 = 1 TO 5
  257.                         IF bullet%(i2) <> 0 THEN bulletdelay%(i2) = -1
  258.                     NEXT i2
  259.                 END IF
  260.                 EXIT DO
  261.             END IF
  262.         LOOP
  263.         IF iresults < 0 THEN EXIT DO
  264.         IF alienforce% = 0 OR iresults = iwin THEN
  265.             FOR i = 1 TO imaxalienmissiles
  266.                 IF ia(i) <> 0 THEN EXIT FOR
  267.             NEXT
  268.             IF i > imaxalienmissiles THEN iwait = -1
  269.             IF iwait = -1 THEN
  270.                 EXIT DO
  271.             END IF
  272.         ELSE
  273.             iwait = 1
  274.         END IF
  275.     LOOP
  276.  
  277.     IF iresults = iwin OR iresults < 0 THEN
  278.         REM end game
  279.         EXIT DO
  280.     END IF
  281.     inextrnd = -1
  282.  
  283. SELECT CASE iresults
  284.     CASE -1 ' Tank destroyed!
  285.         SOUND 800, .3: SOUND 250, 1
  286.  
  287.         FOR i = 1 TO 5
  288.             COLOR 14, 4
  289.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  290.             _DELAY .1
  291.  
  292.             COLOR 8, ibk
  293.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  294.             _DELAY .1
  295.         NEXT
  296.  
  297.         COLOR 6, ibk
  298.         LOCATE tanky% - 1, lmargin%
  299.         PRINT SPACE$(screenwidth%);
  300.         LOCATE tanky%, lmargin%
  301.         PRINT SPACE$(screenwidth%);
  302.  
  303.         _DELAY 2
  304.  
  305.         CALL qbide
  306.  
  307.     CASE -2 ' Aliens have landed!
  308.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  309.  
  310.         COLOR 7, 0
  311.         FOR i = 0 TO 21 ' Blank out screen.
  312.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  313.         NEXT
  314.  
  315.         COLOR 6, ibk
  316.         LOCATE tanky% - 1, lmargin%
  317.         PRINT SPACE$(screenwidth%);
  318.         LOCATE tanky%, lmargin%
  319.         PRINT SPACE$(screenwidth%);
  320.  
  321.         COLOR 8, ibk
  322.  
  323.         FOR j = imaxalienforce TO 1 STEP -1
  324.             IF a(j) <> "" THEN EXIT FOR
  325.         NEXT
  326.  
  327.         FOR i = j TO 1 STEP -1
  328.             LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2
  329.             PRINT LTRIM$(RTRIM$(a(i)));
  330.             LOCATE CSRLIN - 2
  331.         NEXT
  332.  
  333.         _DELAY 2.5
  334.  
  335.     CASE ELSE ' Winner.
  336.  
  337.         l$ = "12"
  338.         n$ = "n29": PLAY "L" + l$ + n$: _DELAY .5
  339.         n$ = "n24": PLAY "L" + l$ + n$: _DELAY .5
  340.         n$ = "n33": PLAY "L" + l$ + n$: _DELAY .5
  341.         n$ = "n29": PLAY "L" + l$ + n$
  342.  
  343.         CALL qbide
  344.  
  345.         RESTORE winner
  346.  
  347.  
  348.  
  349. COLOR 0, 3
  350. LOCATE 25, 68: PRINT "Score "; score$;
  351.  
  352. CALL instructions
  353.  
  354. COLOR 6, 0
  355. LOCATE 5, 3: PRINT "Score "; score$
  356.  
  357. DEF SEG = 0
  358.     _LIMIT 30
  359.     b$ = INKEY$
  360.     IF b$ = CHR$(27) THEN SYSTEM
  361.     IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN EXIT DO
  362.  
  363. RUN skip_intro
  364.  
  365. erasebullet:
  366. LOCATE ABS(bullet%(i)), bulletcol%(i): PRINT " ";
  367. bullet%(i) = 0: bulletcol%(i) = 0: bulletdelay%(i) = 0
  368. LOCATE tanky%, tankx%
  369.  
  370. redraw:
  371. COLOR , ibk: LOCATE tanky%, tankx% - 1: PRINT tank$;: LOCATE tanky%, tankx%: COLOR 7, ibk
  372.  
  373. first_play:
  374. DATA "The Great Pumpkin has fired an EM pulse at your computer."
  375. DATA ""
  376. DATA "All that's left working is your Alt key."
  377. DATA ""
  378. replay:
  379. DATA "Loading..."
  380. DATA "EOF"
  381. DATA "Game Over. Press Alt to play again..."
  382. DATA "EOF2"
  383. winner:
  384. DATA "Congratulations, you saved the planet!"
  385. DATA "EOF3"
  386.  
  387.  
  388. SUB alienattack (ialiencol)
  389.     z2alienfire = TIMER
  390.  
  391.     i3 = INT(RND * 10)
  392.     FOR i = 1 TO imaxalienmissiles
  393.         IF ia(i) = 0 THEN
  394.             FOR i2 = imaxalienforce TO 1 STEP -1
  395.                 IF RTRIM$(a(i2)) <> "" THEN
  396.                     IF MID$(matrix(i2), i3 + 1, 1) <> "0" THEN
  397.                         i4 = INSTR(i3 * 7 + 1, a(i2), CHR$(79)) + ialiencol
  398.                         EXIT FOR
  399.                     END IF
  400.                 END IF
  401.             NEXT i2
  402.             IF i4 <> 0 THEN
  403.                 ia(i) = (ileadingmax - (imaxalienforce - i2) * 2) * 80 + i4
  404.                 EXIT FOR
  405.             END IF
  406.         END IF
  407.     NEXT i
  408.  
  409.  
  410. SUB alienmissile (iresults)
  411.     irow = CSRLIN: icol = POS(0)
  412.     FOR i = 1 TO imaxalienmissiles
  413.         IF ia(i) <> 0 THEN
  414.             IF iy(i) = 0 THEN
  415.                 iy(i) = ia(i) \ 80: ix(i) = ia(i) MOD 80
  416.                 IF ix(i) = 0 THEN ix(i) = screenwidth%
  417.             END IF
  418.             LOCATE iy(i) + 1, ix(i)
  419.             COLOR 6, ibk
  420.             IF CSRLIN <= 24 THEN
  421.                 IF CSRLIN = 24 THEN IF SCREEN(CSRLIN, ix(i)) <> 32 THEN iresults = -1
  422.                 PRINT CHR$(25);
  423.             ELSE
  424.                 ia(i) = 0
  425.                 LOCATE iy(i), ix(i)
  426.                 PRINT " ";: iy(i) = 0
  427.                 ia(i) = 0
  428.                 LOCATE irow, icol
  429.                 EXIT SUB
  430.             END IF
  431.             LOCATE iy(i), ix(i): PRINT " ";
  432.             iy(i) = iy(i) + 1
  433.         END IF
  434.     NEXT
  435.     LOCATE irow, icol
  436.  
  437.  
  438. SUB checkcollision (ihitaliens, ialiencol, i4, i)
  439.     ihitaliens = 0
  440.     IF ileadingmax MOD 2 = bullet%(i) MOD 2 THEN
  441.         i4 = imaxalienforce - (ileadingmax - bullet%(i)) \ 2
  442.         IF bullet%(i) <= ileadingrow AND i4 > 0 AND i4 <= imaxalienforce THEN
  443.             IF RTRIM$(a(i4)) <> "" THEN
  444.                 IF bulletcol%(i) >= iltalien(i4) AND bulletcol%(i) - ialiencol <= LEN(RTRIM$(a(i4))) THEN
  445.                     IF MID$(a(i4), bulletcol%(i) - ialiencol, 1) > CHR$(32) THEN
  446.                         ihitaliens = bulletcol%(i) - ialiencol + 1
  447.                         i3 = ihitaliens - 7 + 1
  448.                         IF i3 < 1 THEN i3 = 1: REM count from the "<" symbol.
  449.                         i2 = INSTR(i3 + 1, a(i4), "^" + CHR$(79)) - 1
  450.                         i2 = INSTR(i3 + 1, a(i4), CHR$(79)) - 2
  451.                         MID$(a(i4), i2, 7) = SPACE$(7)
  452.                         MID$(matrix(i4), (i2 + 1) \ 7 + 1, 1) = "0"
  453.                     END IF
  454.                 END IF
  455.             END IF
  456.         END IF
  457.     END IF
  458.  
  459.     FOR i2 = 1 TO imaxalienmissiles
  460.         IF ia(i2) <> 0 THEN
  461.             IF iy(i2) >= bullet%(i) AND ix(i2) = bulletcol%(i) THEN
  462.                 ihitaliens = -i2
  463.                 EXIT FOR
  464.             END IF
  465.         END IF
  466.     NEXT
  467.  
  468.  
  469. SUB instructions
  470.     IF in$ = "" THEN
  471.         LOCATE 3, 3, 1, 7, 0: COLOR 6, ibk
  472.         _DELAY 2
  473.         DO
  474.             READ in$
  475.             IF MID$(in$, 1, 3) = "EOF" THEN EXIT DO
  476.             FOR i = 1 TO LEN(in$)
  477.                 SOUND 400, .06
  478.                 LOCATE , 2 + i
  479.                 PRINT MID$(in$, i, 1);
  480.                 z = TIMER
  481.                 DO
  482.                     IF ABS(z - TIMER) > .06 THEN EXIT DO
  483.                 LOOP
  484.             NEXT
  485.             LOCATE , , 0, 7, 0
  486.             _DELAY 1
  487.             PRINT
  488.             LOCATE , 3
  489.         LOOP
  490.         _DELAY .75
  491.     END IF
  492.  
  493.     IF in$ = "EOF" THEN
  494.         COLOR 7, 0
  495.         FOR i = 0 TO 19 ' Blank out intro message space.
  496.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  497.         NEXT
  498.         FOR i = 3 TO 24
  499.             LOCATE i, 80: PRINT CHR$(179);
  500.         NEXT
  501.         LOCATE 21, 2: PRINT STRING$(screenwidth%, " ");
  502.         LOCATE 22, 1: PRINT CHR$(179);
  503.         LOCATE 22, 80: PRINT CHR$(179);
  504.         LOCATE 22, 2: PRINT STRING$(screenwidth%, " ");
  505.     ELSE
  506.         COLOR 0, 3
  507.     END IF
  508.  
  509.     IF in$ <> "EOF2" AND iresults <> iwin THEN COLOR 0 + 16, 3 ELSE COLOR 0, 3
  510.     yy% = CSRLIN: xx% = POS(0)
  511.     LOCATE 25, 68: PRINT "Score ";
  512.     COLOR 0, 3
  513.     PRINT score$;
  514.     LOCATE yy%, xx%
  515.  
  516.     PCOPY 0, 3: REM save skin
  517.  
  518.  
  519. SUB marchdown (ialiencol, ialiencolstat, imotion, iresults)
  520.     COLOR 6, ibk
  521.     ileadingrow = ileadingrow + 1
  522.     ileadingmax = ileadingmax + 1
  523.     COLOR 6, ibk
  524.     FOR i = 1 TO imaxalienforce
  525.         REM SOUND 400, .2 ' Level down.
  526.         IF RTRIM$(a(i)) <> "" THEN
  527.             ialiencol = ialiencolstat + imotion
  528.             LOCATE ileadingmax - (imaxalienforce * 2) + i * 2 - 1, lmargin%
  529.             PRINT STRING$(screenwidth%, " ")
  530.             LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2
  531.             iltalien(i) = POS(0)
  532.             PRINT LTRIM$(RTRIM$(a(i)))
  533.         END IF
  534.     NEXT
  535.     LOCATE irow, icol
  536.     level = level - .025
  537.     IF ileadingrow = 22 THEN iresults = -2 ' Aliens have landed!
  538.  
  539. SUB movealiens (ialiencol, ialiencolstat, iresults)
  540.     STATIC imotion, imarch, imotiondir
  541.  
  542.     SOUND 800, .1: SOUND 200, .33 ' Marching sound.
  543.  
  544.     IF inextrnd = -1 THEN inextrnd = 0: imotion = 0: imarch = 0: imotiondir = 0
  545.     irow = CSRLIN: icol = POS(0)
  546.     yy% = CSRLIN: xx% = POS(0)
  547.     PCOPY 0, 1: SCREEN 0, 0, 1, 0: LOCATE yy%, xx%, 0, 7, 0
  548.     IF imotiondir = 0 THEN imotion = imotion - 1 ELSE imotion = imotion + 1
  549.     COLOR 6, ibk
  550.  
  551.     FOR i = imaxalienforce TO 1 STEP -1
  552.         IF RTRIM$(a(i)) <> "" THEN
  553.             FOR k = 1 TO LEN(a(i))
  554.                 k$ = MID$(a(i), k, 1)
  555.                 IF k$ = "^" THEN
  556.                     MID$(a(i), k, 1) = "-"
  557.                 ELSEIF k$ = "-" THEN
  558.                     MID$(a(i), k, 1) = "^"
  559.                 END IF
  560.             NEXT
  561.             i2 = i2 + 2
  562.             ialiencol = ialiencolstat + imotion
  563.             LOCATE ileadingmax - (imaxalienforce - i) * 2, ialiencol + INSTR(a(i), CHR$(79)) - 2
  564.             IF POS(0) = lmargin% THEN imarch = 1
  565.             iltalien(i) = POS(0)
  566.             IF imotiondir = 0 THEN
  567.                 PRINT LTRIM$(RTRIM$(a(i))); " "
  568.             ELSE
  569.                 LOCATE , POS(0) - 1
  570.                 PRINT " "; LTRIM$(RTRIM$(a(i)))
  571.             END IF
  572.             IF ialiencol + LEN(RTRIM$(a(i))) = screenwidth% THEN imarch = -1
  573.         END IF
  574.     NEXT
  575.  
  576.     IF imarch = 1 THEN imotiondir = 1: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  577.     IF imarch = -1 THEN imotiondir = 0: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  578.     IF imarch = 0 THEN
  579.         IF ABS(TIMER - z2alienfire) > firerate THEN
  580.             firerate = (INT(RND * 10) + 1) / 20
  581.             IF iwait = 0 THEN CALL alienattack(ialiencol)
  582.         END IF
  583.     ELSE
  584.         imarch = 0
  585.     END IF
  586.     PCOPY 1, 0: SCREEN 0, 0, 0, 0
  587.     LOCATE irow, icol, 1, 7, 0
  588.  
  589. SUB mship (imothership)
  590.     STATIC x%, mov%, z4, mothership$
  591.  
  592.     yy% = CSRLIN: xx% = POS(0): COLOR 6, ibk
  593.     IF imothership = -1 THEN
  594.         imothership = 1
  595.         x% = lmargin%
  596.         mothership$ = "(" + CHR$(127) + CHR$(179) + CHR$(127) + ")" 'CHR$(254) + CHR$(254) + "O" + CHR$(254) + CHR$(254)
  597.         mov% = 1
  598.     END IF
  599.  
  600.     IF ABS(TIMER - z4) > .05 THEN GOSUB mothership: z4 = TIMER
  601.     LOCATE yy%, xx%
  602.     EXIT SUB
  603.  
  604.     mothership:
  605.     IF x% + LEN(mothership$) = screenwidth% + lmargin% THEN mov% = -1 ELSE IF x% = lmargin% THEN mov% = 1
  606.     x% = x% + mov%
  607.     LOCATE topmargin%, x%
  608.     COLOR 7, 6: PRINT MID$(mothership$, 1, 1);
  609.     COLOR 14, 6: PRINT MID$(mothership$, 2, 1);
  610.     COLOR 7, 6: PRINT MID$(mothership$, 3, 1);
  611.     COLOR 14, 6: PRINT MID$(mothership$, 4, 1);
  612.     COLOR 7, 6: PRINT MID$(mothership$, 5, 1);
  613.     COLOR 7, ibk
  614.     IF x% > 1 AND mov% = 1 THEN
  615.         LOCATE , POS(0) - LEN(mothership$) - 1: PRINT " ";
  616.     END IF
  617.     IF mov% = -1 THEN PRINT " ";
  618.     RETURN
  619.  
  620.  
  621. DEFINT A-H, J-Z
  622. SUB qbide
  623.     PALETTE 2, 59
  624.     COLOR 15, 0
  625.     CLS
  626.  
  627.     COLOR 0, 7
  628.     LOCATE 1, 1
  629.     PRINT SPACE$(80)
  630.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  631.  
  632.     COLOR 7, 0 ' Black background.
  633.  
  634.     LOCATE 2, 1: PRINT CHR$(218)
  635.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  636.     LOCATE 2, 80: PRINT CHR$(191)
  637.  
  638.     LOCATE 2, 76: PRINT CHR$(180)
  639.     LOCATE 2, 78: PRINT CHR$(195)
  640.  
  641.     COLOR 0, 7
  642.     LOCATE 2, 77: PRINT CHR$(24)
  643.     LOCATE 2, 36: PRINT " Untitled "
  644.  
  645.     COLOR 7, 0
  646.     FOR Rows = 3 TO 24
  647.         LOCATE Rows, 1: PRINT CHR$(179);
  648.         LOCATE Rows, 80: PRINT CHR$(179);
  649.     NEXT Rows
  650.  
  651.     LOCATE 22, 1: PRINT CHR$(195)
  652.     LOCATE 22, 80: PRINT CHR$(180)
  653.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  654.     LOCATE 22, 35
  655.     PRINT " Immediate "
  656.  
  657.     COLOR 0, 7
  658.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  659.     LOCATE 21, 2: PRINT CHR$(27)
  660.     LOCATE 21, 3: PRINT CHR$(219)
  661.     LOCATE 21, 79: PRINT CHR$(26)
  662.     FOR Rows = 4 TO 19
  663.         LOCATE Rows, 80: PRINT CHR$(176)
  664.     NEXT Rows
  665.     LOCATE 3, 80: PRINT CHR$(24)
  666.     LOCATE 4, 80: PRINT CHR$(219)
  667.     LOCATE 20, 80: PRINT CHR$(25)
  668.  
  669.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  670.     LOCATE 25, 59: PRINT SPACE$(4);
  671.     COLOR 0, 3
  672.     LOCATE 25, 63: PRINT CHR$(179);
  673.     LOCATE 25, 64: PRINT SPACE$(6);
  674.     LOCATE 25, 68: PRINT "C  00001:001 ";
  675.  
  676.  
  677. DEFSNG A-H, J-Z
  678. SUB reprintaliens (ialiencol, ihitaliens, iresults, i4, i, imothership)
  679.     IF ihitaliens > 0 THEN
  680.         ihits = ihits + 1
  681.  
  682.         SELECT CASE iresults + 1
  683.             CASE 1: score$ = LTRIM$(STR$(VAL(score$) + 150))
  684.             CASE 2: score$ = LTRIM$(STR$(VAL(score$) + 250))
  685.             CASE 3: score$ = LTRIM$(STR$(VAL(score$) + 350))
  686.         END SELECT
  687.  
  688.         score$ = STRING$(6 - LEN(score$), "0") + score$
  689.         IF (ihits + 15) MOD 20 = 0 AND imothership = 0 THEN imothership = -1
  690.         LOCATE bullet%(i), lmargin%: PRINT SPACE$(screenwidth%);
  691.         iltalien(i4) = POS(0)
  692.  
  693.         IF RTRIM$(a(i4)) = "" THEN
  694.             alienforce% = alienforce% - 1
  695.             IF alienforce% = 0 THEN iresults = iresults + 1 ' Level completed. Goto to next level.
  696.             IF bullet%(i) = ileadingrow THEN ileadingrow = ileadingrow - 2
  697.         ELSE
  698.             LOCATE bullet%(i), ialiencol + INSTR(a(i4), CHR$(79)) - 2
  699.             PRINT LTRIM$(RTRIM$(a(i4)))
  700.         END IF
  701.     ELSE
  702.         i2 = ABS(ihitaliens)
  703.         LOCATE iy(i2), ix(i2)
  704.         PRINT " ";: iy(i2) = 0
  705.         ia(i2) = 0
  706.         LOCATE irow, icol
  707.         SOUND 1000, .5
  708.     END IF
  709.  
  710.     ihitaliens = 0
  711.     bullet%(i) = -bullet%(i)
  712.  
  713.     COLOR 0, 3
  714.     yy% = CSRLIN: xx% = POS(0)
  715.     LOCATE 25, 74: PRINT score$;
  716.     LOCATE yy%, xx%
  717.     COLOR 6, ibk
  718.  
  719.  
  720. SUB qbideOrig
  721.     PALETTE 2, 59
  722.     COLOR 15, 1
  723.     CLS
  724.  
  725.     COLOR 0, 7
  726.     LOCATE 1, 1
  727.     PRINT SPACE$(80)
  728.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  729.  
  730.     COLOR 7, 1
  731.  
  732.     LOCATE 2, 1: PRINT CHR$(218)
  733.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  734.     LOCATE 2, 80: PRINT CHR$(191)
  735.  
  736.     LOCATE 2, 76: PRINT CHR$(180)
  737.     LOCATE 2, 78: PRINT CHR$(195)
  738.  
  739.     COLOR 1, 7
  740.     LOCATE 2, 77: PRINT CHR$(24)
  741.     LOCATE 2, 36: PRINT " Untitled "
  742.  
  743.     COLOR 7, 1
  744.     FOR Rows = 3 TO 24
  745.         LOCATE Rows, 1: PRINT CHR$(179);
  746.         LOCATE Rows, 80: PRINT CHR$(179);
  747.     NEXT Rows
  748.  
  749.     LOCATE 22, 1: PRINT CHR$(195)
  750.     LOCATE 22, 80: PRINT CHR$(180)
  751.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  752.     LOCATE 22, 35
  753.     PRINT " Immediate "
  754.  
  755.     COLOR 0, 7
  756.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  757.     LOCATE 21, 2: PRINT CHR$(27)
  758.     LOCATE 21, 3: PRINT CHR$(219)
  759.     LOCATE 21, 79: PRINT CHR$(26)
  760.     FOR Rows = 4 TO 19
  761.         LOCATE Rows, 80: PRINT CHR$(176)
  762.     NEXT Rows
  763.     LOCATE 3, 80: PRINT CHR$(24)
  764.     LOCATE 4, 80: PRINT CHR$(219)
  765.     LOCATE 20, 80: PRINT CHR$(25)
  766.  
  767.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  768.     LOCATE 25, 59: PRINT SPACE$(4);
  769.     COLOR 0, 3
  770.     LOCATE 25, 63: PRINT CHR$(179);
  771.     LOCATE 25, 64: PRINT SPACE$(6);
  772.     LOCATE 25, 68: PRINT "C  00001:001 ";
  773.  
  774.  
  775. SUB TheBOB
  776.     SCREEN _NEWIMAGE(800, 600, 256)
  777.     WIDTH 80, 25
  778.  
  779.     OUT &H3C8, 1: OUT &H3C9, 40: OUT &H3C9, 12: OUT &H3C9, 0
  780.     OUT &H3C8, 2: OUT &H3C9, 6: OUT &H3C9, 12: OUT &H3C9, 0
  781.     OUT &H3C8, 3: OUT &H3C9, 30: OUT &H3C9, 8: OUT &H3C9, 0
  782.     OUT &H3C8, 4: OUT &H3C9, 3: OUT &H3C9, 8: OUT &H3C9, 0
  783.     OUT &H3C8, 7: OUT &H3C9, 63: OUT &H3C9, 0: OUT &H3C9, 0
  784.     OUT &H3C8, 8: OUT &H3C9, 46: OUT &H3C9, 0: OUT &H3C9, 0
  785.     OUT &H3C8, 9: OUT &H3C9, 63: OUT &H3C9, 63: OUT &H3C9, 63
  786.     OUT &H3C8, 12: OUT &H3C9, 20: OUT &H3C9, 20: OUT &H3C9, 20
  787.     OUT &H3C8, 13: OUT &H3C9, 0: OUT &H3C9, 0: OUT &H3C9, 0
  788.     OUT &H3C8, 14: OUT &H3C9, 55: OUT &H3C9, 35: OUT &H3C9, 0
  789.  
  790.     CIRCLE (320, 240), 100, 3, , , .9
  791.     PAINT (320, 240), 3
  792.     CIRCLE (320, 230), 90, 1, , , .9
  793.     PAINT (320, 230), 1
  794.  
  795.     FOR Reps = 1 TO 4
  796.         SELECT CASE Reps
  797.             DATA 1,1.2,1.8,5
  798.             CASE 1: Elipse = 1
  799.             CASE 2: Elipse = 1.2
  800.             CASE 3: Elipse = 1.8
  801.             CASE 4: Elipse = 5
  802.         END SELECT
  803.         FOR E = Elipse TO Elipse + .1 STEP .01
  804.             CIRCLE (320, 240), 100, 3, , , E
  805.         NEXT E
  806.     NEXT Reps
  807.     FOR Radius = 38 TO 43
  808.         CIRCLE (320, 160), Radius, 3, , , .4
  809.     NEXT Radius
  810.     CIRCLE (320, 160), 40, 14, 3.3, 6, .4
  811.     CIRCLE (320, 240), 100, 5, , , .9
  812.     PAINT (0, 0), 5
  813.     CIRCLE (320, 240), 100, 0, , , .9
  814.     PAINT (0, 0), 0
  815.     FOR Radius = 12 TO 18
  816.         CIRCLE (320, 153), Radius, 2, , , .3
  817.     NEXT Radius
  818.  
  819.     CIRCLE (320, 150), 12, 2, , , .6
  820.     PAINT STEP(0, 0), 2
  821.     CIRCLE (300, 143), 32, 2, 6, 1.1
  822.     CIRCLE (276, 143), 32, 2, 6, .6
  823.     DRAW "BM302,125 C2 M+15,-10 BD10 P2,2"
  824.     PAINT (320, 145), 2
  825.     CIRCLE (282, 143), 32, 4, 6, .73
  826.     CIRCLE (266, 156), 60, 4, .1, .68
  827.     CIRCLE (320, 150), 12, 4, 3.14159, 0, .2
  828.     DRAW "BM302,125 C4 M+15,-10 BD10"
  829.     CIRCLE (276, 143), 32, 4, 6, .6
  830.     PAINT STEP(35, 0), 4
  831.     'Face begins
  832.     CIRCLE (303, 316), 100, 14, 1.5, 2
  833.     CIRCLE (337, 316), 100, 14, 1.1, 1.64
  834.     PSET (310, 215), 14
  835.     DRAW "H30 M-20,+40 M+12,-4 M+14,-29 BL2 P14,14 BF12 P15,14"
  836.     PSET (330, 215), 14
  837.     DRAW "E30 M+20,+40 M-12,-4 M-14,-29 BR2 P14,14 BG12 P15,14"
  838.     PSET (320, 246), 14
  839.     DRAW "R20 H20 G20 R20 U nL19 nR19 BU2 P15,14"
  840.     CIRCLE (320, 170), 100, 14, 3.8, 4.1
  841.     CIRCLE (320, 170), 100, 14, 4.42, 5.01
  842.     CIRCLE (320, 170), 100, 14, 5.33, 5.62
  843.     CIRCLE (320, 220), 80, 14, 3.29, 4.5
  844.     CIRCLE (320, 220), 80, 14, 4.66, 6.15
  845.     PSET (260, 250), 14
  846.     DRAW "D10 F8 U13 M+10,+5 D12 M+12,+6 U12 BR60"
  847.     DRAW "D12 M+12,-6 U12 M+10,-5 D13 E8 U10"
  848.     PSET (300, 297), 14
  849.     DRAW "U14 R16 D16"
  850.     CIRCLE (320, 212), 80, 14, 3.42, 4.5
  851.     CIRCLE (320, 212), 80, 14, 4.66, 6
  852.     LINE (300, 280)-(316, 283), 14, BF
  853.     PAINT (320, 296), 14
  854.     PAINT (290, 292), 14
  855.     PAINT (300, 278), 15, 14
  856.     CIRCLE (100, 240), 32, 13
  857.     PAINT STEP(0, 0), 13
  858.  
  859.     FOR x% = 58 TO 142
  860.         FOR y% = 198 TO 282
  861.             IF POINT(x%, y%) = 13 THEN
  862.                 IF POINT(x% + 220, y%) = 15 THEN PSET (x% + 220, y%), 9
  863.             END IF
  864.         NEXT y%
  865.     NEXT x%
  866.  
  867.     COLOR 13: LOCATE 1, 1: PRINT "HAPPY HALLOWEEN!"
  868.  
  869.     xx = 64: yy = 360 - 330
  870.     FOR x% = 0 TO 300
  871.         FOR y% = 0 TO 16
  872.             IF POINT(x%, y%) = 13 THEN
  873.                 IF y% > 6 THEN Colr = 8 ELSE Colr = 7
  874.                 LINE (x% * 4 + xx, y% * 4 + yy)-(x% * 4 + xx + 3, y% * 4 + yy + 3), Colr, BF
  875.             END IF
  876.         NEXT y%
  877.     NEXT x%
  878.     FOR x% = 0 TO 639
  879.         IF POINT(x%, 368) <> 0 THEN PSET (x%, 368), 14
  880.     NEXT x%
  881.  
  882.     z1 = TIMER
  883.     DO UNTIL ABS(TIMER - z1) > 4
  884.         FOR Reps = 1 TO 3
  885.             WAIT &H3DA, 8
  886.             WAIT &H3DA, 8, 8
  887.         NEXT Reps
  888.  
  889.         Flicker = FIX(RND * 20)
  890.         OUT &H3C8, 14
  891.         OUT &H3C9, 40 + Flicker
  892.         OUT &H3C9, 25 + Flicker
  893.         OUT &H3C9, 10 + Flicker
  894.  
  895.         OUT &H3C8, 15
  896.         OUT &H3C9, 43 + Flicker
  897.         OUT &H3C9, 38 + Flicker
  898.         OUT &H3C9, 20 + Flicker
  899.     LOOP
  900.     SCREEN 0, 0, 0, 0

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

If @johnno56 likes it, I'll add save high score routine.

Pete
Title: Re: Competition
Post by: jack on October 13, 2021, 04:34:30 pm
not bad Pete, actually quite good
Title: Re: Competition
Post by: Pete on October 13, 2021, 04:48:27 pm
not bad Pete, actually quite good

Thanks! I just edited in a "Great Pumpkin" rendition of the mother ship. I think it's about as Halloweenie as it can get now. Maybe same time I can get a couple more screen flashes for a missile to missile collision, and a firing time-out if that collision is too close to the tank. I think it could also use a couple more sound effects, but that's not something I'm well versed at. It was great having TheBOB toss his pumpkin in the ring, along with his .oog files for the thunder effect. Oh, that reminds me, I should update the post to include the .oog file download...

Pete
Title: Re: Competition
Post by: Dav on October 13, 2021, 07:06:54 pm
Nice one, Pete!  Plays great.

- Dav
Title: Re: Competition
Post by: Pete on October 13, 2021, 07:45:02 pm
@Dav Thanks! I wish I had your abillty with sound effects. Any idea if SOUND can produce a "gloop" noise? I should probably start messing with PLAY and figure out some rendition for the Great Pumpkin mother ship while it's on the screen, too.

I just did another edit to make TheBOB's pumpkin animation more seamless. Maybe you guys have a better way, but it looks like by using...

    SCREEN _NEWIMAGE(800, 600, 256)
    WIDTH 80, 25

... for the graphics part, I can keep the screen from stretching, as it did when it was going from SCREEN 0 to SCREEN 12.

Pete
Title: Re: Competition
Post by: Dav on October 13, 2021, 08:36:12 pm
Hmm, I don't have a GLOOP code on hand, I'll look for something if you want.  I had a whole folder of SOUND effect codes on a drive somewhere.

Lol, that EM pulse knocked out all the bats.  They just froze all the sudden and I picked them off easy and moved around freely all alone for a while.

- Dav

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Competition
Post by: Pete on October 13, 2021, 08:52:50 pm
What you just described I have not experienced. The bats are never supposed to freeze. The missiles still on the screen after the last bat is shot always happens. If I recall right, a missile heading for your tank, after all the bats are gone, can still blow your tank up. The next level begins when the missiles complete their flight.

I'll look up some stuff and see what I can come up with for a gloop sound.

Pete
Title: Re: Competition
Post by: Dav on October 13, 2021, 08:59:24 pm
It only happened once for me.  My bullets would just clear the characters off the screen when going up, not a whole bat, just pieces.  Happened towards near the end of a wave of bats. 

- Dav
Title: Re: Competition
Post by: Pete on October 13, 2021, 09:17:39 pm
Hmmm, some glitch in the redraw part. I'll have a look, but this one looks like it will be hard to reproduce.

Thanks!

Pete
Title: Re: Competition
Post by: bplus on October 14, 2021, 11:50:06 am
Very nice work Pete. Kind of surprised it's not pure Screen 0 from our Hero but always great to see TheBobs marvelous graphics!

Could you post code in it's own thread in Programs board for further updates if any, plus, comments and feedback  related to that code. This is to help Librarians track things. It's a huge help for code postings to have an anchor thread in Programs Board. I think the Discussion Boards threads eventually get Locked up for new comments or updates...

I like how you have the bats flapping their wings now. If you get the code up in Programs Board, I have a question about TheBob's code.
Title: Re: Competition
Post by: bplus on October 14, 2021, 11:56:22 am
Also: If code is posted in their own thread in Programs Board, we can use what non participating contest forum members say for help breaking ties.

Title: Re: Competition
Post by: Pete on October 16, 2021, 10:53:41 pm
This version saves the top 5 highest scores.

To Play:

Use the alt key to move and fire. When you release the alt key, your tank will stop. When you press alt again, your tank will ove in the opposite direction.

Shoot all invaders before they shoot you. Bonus points for shooting the mother ship.

If invaders get a couple rows above your tank, they land and you die.

To win, you must complete all 3 levels.

If you get a top 5 high score, you get to enter your initials. To do so, follow these instructions.

Tap the alt key to display initials A-Z. Stop tapping when your initial appears. Wait 2-seconds and it will be auto-input. If you goofed, hold down the alt key while waiting. It will allow you to redo input from start.

When you input your 3rd and last initial, all your initials will begin to flash for 2.5 seconds, and then they will be recorded. If you goofed, press the alt key within the 2.5 second time period, and you will be able to redo input from start.

WARNING: This routine makes and overwrites a file in your local folder named: ascii-invaders-high-score.dat

Code: QB64: [Select]
  1.  
  2. DIM SHARED intro%: intro% = -1
  3.  
  4. skip_intro:
  5. title$ = "ASCII Invaders / Halloween Edition"
  6. _TITLE title$
  7. DIM SHARED Overlay, font, soundfile%, t1&, t2&, t3&, t4&, t5&, t6&, t7&, t8&
  8. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  9. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits, score$
  10.  
  11. SCREEN 0, 0, 0, 0
  12. swidth = _WIDTH
  13.  
  14. score$ = "000000"
  15. imaxalienforce = 6
  16. imaxalienmissiles = 3
  17. lmargin% = 2
  18. rmargin% = 79
  19. topmargin% = 3
  20. ialiencolstat = 6
  21. iwin = 3 ' 3 Levels.
  22. screenwidth% = rmargin% - lmargin% + 1
  23. ibk = 0 ' Background color
  24.  
  25. DIM SHARED a(imaxalienforce) AS STRING * 68
  26.  
  27. 'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.
  28. 'font& = _LOADFONT(fontpath$, 25, "monospace")
  29. '_FONT font&
  30.  
  31. REM Make aliens
  32. a1$ = "^^" + CHR$(79) + "^^  "
  33. a$ = a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$ + a1$
  34. alt1$ = "--" + CHR$(79) + "--  "
  35. a$ = a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$
  36. alt$ = alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$ + alt1$ + a1$
  37.  
  38. IF intro% THEN
  39.     SCREEN 0, 0, 1, 1
  40.     CALL qbideOrig
  41.  
  42.     SCREEN 0, 0, 2, 0
  43.     CALL qbide
  44.  
  45.     CALL thunder
  46.  
  47.     CALL TheBOB
  48.  
  49.     '_FREEFONT font&
  50.     'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.
  51.     'font& = _LOADFONT(fontpath$, 25, "monospace")
  52.     '_FONT font&
  53.  
  54.     CALL qbide
  55.  
  56.     SCREEN 0, 0, 2, 0
  57.  
  58.     CALL qbide
  59.  
  60.     CALL thunder
  61.  
  62.  
  63. IF intro% = -1 THEN RESTORE first_play ELSE RESTORE replay
  64.  
  65. CALL instructions
  66.  
  67.     IF inextrnd = -1 THEN PCOPY 3, 0
  68.     tank$ = CHR$(218) + CHR$(127) + CHR$(191): icolor = 6
  69.     REDIM SHARED bullet%(5), bulletcol%(5), bulletdelay%(5), iltalien(imaxalienforce)
  70.     REDIM SHARED ia(imaxalienmissiles), iy(imaxalienmissiles), ix(imaxalienmissiles)
  71.     REDIM SHARED matrix(imaxalienforce) AS STRING * 10
  72.     alienforce% = imaxalienforce
  73.     level = .65
  74.     iround = iround + 1
  75.     level = level - iround / 15
  76.     inextrnd = -1
  77.     COLOR 6, ibk
  78.  
  79.     REM Set up aliens
  80.     ialiencol = ialiencolstat
  81.     LOCATE 2, ialiencol
  82.     FOR i = 1 TO imaxalienforce
  83.         IF i MOD 1 = 0 THEN PRINT
  84.         LOCATE , ialiencol
  85.         IF i = imaxalienforce THEN
  86.             ileadingrow = CSRLIN: ileadingmax = ileadingrow
  87.         END IF
  88.         IF i \ 2 = i / 2 THEN a(i) = a$ ELSE a(i) = alt$
  89.         PRINT a(i)
  90.     NEXT
  91.  
  92.     COLOR 0 + 16, 3
  93.     LOCATE 25, 68: PRINT "Score ";
  94.     COLOR 0, 3
  95.     PRINT score$;
  96.     COLOR 6, ibk
  97.  
  98.     REM Station
  99.     LOCATE 24, 40
  100.     tanky% = CSRLIN: tankx% = POS(0) + 1
  101.     PRINT tank$;: LOCATE , POS(0) - 2
  102.  
  103.     _DELAY 1
  104.  
  105.     DO
  106.         z1 = TIMER
  107.         DO
  108.             IF zbonus THEN
  109.                 IF ABS(zbonus - TIMER) > 1.5 THEN
  110.                     yy% = CSRLIN: xx% = POS(0)
  111.                     COLOR 6, 0: LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  112.                     LOCATE yy%, xx%
  113.                     zbonus = 0
  114.                 END IF
  115.             END IF
  116.  
  117.             IF topmargin% + ileadingmax - (imaxalienforce * 2) >= topmargin% + 2 THEN
  118.                 IF imothership <> 0 THEN CALL mship(imothership)
  119.             END IF
  120.             IF ABS(TIMER - z1aliens) > level THEN
  121.                 CALL movealiens(ialiencol, ialiencolstat, iresults)
  122.                 z1aliens = TIMER
  123.             END IF
  124.             IF iresults < 0 THEN EXIT DO
  125.             IF ABS(TIMER - z1ia) > .3 THEN CALL alienmissile(iresults): z1ia = TIMER
  126.  
  127.             DEF SEG = 0
  128.             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  129.                 key$ = CHR$(32) ' Alt
  130.             ELSE
  131.                 key$ = ""
  132.             END IF
  133.             DEF SEG
  134.  
  135.             SELECT CASE key$
  136.                 CASE CHR$(32)
  137.                     IF flag = 0 THEN switch = switch * -1 - 1: flag = -1
  138.                     SELECT CASE switch
  139.                         CASE 0
  140.                             IF ABS(z9 - TIMER) > .15 THEN
  141.                                 IF POS(0) < screenwidth% THEN COLOR icolor, ibk: LOCATE , POS(0) - 1: PRINT " " + tank$;: LOCATE , POS(0) - 2
  142.                                 tanky% = CSRLIN: tankx% = POS(0)
  143.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  144.                                 z9 = TIMER
  145.                             END IF
  146.                         CASE -1
  147.                             IF ABS(z9 - TIMER) > .15 THEN
  148.                                 IF POS(0) > lmargin% + 1 THEN COLOR icolor, ibk: LOCATE , POS(0) - 2: PRINT tank$ + " ";: LOCATE , POS(0) - 3
  149.                                 tanky% = CSRLIN: tankx% = POS(0)
  150.                                 IF SCREEN(tanky%, tankx% - 2) = 25 OR SCREEN(tanky%, tankx% + 2) = 25 THEN result = -1: EXIT DO
  151.                                 z9 = TIMER
  152.                             END IF
  153.                     END SELECT
  154.                     IF icolor = 6 THEN
  155.                         FOR i2 = 1 TO 5
  156.                             IF bullet%(i2) = 0 THEN
  157.                                 icolor = 12: COLOR icolor, ibk: GOSUB redraw
  158.                                 bullet%(i2) = -1: reload = TIMER: EXIT FOR
  159.                             END IF
  160.                         NEXT
  161.                     END IF
  162.                 CASE ""
  163.                     IF flag THEN skip = 0: flag = 0
  164.                 CASE CHR$(27): SYSTEM
  165.             END SELECT
  166.  
  167.             IF ABS(z1 - reload) > .6 AND reload <> 0 THEN
  168.                 GOSUB redraw
  169.                 icolor = 6: reload = 0
  170.             END IF
  171.  
  172.             REM Fire
  173.             FOR i = 1 TO 5
  174.                 SELECT CASE bullet%(i)
  175.                     CASE -1: bullet%(i) = tanky% - 1: bulletcol%(i) = tankx%
  176.                     CASE IS > 0
  177.                         IF bulletdelay%(i) = -1 OR bullet%(i) = tanky% - 1 THEN
  178.                             CALL checkcollision(ihitaliens, ialiencol, i4, i)
  179.                             z2bullet = TIMER: bulletdelay%(i) = 0
  180.                             COLOR 6, ibk
  181.                             LOCATE bullet%(i), bulletcol%(i)
  182.                             IF bullet%(i) = topmargin% AND imothership <> 0 THEN ' Hit mother ship.
  183.                                 IF SCREEN(ABS(bullet%(i)), bulletcol%(i)) <> 32 THEN
  184.                                     SOUND 1000, .75
  185.                                     SELECT CASE iresults + 1
  186.                                         CASE 1: bonus = 1500
  187.                                         CASE 2: bonus = 2500
  188.                                         CASE 3: bonus = 5000
  189.                                     END SELECT
  190.                                     score$ = LTRIM$(STR$(VAL(score$) + bonus))
  191.                                     score$ = STRING$(6 - LEN(score$), "0") + score$
  192.                                     yy% = CSRLIN: xx% = POS(0)
  193.                                     SOUND 800, .5: SOUND 1600, .5: SOUND 2400, .5
  194.                                     LOCATE topmargin%, lmargin%: PRINT SPACE$(screenwidth%);
  195.                                     kbonus = bulletcol%(i) - 4
  196.                                     IF kbonus < lmargin% THEN kbonus = lmargin%
  197.                                     IF kbonus + 10 > screenwidth% THEN kbonus = screenwidth% - 11
  198.                                     zbonus = TIMER
  199.                                     LOCATE yy%, xx%
  200.                                     imothership = 0
  201.                                 END IF
  202.                             END IF
  203.                             PRINT CHR$(24) ' Tank missile.
  204.                             IF CSRLIN <> 24 THEN LOCATE , bulletcol%(i): PRINT " ";
  205.                             IF ihitaliens <> 0 THEN CALL reprintaliens(ialiencol, ihitaliens, iresults, i4, i, imothership)
  206.                             LOCATE tanky%, tankx%
  207.                             IF bullet%(i) > topmargin% THEN
  208.                                 bullet%(i) = bullet%(i) - 1
  209.                             ELSE
  210.                                 GOSUB erasebullet
  211.                             END IF
  212.  
  213.                             IF zbonus THEN
  214.                                 yy% = CSRLIN: xx% = POS(0)
  215.                                 LOCATE topmargin%, kbonus: COLOR 2 + 16: PRINT "BONUS " + LTRIM$(STR$(bonus));
  216.                                 LOCATE yy%, xx%
  217.                             END IF
  218.  
  219.                         END IF
  220.                 END SELECT
  221.             NEXT
  222.  
  223.             REM Bullet timer delay
  224.             IF z2bullet <> 0 THEN
  225.                 IF z1 < z2bullet THEN z2bullet = z2bullet - 86400
  226.                 IF z1 - z2bullet >= .06 THEN
  227.                     FOR i2 = 1 TO 5
  228.                         IF bullet%(i2) <> 0 THEN bulletdelay%(i2) = -1
  229.                     NEXT i2
  230.                 END IF
  231.                 EXIT DO
  232.             END IF
  233.         LOOP
  234.         IF iresults < 0 THEN EXIT DO
  235.         IF alienforce% = 0 OR iresults = iwin THEN
  236.             FOR i = 1 TO imaxalienmissiles
  237.                 IF ia(i) <> 0 THEN EXIT FOR
  238.             NEXT
  239.             IF i > imaxalienmissiles THEN iwait = -1
  240.             IF iwait = -1 THEN
  241.                 EXIT DO
  242.             END IF
  243.         ELSE
  244.             iwait = 1
  245.         END IF
  246.     LOOP
  247.  
  248.     IF iresults = iwin OR iresults < 0 THEN
  249.         REM end game
  250.         EXIT DO
  251.     END IF
  252.     inextrnd = -1
  253.  
  254. SELECT CASE iresults
  255.     CASE -1 ' Tank destroyed!
  256.         SOUND 800, .3: SOUND 250, 1
  257.  
  258.         FOR i = 1 TO 5
  259.             COLOR 14, 4
  260.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  261.             _DELAY .1
  262.  
  263.             COLOR 8, ibk
  264.             LOCATE tanky%, tankx% - 1: PRINT tank$;
  265.             _DELAY .1
  266.         NEXT
  267.  
  268.         COLOR 6, ibk
  269.         LOCATE tanky% - 1, lmargin%
  270.         PRINT SPACE$(screenwidth%);
  271.         LOCATE tanky%, lmargin%
  272.         PRINT SPACE$(screenwidth%);
  273.  
  274.         _DELAY .5
  275.  
  276.         LOCATE 3, 3
  277.         COLOR 8, 0
  278.         FOR i = 1 TO 20
  279.             LOCATE i + 2, 2
  280.             FOR j = 1 TO _WIDTH - 2
  281.                 PRINT CHR$(SCREEN(CSRLIN, POS(0)));
  282.             NEXT
  283.         NEXT
  284.         COLOR 6, 0
  285.  
  286.         _DELAY 2
  287.  
  288.         CALL displayhighscores
  289.  
  290.         CALL qbide
  291.  
  292.     CASE -2 ' Aliens have landed!
  293.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  294.  
  295.         COLOR 7, 0
  296.         FOR i = 0 TO 21 ' Blank out screen.
  297.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  298.         NEXT
  299.  
  300.         COLOR 6, ibk
  301.         LOCATE tanky% - 1, lmargin%
  302.         PRINT SPACE$(screenwidth%);
  303.         LOCATE tanky%, lmargin%
  304.         PRINT SPACE$(screenwidth%);
  305.  
  306.         COLOR 8, ibk
  307.  
  308.         FOR j = imaxalienforce TO 1 STEP -1
  309.             IF a(j) <> "" THEN EXIT FOR
  310.         NEXT
  311.  
  312.         FOR i = j TO 1 STEP -1
  313.             IF INSTR(a(i), CHR$(79)) THEN
  314.                 LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2
  315.                 PRINT LTRIM$(RTRIM$(a(i)));
  316.                 LOCATE CSRLIN - 2
  317.             END IF
  318.         NEXT
  319.  
  320.         _DELAY 2.5
  321.  
  322.         CALL displayhighscores
  323.  
  324.         CALL qbide
  325.  
  326.     CASE ELSE ' Winner.
  327.  
  328.         l$ = "4"
  329.         n$ = "n29": PLAY "L" + l$ + n$
  330.         n$ = "n24": PLAY "L" + l$ + n$
  331.         n$ = "n33": PLAY "L" + l$ + n$
  332.         n$ = "n29": PLAY "L" + l$ + n$
  333.         _DELAY .75
  334.         l$ = "7"
  335.         n$ = "n24": PLAY "L" + l$ + n$
  336.         n$ = "n28": PLAY "L" + l$ + n$
  337.         n$ = "n28": PLAY "L" + l$ + n$
  338.         l$ = "6"
  339.         n$ = "n31": PLAY "L" + l$ + n$
  340.         l$ = "8"
  341.         n$ = "n28": PLAY "L" + l$ + n$
  342.         l$ = "3"
  343.         _DELAY 1
  344.  
  345.         CALL displayhighscores
  346.  
  347.         CALL qbide
  348.  
  349.         RESTORE winner
  350.  
  351.  
  352. CALL instructions
  353.  
  354. DEF SEG = 0
  355.     _LIMIT 30
  356.     b$ = INKEY$
  357.     IF b$ = CHR$(27) THEN SYSTEM
  358.     IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN EXIT DO
  359.  
  360. RUN skip_intro
  361.  
  362. erasebullet:
  363. LOCATE ABS(bullet%(i)), bulletcol%(i): PRINT " ";
  364. bullet%(i) = 0: bulletcol%(i) = 0: bulletdelay%(i) = 0
  365. LOCATE tanky%, tankx%
  366.  
  367. redraw:
  368. COLOR , ibk: LOCATE tanky%, tankx% - 1: PRINT tank$;: LOCATE tanky%, tankx%: COLOR 7, ibk
  369.  
  370. first_play:
  371. DATA "The Great Pumpkin has fired an EM pulse at your computer."
  372. DATA ""
  373. DATA "All that's working is your Alt key."
  374. DATA ""
  375. replay:
  376. DATA "Loading..."
  377. DATA "EOF"
  378. DATA "Game Over. Press Alt to play again..."
  379. DATA "EOF2"
  380. winner:
  381. DATA "Congratulations, you saved the planet!"
  382. DATA ""
  383. DATA "Press Alt to play again..."
  384. DATA "EOF3"
  385.  
  386.  
  387. SUB alienattack (ialiencol)
  388.     z2alienfire = TIMER
  389.  
  390.     i3 = INT(RND * 10)
  391.     FOR i = 1 TO imaxalienmissiles
  392.         IF ia(i) = 0 THEN
  393.             FOR i2 = imaxalienforce TO 1 STEP -1
  394.                 IF RTRIM$(a(i2)) <> "" THEN
  395.                     IF MID$(matrix(i2), i3 + 1, 1) <> "0" THEN
  396.                         i4 = INSTR(i3 * 7 + 1, a(i2), CHR$(79)) + ialiencol
  397.                         EXIT FOR
  398.                     END IF
  399.                 END IF
  400.             NEXT i2
  401.             IF i4 <> 0 THEN
  402.                 ia(i) = (ileadingmax - (imaxalienforce - i2) * 2) * 80 + i4
  403.                 EXIT FOR
  404.             END IF
  405.         END IF
  406.     NEXT i
  407.  
  408.  
  409. SUB alienmissile (iresults)
  410.     irow = CSRLIN: icol = POS(0)
  411.     FOR i = 1 TO imaxalienmissiles
  412.         IF ia(i) <> 0 THEN
  413.             IF iy(i) = 0 THEN
  414.                 iy(i) = ia(i) \ 80: ix(i) = ia(i) MOD 80
  415.                 IF ix(i) = 0 THEN ix(i) = screenwidth%
  416.             END IF
  417.             LOCATE iy(i) + 1, ix(i)
  418.             COLOR 6, ibk
  419.             IF CSRLIN <= 24 THEN
  420.                 IF CSRLIN = 24 THEN IF SCREEN(CSRLIN, ix(i)) <> 32 THEN iresults = -1
  421.                 PRINT CHR$(25);
  422.             ELSE
  423.                 ia(i) = 0
  424.                 LOCATE iy(i), ix(i)
  425.                 PRINT " ";: iy(i) = 0
  426.                 ia(i) = 0
  427.                 LOCATE irow, icol
  428.                 EXIT SUB
  429.             END IF
  430.             LOCATE iy(i), ix(i): PRINT " ";
  431.             iy(i) = iy(i) + 1
  432.         END IF
  433.     NEXT
  434.     LOCATE irow, icol
  435.  
  436.  
  437. SUB checkcollision (ihitaliens, ialiencol, i4, i)
  438.     ihitaliens = 0
  439.     IF ileadingmax MOD 2 = bullet%(i) MOD 2 THEN
  440.         i4 = imaxalienforce - (ileadingmax - bullet%(i)) \ 2
  441.         IF bullet%(i) <= ileadingrow AND i4 > 0 AND i4 <= imaxalienforce THEN
  442.             IF RTRIM$(a(i4)) <> "" THEN
  443.                 IF bulletcol%(i) >= iltalien(i4) AND bulletcol%(i) - ialiencol <= LEN(RTRIM$(a(i4))) THEN
  444.                     IF MID$(a(i4), bulletcol%(i) - ialiencol, 1) > CHR$(32) THEN
  445.                         SOUND 1100, .2: SOUND 334, .1: SOUND 590, .4
  446.                         ihitaliens = bulletcol%(i) - ialiencol + 1
  447.                         i3 = ihitaliens - 7 + 1
  448.                         IF i3 < 1 THEN i3 = 1
  449.                         i2 = INSTR(i3 + 1, a(i4), "^" + CHR$(79)) - 1
  450.                         i2 = INSTR(i3 + 1, a(i4), CHR$(79)) - 2
  451.                         MID$(a(i4), i2, 7) = SPACE$(7)
  452.                         MID$(matrix(i4), (i2 + 1) \ 7 + 1, 1) = "0"
  453.                     END IF
  454.                 END IF
  455.             END IF
  456.         END IF
  457.     END IF
  458.  
  459.     FOR i2 = 1 TO imaxalienmissiles
  460.         IF ia(i2) <> 0 THEN
  461.             IF iy(i2) >= bullet%(i) AND ix(i2) = bulletcol%(i) THEN
  462.                 ihitaliens = -i2
  463.                 EXIT FOR
  464.             END IF
  465.         END IF
  466.     NEXT
  467.  
  468.  
  469. SUB instructions
  470.     IF in$ = "" THEN
  471.         LOCATE 3, 3, 1, 7, 0: COLOR 6, ibk
  472.         _DELAY 2
  473.         DO
  474.             READ in$
  475.             IF MID$(in$, 1, 3) = "EOF" THEN EXIT DO
  476.             FOR i = 1 TO LEN(in$)
  477.                 SOUND 400, .06
  478.                 LOCATE , 2 + i
  479.                 PRINT MID$(in$, i, 1);
  480.                 z = TIMER
  481.                 DO
  482.                     IF ABS(z - TIMER) > .06 THEN EXIT DO
  483.                 LOOP
  484.             NEXT
  485.             LOCATE , , 0, 7, 0
  486.             _DELAY 1
  487.             PRINT
  488.             LOCATE , 3
  489.         LOOP
  490.         _DELAY .75
  491.     END IF
  492.  
  493.     IF in$ = "EOF" THEN
  494.         COLOR 7, 0
  495.         FOR i = 0 TO 19 ' Blank out intro message space.
  496.             LOCATE topmargin% + i, lmargin%: PRINT SPACE$(screenwidth%);
  497.         NEXT
  498.         FOR i = 3 TO 24
  499.             LOCATE i, 80: PRINT CHR$(179);
  500.         NEXT
  501.         LOCATE 21, 2: PRINT STRING$(screenwidth%, " ");
  502.         LOCATE 22, 1: PRINT CHR$(179);
  503.         LOCATE 22, 80: PRINT CHR$(179);
  504.         LOCATE 22, 2: PRINT STRING$(screenwidth%, " ");
  505.     ELSE
  506.         COLOR 0, 3
  507.     END IF
  508.  
  509.     IF in$ <> "EOF2" AND iresults <> iwin THEN COLOR 0 + 16, 3 ELSE COLOR 0, 3
  510.     yy% = CSRLIN: xx% = POS(0)
  511.     LOCATE 25, 68: PRINT "Score ";
  512.     COLOR 0, 3
  513.     PRINT score$;
  514.     LOCATE yy%, xx%
  515.  
  516.     PCOPY 0, 3: REM save skin
  517.  
  518.  
  519. SUB marchdown (ialiencol, ialiencolstat, imotion, iresults)
  520.     COLOR 6, ibk
  521.     ileadingrow = ileadingrow + 1
  522.     ileadingmax = ileadingmax + 1
  523.     COLOR 6, ibk
  524.     FOR i = 1 TO imaxalienforce
  525.         REM SOUND 400, .2 ' Level down.
  526.         IF RTRIM$(a(i)) <> "" THEN
  527.             ialiencol = ialiencolstat + imotion
  528.             LOCATE ileadingmax - (imaxalienforce * 2) + i * 2 - 1, lmargin%
  529.             PRINT STRING$(screenwidth%, " ")
  530.             LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2
  531.             iltalien(i) = POS(0)
  532.             PRINT LTRIM$(RTRIM$(a(i)))
  533.         END IF
  534.     NEXT
  535.     LOCATE irow, icol
  536.     level = level - .025
  537.     IF ileadingrow = 22 THEN iresults = -2 ' Aliens have landed!
  538.  
  539. SUB movealiens (ialiencol, ialiencolstat, iresults)
  540.     STATIC imotion, imarch, imotiondir
  541.  
  542.     SOUND 800, .1: SOUND 200, .33 ' Marching sound.
  543.  
  544.     IF inextrnd = -1 THEN inextrnd = 0: imotion = 0: imarch = 0: imotiondir = 0
  545.     irow = CSRLIN: icol = POS(0)
  546.     yy% = CSRLIN: xx% = POS(0)
  547.     PCOPY 0, 1: SCREEN 0, 0, 1, 0: LOCATE yy%, xx%, 0, 7, 0
  548.     IF imotiondir = 0 THEN imotion = imotion - 1 ELSE imotion = imotion + 1
  549.     COLOR 6, ibk
  550.  
  551.     FOR i = imaxalienforce TO 1 STEP -1
  552.         IF RTRIM$(a(i)) <> "" THEN
  553.             FOR k = 1 TO LEN(a(i))
  554.                 k$ = MID$(a(i), k, 1)
  555.                 IF k$ = "^" THEN
  556.                     MID$(a(i), k, 1) = "-"
  557.                 ELSEIF k$ = "-" THEN
  558.                     MID$(a(i), k, 1) = "^"
  559.                 END IF
  560.             NEXT
  561.             i2 = i2 + 2
  562.             ialiencol = ialiencolstat + imotion
  563.             LOCATE ileadingmax - (imaxalienforce - i) * 2, ialiencol + INSTR(a(i), CHR$(79)) - 2
  564.             IF POS(0) = lmargin% THEN imarch = 1
  565.             iltalien(i) = POS(0)
  566.             IF imotiondir = 0 THEN
  567.                 PRINT LTRIM$(RTRIM$(a(i))); " "
  568.             ELSE
  569.                 LOCATE , POS(0) - 1
  570.                 PRINT " "; LTRIM$(RTRIM$(a(i)))
  571.             END IF
  572.             IF ialiencol + LEN(RTRIM$(a(i))) = screenwidth% THEN imarch = -1
  573.         END IF
  574.     NEXT
  575.  
  576.     IF imarch = 1 THEN imotiondir = 1: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  577.     IF imarch = -1 THEN imotiondir = 0: CALL marchdown(ialiencol, ialiencolstat, imotion, iresults)
  578.     IF imarch = 0 THEN
  579.         IF ABS(TIMER - z2alienfire) > firerate THEN
  580.             firerate = (INT(RND * 10) + 1) / 20
  581.             IF iwait = 0 THEN CALL alienattack(ialiencol)
  582.         END IF
  583.     ELSE
  584.         imarch = 0
  585.     END IF
  586.     PCOPY 1, 0: SCREEN 0, 0, 0, 0
  587.     LOCATE irow, icol, 1, 7, 0
  588.  
  589. SUB mship (imothership)
  590.     STATIC x%, mov%, z4, mothership$
  591.  
  592.     yy% = CSRLIN: xx% = POS(0): COLOR 6, ibk
  593.     IF imothership = -1 THEN
  594.         imothership = 1
  595.         x% = lmargin%
  596.         mothership$ = "(" + CHR$(127) + CHR$(179) + CHR$(127) + ")" 'CHR$(254) + CHR$(254) + "O" + CHR$(254) + CHR$(254)
  597.         mov% = 1
  598.     END IF
  599.  
  600.     IF ABS(TIMER - z4) > .05 THEN GOSUB mothership: z4 = TIMER
  601.     LOCATE yy%, xx%
  602.     EXIT SUB
  603.  
  604.     mothership:
  605.     IF x% + LEN(mothership$) = screenwidth% + lmargin% THEN mov% = -1 ELSE IF x% = lmargin% THEN mov% = 1
  606.     x% = x% + mov%
  607.     LOCATE topmargin%, x%
  608.     COLOR 7, 6: PRINT MID$(mothership$, 1, 1);
  609.     COLOR 14, 6: PRINT MID$(mothership$, 2, 1);
  610.     COLOR 7, 6: PRINT MID$(mothership$, 3, 1);
  611.     COLOR 14, 6: PRINT MID$(mothership$, 4, 1);
  612.     COLOR 7, 6: PRINT MID$(mothership$, 5, 1);
  613.     COLOR 7, ibk
  614.     IF x% > 1 AND mov% = 1 THEN
  615.         LOCATE , POS(0) - LEN(mothership$) - 1: PRINT " ";
  616.     END IF
  617.     IF mov% = -1 THEN PRINT " ";
  618.     RETURN
  619.  
  620.  
  621. DEFINT A-H, J-Z
  622. SUB qbide
  623.     PALETTE 2, 59
  624.     COLOR 15, 0
  625.     CLS
  626.  
  627.     COLOR 0, 7
  628.     LOCATE 1, 1
  629.     PRINT SPACE$(80)
  630.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  631.  
  632.     COLOR 7, 0 ' Black background.
  633.  
  634.     LOCATE 2, 1: PRINT CHR$(218)
  635.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  636.     LOCATE 2, 80: PRINT CHR$(191)
  637.  
  638.     LOCATE 2, 76: PRINT CHR$(180)
  639.     LOCATE 2, 78: PRINT CHR$(195)
  640.  
  641.     COLOR 0, 7
  642.     LOCATE 2, 77: PRINT CHR$(24)
  643.     LOCATE 2, 36: PRINT " Untitled "
  644.  
  645.     COLOR 7, 0
  646.     FOR Rows = 3 TO 24
  647.         LOCATE Rows, 1: PRINT CHR$(179);
  648.         LOCATE Rows, 80: PRINT CHR$(179);
  649.     NEXT Rows
  650.  
  651.     LOCATE 22, 1: PRINT CHR$(195)
  652.     LOCATE 22, 80: PRINT CHR$(180)
  653.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  654.     LOCATE 22, 35
  655.     PRINT " Immediate "
  656.  
  657.     COLOR 0, 7
  658.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  659.     LOCATE 21, 2: PRINT CHR$(27)
  660.     LOCATE 21, 3: PRINT CHR$(219)
  661.     LOCATE 21, 79: PRINT CHR$(26)
  662.     FOR Rows = 4 TO 19
  663.         LOCATE Rows, 80: PRINT CHR$(176)
  664.     NEXT Rows
  665.     LOCATE 3, 80: PRINT CHR$(24)
  666.     LOCATE 4, 80: PRINT CHR$(219)
  667.     LOCATE 20, 80: PRINT CHR$(25)
  668.  
  669.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  670.     LOCATE 25, 59: PRINT SPACE$(4);
  671.     COLOR 0, 3
  672.     LOCATE 25, 63: PRINT CHR$(179);
  673.     LOCATE 25, 64: PRINT SPACE$(6);
  674.     LOCATE 25, 68: PRINT "C  00001:001 ";
  675.  
  676.  
  677. DEFSNG A-H, J-Z
  678. SUB reprintaliens (ialiencol, ihitaliens, iresults, i4, i, imothership)
  679.     IF ihitaliens > 0 THEN
  680.         ihits = ihits + 1
  681.  
  682.         SELECT CASE iresults + 1
  683.             CASE 1: score$ = LTRIM$(STR$(VAL(score$) + 150))
  684.             CASE 2: score$ = LTRIM$(STR$(VAL(score$) + 250))
  685.             CASE 3: score$ = LTRIM$(STR$(VAL(score$) + 350))
  686.         END SELECT
  687.  
  688.         score$ = STRING$(6 - LEN(score$), "0") + score$
  689.         IF (ihits + 15) MOD 20 = 0 AND imothership = 0 THEN imothership = -1
  690.         LOCATE bullet%(i), lmargin%: PRINT SPACE$(screenwidth%);
  691.         iltalien(i4) = POS(0)
  692.  
  693.         IF RTRIM$(a(i4)) = "" THEN
  694.             alienforce% = alienforce% - 1
  695.             IF alienforce% = 0 THEN iresults = iresults + 1 ' Level completed. Goto to next level.
  696.             IF bullet%(i) = ileadingrow THEN ileadingrow = ileadingrow - 2
  697.         ELSE
  698.             LOCATE bullet%(i), ialiencol + INSTR(a(i4), CHR$(79)) - 2
  699.             PRINT LTRIM$(RTRIM$(a(i4)))
  700.         END IF
  701.     ELSE
  702.         i2 = ABS(ihitaliens)
  703.         LOCATE iy(i2), ix(i2)
  704.         PRINT " ";: iy(i2) = 0
  705.         ia(i2) = 0
  706.         LOCATE irow, icol
  707.         IF soundfile% = 0 THEN
  708.             SOUND 1000, .5
  709.         ELSE
  710.             z4 = TIMER
  711.             DO
  712.                 IF eflag THEN
  713.                     IF ABS(z4 - TIMER) > .1 THEN
  714.                         eflag = 0
  715.  
  716.                         PALETTE 0, 0
  717.  
  718.                         EXIT DO
  719.                     ELSE
  720.                         j = -j * -1
  721.                         IF j = 0 THEN
  722.                             PALETTE 0, 63
  723.                             _DELAY .05
  724.                         ELSE
  725.                             PALETTE 0, 0
  726.                             _DELAY .05
  727.                         END IF
  728.                     END IF
  729.                 END IF
  730.                 IF eflag = 0 THEN
  731.                     PALETTE 0, 36
  732.                     IF soundfile% THEN
  733.                         _SNDPLAY t1&
  734.                         _DELAY .05
  735.                         _SNDPLAY t7&
  736.                     ELSE
  737.                         _DELAY .075
  738.                     END IF
  739.  
  740.                     eflag = -1
  741.                     z4 = TIMER
  742.                 END IF
  743.             LOOP
  744.             SELECT CASE iresults + 1
  745.                 CASE 1: bonus = 500
  746.                 CASE 2: bonus = 1500
  747.                 CASE 3: bonus = 2500
  748.             END SELECT
  749.             score$ = LTRIM$(STR$(VAL(score$) + bonus))
  750.             score$ = STRING$(6 - LEN(score$), "0") + score$
  751.         END IF
  752.     END IF
  753.  
  754.     ihitaliens = 0
  755.     bullet%(i) = -bullet%(i)
  756.  
  757.     COLOR 0, 3
  758.     yy% = CSRLIN: xx% = POS(0)
  759.     LOCATE 25, 74: PRINT score$;
  760.     LOCATE yy%, xx%
  761.     COLOR 6, ibk
  762.  
  763.  
  764. SUB qbideOrig
  765.     PALETTE 2, 59
  766.     COLOR 15, 1
  767.     CLS
  768.  
  769.     COLOR 0, 7
  770.     LOCATE 1, 1
  771.     PRINT SPACE$(80)
  772.     LOCATE 1, 1: PRINT "   File  Edit  View  Search  Run  Debug  Calls  Options                   Help"
  773.  
  774.     COLOR 7, 1
  775.  
  776.     LOCATE 2, 1: PRINT CHR$(218)
  777.     LOCATE 2, 2: PRINT STRING$(78, CHR$(196))
  778.     LOCATE 2, 80: PRINT CHR$(191)
  779.  
  780.     LOCATE 2, 76: PRINT CHR$(180)
  781.     LOCATE 2, 78: PRINT CHR$(195)
  782.  
  783.     COLOR 1, 7
  784.     LOCATE 2, 77: PRINT CHR$(24)
  785.     LOCATE 2, 36: PRINT " Untitled "
  786.  
  787.     COLOR 7, 1
  788.     FOR Rows = 3 TO 24
  789.         LOCATE Rows, 1: PRINT CHR$(179);
  790.         LOCATE Rows, 80: PRINT CHR$(179);
  791.     NEXT Rows
  792.  
  793.     LOCATE 22, 1: PRINT CHR$(195)
  794.     LOCATE 22, 80: PRINT CHR$(180)
  795.     LOCATE 22, 2: PRINT STRING$(78, CHR$(196))
  796.     LOCATE 22, 35
  797.     PRINT " Immediate "
  798.  
  799.     COLOR 0, 7
  800.     LOCATE 21, 3: PRINT STRING$(76, CHR$(176))
  801.     LOCATE 21, 2: PRINT CHR$(27)
  802.     LOCATE 21, 3: PRINT CHR$(219)
  803.     LOCATE 21, 79: PRINT CHR$(26)
  804.     FOR Rows = 4 TO 19
  805.         LOCATE Rows, 80: PRINT CHR$(176)
  806.     NEXT Rows
  807.     LOCATE 3, 80: PRINT CHR$(24)
  808.     LOCATE 4, 80: PRINT CHR$(219)
  809.     LOCATE 20, 80: PRINT CHR$(25)
  810.  
  811.     COLOR 0, 3: LOCATE 25, 1: PRINT " <Shift+F1=Help> <F6=Window> <F2=Subs> <F5=Run> <F8=Step> ";
  812.     LOCATE 25, 59: PRINT SPACE$(4);
  813.     COLOR 0, 3
  814.     LOCATE 25, 63: PRINT CHR$(179);
  815.     LOCATE 25, 64: PRINT SPACE$(6);
  816.     LOCATE 25, 68: PRINT "C  00001:001 ";
  817.  
  818.  
  819. SUB TheBOB
  820.     SCREEN _NEWIMAGE(800, 600, 256)
  821.     WIDTH 80, 25
  822.  
  823.     OUT &H3C8, 1: OUT &H3C9, 40: OUT &H3C9, 12: OUT &H3C9, 0
  824.     OUT &H3C8, 2: OUT &H3C9, 6: OUT &H3C9, 12: OUT &H3C9, 0
  825.     OUT &H3C8, 3: OUT &H3C9, 30: OUT &H3C9, 8: OUT &H3C9, 0
  826.     OUT &H3C8, 4: OUT &H3C9, 3: OUT &H3C9, 8: OUT &H3C9, 0
  827.     OUT &H3C8, 7: OUT &H3C9, 63: OUT &H3C9, 0: OUT &H3C9, 0
  828.     OUT &H3C8, 8: OUT &H3C9, 46: OUT &H3C9, 0: OUT &H3C9, 0
  829.     OUT &H3C8, 9: OUT &H3C9, 63: OUT &H3C9, 63: OUT &H3C9, 63
  830.     OUT &H3C8, 12: OUT &H3C9, 20: OUT &H3C9, 20: OUT &H3C9, 20
  831.     OUT &H3C8, 13: OUT &H3C9, 0: OUT &H3C9, 0: OUT &H3C9, 0
  832.     OUT &H3C8, 14: OUT &H3C9, 55: OUT &H3C9, 35: OUT &H3C9, 0
  833.  
  834.     CIRCLE (320, 240), 100, 3, , , .9
  835.     PAINT (320, 240), 3
  836.     CIRCLE (320, 230), 90, 1, , , .9
  837.     PAINT (320, 230), 1
  838.  
  839.     FOR Reps = 1 TO 4
  840.         SELECT CASE Reps
  841.             DATA 1,1.2,1.8,5
  842.             CASE 1: Elipse = 1
  843.             CASE 2: Elipse = 1.2
  844.             CASE 3: Elipse = 1.8
  845.             CASE 4: Elipse = 5
  846.         END SELECT
  847.         FOR E = Elipse TO Elipse + .1 STEP .01
  848.             CIRCLE (320, 240), 100, 3, , , E
  849.         NEXT E
  850.     NEXT Reps
  851.     FOR Radius = 38 TO 43
  852.         CIRCLE (320, 160), Radius, 3, , , .4
  853.     NEXT Radius
  854.     CIRCLE (320, 160), 40, 14, 3.3, 6, .4
  855.     CIRCLE (320, 240), 100, 5, , , .9
  856.     PAINT (0, 0), 5
  857.     CIRCLE (320, 240), 100, 0, , , .9
  858.     PAINT (0, 0), 0
  859.     FOR Radius = 12 TO 18
  860.         CIRCLE (320, 153), Radius, 2, , , .3
  861.     NEXT Radius
  862.  
  863.     CIRCLE (320, 150), 12, 2, , , .6
  864.     PAINT STEP(0, 0), 2
  865.     CIRCLE (300, 143), 32, 2, 6, 1.1
  866.     CIRCLE (276, 143), 32, 2, 6, .6
  867.     DRAW "BM302,125 C2 M+15,-10 BD10 P2,2"
  868.     PAINT (320, 145), 2
  869.     CIRCLE (282, 143), 32, 4, 6, .73
  870.     CIRCLE (266, 156), 60, 4, .1, .68
  871.     CIRCLE (320, 150), 12, 4, 3.14159, 0, .2
  872.     DRAW "BM302,125 C4 M+15,-10 BD10"
  873.     CIRCLE (276, 143), 32, 4, 6, .6
  874.     PAINT STEP(35, 0), 4
  875.     'Face begins
  876.     CIRCLE (303, 316), 100, 14, 1.5, 2
  877.     CIRCLE (337, 316), 100, 14, 1.1, 1.64
  878.     PSET (310, 215), 14
  879.     DRAW "H30 M-20,+40 M+12,-4 M+14,-29 BL2 P14,14 BF12 P15,14"
  880.     PSET (330, 215), 14
  881.     DRAW "E30 M+20,+40 M-12,-4 M-14,-29 BR2 P14,14 BG12 P15,14"
  882.     PSET (320, 246), 14
  883.     DRAW "R20 H20 G20 R20 U nL19 nR19 BU2 P15,14"
  884.     CIRCLE (320, 170), 100, 14, 3.8, 4.1
  885.     CIRCLE (320, 170), 100, 14, 4.42, 5.01
  886.     CIRCLE (320, 170), 100, 14, 5.33, 5.62
  887.     CIRCLE (320, 220), 80, 14, 3.29, 4.5
  888.     CIRCLE (320, 220), 80, 14, 4.66, 6.15
  889.     PSET (260, 250), 14
  890.     DRAW "D10 F8 U13 M+10,+5 D12 M+12,+6 U12 BR60"
  891.     DRAW "D12 M+12,-6 U12 M+10,-5 D13 E8 U10"
  892.     PSET (300, 297), 14
  893.     DRAW "U14 R16 D16"
  894.     CIRCLE (320, 212), 80, 14, 3.42, 4.5
  895.     CIRCLE (320, 212), 80, 14, 4.66, 6
  896.     LINE (300, 280)-(316, 283), 14, BF
  897.     PAINT (320, 296), 14
  898.     PAINT (290, 292), 14
  899.     PAINT (300, 278), 15, 14
  900.     CIRCLE (100, 240), 32, 13
  901.     PAINT STEP(0, 0), 13
  902.  
  903.     FOR x% = 58 TO 142
  904.         FOR y% = 198 TO 282
  905.             IF POINT(x%, y%) = 13 THEN
  906.                 IF POINT(x% + 220, y%) = 15 THEN PSET (x% + 220, y%), 9
  907.             END IF
  908.         NEXT y%
  909.     NEXT x%
  910.  
  911.     COLOR 13: LOCATE 1, 1: PRINT "HAPPY HALLOWEEN!"
  912.  
  913.     xx = 64: yy = 360 - 330
  914.     FOR x% = 0 TO 300
  915.         FOR y% = 0 TO 16
  916.             IF POINT(x%, y%) = 13 THEN
  917.                 IF y% > 6 THEN Colr = 8 ELSE Colr = 7
  918.                 LINE (x% * 4 + xx, y% * 4 + yy)-(x% * 4 + xx + 3, y% * 4 + yy + 3), Colr, BF
  919.             END IF
  920.         NEXT y%
  921.     NEXT x%
  922.     FOR x% = 0 TO 639
  923.         IF POINT(x%, 368) <> 0 THEN PSET (x%, 368), 14
  924.     NEXT x%
  925.  
  926.     z1 = TIMER
  927.     DO UNTIL ABS(TIMER - z1) > 4
  928.         FOR Reps = 1 TO 3
  929.             WAIT &H3DA, 8
  930.             WAIT &H3DA, 8, 8
  931.         NEXT Reps
  932.  
  933.         Flicker = FIX(RND * 20)
  934.         OUT &H3C8, 14
  935.         OUT &H3C9, 40 + Flicker
  936.         OUT &H3C9, 25 + Flicker
  937.         OUT &H3C9, 10 + Flicker
  938.  
  939.         OUT &H3C8, 15
  940.         OUT &H3C9, 43 + Flicker
  941.         OUT &H3C9, 38 + Flicker
  942.         OUT &H3C9, 20 + Flicker
  943.     LOOP
  944.     SCREEN 0, 0, 0, 0
  945.  
  946. SUB displayhighscores
  947.  
  948.     COLOR 0, 3
  949.     LOCATE 25, 68: PRINT "Score "; score$;
  950.  
  951.     DIM hs AS STRING * 25
  952.     REDIM highscore$(6), hsdata$(6)
  953.     DO
  954.         IF _FILEEXISTS("ascii-invaders-high-score.dat") THEN
  955.             OPEN "ascii-invaders-high-score.dat" FOR RANDOM AS #1 LEN = 25
  956.             FOR i = 1 TO 5
  957.                 GET #1, i, hs
  958.                 highscore$(i) = MID$(hs, 10, 6): hsdata$(i) = hs
  959.             NEXT
  960.             CLOSE #1
  961.         ELSE
  962.             FOR i = 1 TO 5
  963.                 hsdata$(i) = SPACE$(25)
  964.             NEXT
  965.         END IF
  966.  
  967.         IF VAL(score$) > VAL(highscore$(5)) THEN
  968.  
  969.             IF VAL(score$) > VAL(highscore$(1)) THEN
  970.                 msg$ = " HIGH SCORE / Enter Your Initials! "
  971.             ELSE
  972.                 msg$ = " Top 5 Score. Enter Your Initials! "
  973.             END IF
  974.  
  975.             GOSUB hiscore
  976.  
  977.             a = 14
  978.             OUT &H3C8, 0
  979.             OUT &H3C9, 20 - a
  980.             OUT &H3C9, 20 - a
  981.             OUT &H3C9, 20 - a
  982.  
  983.             OUT &H3C8, 8
  984.             OUT &H3C9, 30 - a
  985.             OUT &H3C9, 30 - a
  986.             OUT &H3C9, 30 - a
  987.  
  988.             OUT &H3C8, 7
  989.             OUT &H3C9, 30 - a
  990.             OUT &H3C9, 30 - a
  991.             OUT &H3C9, 30 - a
  992.  
  993.             OUT &H3C8, 3
  994.             OUT &H3C9, 30 - a
  995.             OUT &H3C9, 30 - a
  996.             OUT &H3C9, 30 - a
  997.  
  998.             GOSUB hardware_overlay
  999.  
  1000.             _FONT 16
  1001.  
  1002.             COLOR White, 0
  1003.             t$ = msg$
  1004.             PSLC 4.6, 41 - LEN(msg$) \ 2, t$
  1005.  
  1006.             font = _LOADFONT("lucon.ttf", 20, "monospace")
  1007.             IF font <= 0 THEN font = 16
  1008.             _FONT font
  1009.  
  1010.             DEF SEG = 0
  1011.             delay = .4
  1012.             lscr = 19
  1013.             z3 = TIMER
  1014.             DO
  1015.                 initials$ = "": i = 0: nxt = 0
  1016.                 COLOR , _RGB(24, 24, 24): t$ = "   " ' Blank initials for redo. Okay to blank at start.
  1017.                 PSL 5 + rank * 2, lscr, t$
  1018.                 _DISPLAY
  1019.                 DO
  1020.                     _LIMIT 60
  1021.                     IF ABS(z3 - TIMER) > .3 AND kflag > -2 THEN
  1022.                         underline 5 + rank * 2, lscr + nxt, 0
  1023.                         _DISPLAY
  1024.                         z3 = TIMER
  1025.                     END IF
  1026.  
  1027.                     SELECT CASE kflag
  1028.                         CASE 0
  1029.                             IF ABS(z1 - TIMER) > 1.5 AND i AND nxt < 3 THEN
  1030.                                 SOUND 1500, 1
  1031.                                 underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  1032.                                 _DISPLAY
  1033.                                 initials$ = initials$ + CHR$(64 + i)
  1034.                                 nxt = nxt + 1 ' Next initial
  1035.                                 i = 0 ' Reset alphabet.
  1036.                                 z1 = TIMER
  1037.                                 IF nxt = 3 THEN
  1038.                                     kflag = -2 ' All 3 initials have been input.
  1039.                                     underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  1040.                                     _DISPLAY
  1041.                                 END IF
  1042.                             END IF
  1043.  
  1044.                             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  1045.                                 kflag = -1 ' Alt key pressed.
  1046.                                 z1 = TIMER: z2 = TIMER
  1047.                                 i = i + 1: IF i > 26 THEN i = 1
  1048.                                 COLOR , _RGB(24, 24, 24): t$ = " "
  1049.                                 PSL 5 + rank * 2, lscr + nxt, t$
  1050.                                 COLOR DarkOrange: t$ = CHR$(64 + i)
  1051.                                 SOUND 1000, .1
  1052.                                 PSL 5 + rank * 2, lscr + nxt, t$
  1053.                                 underline 5 + rank * 2, lscr + nxt, 0
  1054.                                 _DISPLAY
  1055.                             END IF
  1056.                         CASE -1
  1057.                             IF ABS(z2 - TIMER) > 2 THEN ' Key down long enough to indicate redo input.
  1058.                                 IF nxt > 0 THEN ' Redo last initial input.
  1059.                                     SOUND 300, .5
  1060.                                     FOR nxt = 0 TO 3
  1061.                                         underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  1062.                                     NEXT
  1063.                                     nxt = 0: i = 0
  1064.                                     initials$ = ""
  1065.                                     COLOR , _RGB(24, 24, 24): t$ = "   "
  1066.                                     PSL 5 + rank * 2, lscr, t$
  1067.                                     _DISPLAY
  1068.                                     z1 = TIMER ' Reset enter timer.
  1069.                                 ELSE
  1070.                                     SOUND 300, .5
  1071.                                     i = 0
  1072.                                     COLOR , _RGB(24, 24, 24): t$ = " "
  1073.                                     PSL 5 + rank * 2, lscr, t$
  1074.                                     _DISPLAY
  1075.                                     z1 = TIMER ' Reset enter timer.
  1076.                                 END IF
  1077.                                 z2 = TIMER
  1078.                             END IF
  1079.  
  1080.                             IF PEEK(1047) MOD 16 <> 7 AND PEEK(1047) MOD 16 <> 8 THEN ' Alt key was released.
  1081.                                 kflag = 0 ' Alt key up
  1082.                                 z1 = TIMER
  1083.                             END IF
  1084.                         CASE -2 ' Finished. Initials will flash until confirmed by 2-second timer.
  1085.                             z1 = TIMER: z2 = TIMER
  1086.                             j = 0
  1087.                             DO
  1088.                                 IF ABS(z1 - TIMER) > .3 THEN j = -j - 1: z1 = TIMER
  1089.                                 IF j THEN
  1090.                                     COLOR DarkOrange: t$ = initials$
  1091.                                     PSL 5 + rank * 2, lscr, t$
  1092.                                     _DISPLAY
  1093.                                 ELSE
  1094.                                     COLOR _RGB(24, 24, 24): t$ = initials$
  1095.                                     PSL 5 + rank * 2, lscr, t$
  1096.                                     _DISPLAY
  1097.                                 END IF
  1098.  
  1099.                                 IF ABS(z2 - TIMER) > 2.5 AND j THEN
  1100.                                     kflag = -3
  1101.                                     EXIT DO
  1102.                                 END IF
  1103.  
  1104.                                 IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  1105.                                     BEEP
  1106.                                     kflag = -4
  1107.                                     EXIT DO
  1108.                                 END IF
  1109.                             LOOP
  1110.                         CASE -3
  1111.                             _DELAY 1
  1112.                             l$ = "8"
  1113.                             n$ = "n24": PLAY "L" + l$ + n$
  1114.                             n$ = "n28": PLAY "L" + l$ + n$
  1115.                             n$ = "n28": PLAY "L" + l$ + n$
  1116.                             l$ = "7"
  1117.                             n$ = "n31": PLAY "L" + l$ + n$
  1118.                             l$ = "9"
  1119.                             n$ = "n28": PLAY "L" + l$ + n$
  1120.                             l$ = "3"
  1121.                             n$ = "n31": PLAY "L" + l$ + n$
  1122.                             kflag = 1
  1123.                             _DELAY 1: EXIT DO
  1124.                         CASE -4
  1125.                             kflag = 0 ' Repeat enter initials
  1126.                             nxt = 0
  1127.                             i = 0
  1128.                             EXIT DO
  1129.                     END SELECT
  1130.                 LOOP
  1131.                 IF kflag > 0 THEN kflag = 0: EXIT DO ' Exit routine.
  1132.             LOOP
  1133.             DEF SEG
  1134.  
  1135.             hsname$ = initials$
  1136.  
  1137.             MID$(hsdata$(rank), 5, 3) = hsname$ + SPACE$(3 - LEN(hsname$))
  1138.             OPEN "ascii-invaders-high-score.dat" FOR RANDOM AS #1 LEN = 25
  1139.             FOR i = 1 TO 5
  1140.                 hs = hsdata$(i)
  1141.                 IF LEFT$(hs, 1) = "" THEN MID$(hs, 1, 2) = "0" + LTRIM$(STR$(i))
  1142.                 PUT #1, i, hs
  1143.             NEXT
  1144.             CLOSE #1
  1145.  
  1146.             _DELAY 1
  1147.             _DISPLAY ' Remove scoreboard.
  1148.             _DELAY 1
  1149.             _FREEIMAGE Overlay
  1150.             _FONT 16 'select inbuilt 8x16 default font
  1151.             _FREEFONT font
  1152.  
  1153.             _DEST 0 'Reset dest back to the normal screen 0.
  1154.  
  1155.             _AUTODISPLAY
  1156.             COLOR 6, 0
  1157.             msg$ = SPACE$(40)
  1158.             LOCATE 4, 41 - LEN(msg$) \ 2
  1159.             PRINT msg$;
  1160.             PALETTE
  1161.             _DELAY 1
  1162.  
  1163.             EXIT DO
  1164.         ELSE
  1165.             EXIT DO ' Not in the top 5 highest scores so exit sub.
  1166.         END IF
  1167.     LOOP
  1168.     EXIT SUB
  1169.  
  1170.     hardware_overlay:
  1171.     Overlay = _NEWIMAGE(_WIDTH * _FONTWIDTH, _HEIGHT * _FONTHEIGHT, 32)
  1172.  
  1173.     _DEST Overlay
  1174.     _DISPLAY ' Turn autodisplay off.
  1175.  
  1176.     font = _LOADFONT("lucon.ttf", 20, "monospace")
  1177.     IF font <= 0 THEN font = 16
  1178.     _FONT font
  1179.  
  1180.     bxy% = 3
  1181.     bxx% = 13
  1182.     COLOR DarkOrange, 0
  1183.     t$ = " " + CHR$(218) + STRING$(27, CHR$(196)) + CHR$(191) + " "
  1184.     PSL bxy%, bxx% - 1, t$
  1185.     FOR i = 1 TO 12
  1186.         t$ = " " + CHR$(179) + STRING$(27, CHR$(32)) + CHR$(179) + " "
  1187.         PSL bxy% + i, bxx% - 1, t$
  1188.     NEXT
  1189.     t$ = " " + CHR$(192) + STRING$(27, CHR$(196)) + CHR$(217) + " "
  1190.     PSL bxy% + i, bxx% - 1, t$
  1191.  
  1192.     bxy% = 4
  1193.     COLOR Black, DarkOrange
  1194.     t$ = "    NAME   SCORE    DATE   "
  1195.     PSL bxy% + 1, bxx% + 1, t$
  1196.  
  1197.     COLOR DarkOrange, 0
  1198.     FOR i = 1 TO 5
  1199.         t$ = hsdata$(i)
  1200.         PSL bxy% + 1 + i * 2, bxx% + 2, t$
  1201.     NEXT
  1202.  
  1203.     _DISPLAY
  1204.  
  1205.     RETURN
  1206.  
  1207.     hiscore:
  1208.     FOR i = 1 TO 5
  1209.         IF VAL(score$) > VAL(highscore$(i)) THEN rank = i: EXIT FOR
  1210.     NEXT
  1211.  
  1212.     hsdata$(6) = SPACE$(25)
  1213.     MID$(hsdata$(6), 10, 6) = score$
  1214.     MID$(hsdata$(6), 18, 8) = MID$(DATE$, 1, 6) + MID$(DATE$, 9, 2)
  1215.     highscore$(6) = score$
  1216.     FOR i = 1 TO 6
  1217.         FOR j = 1 TO 6
  1218.             IF i <> j THEN
  1219.                 IF VAL(highscore$(i)) > VAL(highscore$(j)) THEN
  1220.                     SWAP highscore$(i), highscore$(j)
  1221.                     SWAP hsdata$(i), hsdata$(j)
  1222.                 END IF
  1223.             END IF
  1224.         NEXT
  1225.     NEXT
  1226.     FOR i = 1 TO 5
  1227.         MID$(hsdata$(i), 1, 2) = "0" + LTRIM$(STR$(i))
  1228.     NEXT
  1229.  
  1230.     RETURN
  1231.  
  1232.  
  1233. SUB PSLC (y, x, t$)
  1234.     _PRINTSTRING ((x - 1) * 8, (y - 1) * 16), t$
  1235.  
  1236. SUB PSL (y, x, t$)
  1237.     _PRINTSTRING ((x - 1) * _FONTWIDTH, (y - 1) * _FONTHEIGHT), t$
  1238.     Overlay_Hardware = _COPYIMAGE(Overlay, 33)
  1239.     _PUTIMAGE (0, 0), Overlay_Hardware
  1240.  
  1241. SUB underline (y, x, uflag)
  1242.     STATIC ucnt
  1243.     ucnt = -ucnt - 1
  1244.     IF ucnt OR uflag THEN
  1245.         LINE ((x - 1) * _FONTWIDTH, y * _FONTHEIGHT)-((x - 1) * _FONTWIDTH + 12, y * _FONTHEIGHT), _RGB(24, 24, 24), BF
  1246.     ELSE
  1247.         LINE ((x - 1) * _FONTWIDTH, y * _FONTHEIGHT)-((x - 1) * _FONTWIDTH + 12, y * _FONTHEIGHT), DarkOrange, BF
  1248.     END IF
  1249.  
  1250.     Overlay_Hardware = _COPYIMAGE(Overlay, 33)
  1251.     _PUTIMAGE (0, 0), Overlay_Hardware
  1252.  
  1253. SUB thunder
  1254.     SCREEN 0, 0, 1, 1
  1255.     _DELAY 2
  1256.  
  1257.     IF _FILEEXISTS("Thunder6.ogg") AND _FILEEXISTS("Thunder6.ogg") AND _FILEEXISTS("Thunder6.ogg") THEN
  1258.         soundfile% = -1
  1259.     END IF
  1260.  
  1261.     IF soundfile% THEN
  1262.         t1& = _SNDOPEN("Thunder1.ogg", "SYNC")
  1263.         t2& = _SNDOPEN("Thunder2.ogg", "SYNC")
  1264.         t3& = _SNDOPEN("Thunder3.ogg", "SYNC")
  1265.         t4& = _SNDOPEN("Thunder4.ogg", "SYNC")
  1266.         t5& = _SNDOPEN("Thunder5.ogg", "SYNC")
  1267.         t6& = _SNDOPEN("Thunder6.ogg", "SYNC")
  1268.         t7& = _SNDOPEN("Thunder7.ogg", "SYNC")
  1269.         t8& = _SNDOPEN("Thunder8.ogg", "SYNC")
  1270.  
  1271.         _SNDPLAY t6&
  1272.         _DELAY .1
  1273.         _SNDPLAY t7&
  1274.         _DELAY .1
  1275.         _SNDPLAY t8&
  1276.     ELSE
  1277.         SOUND 1000, .3: SOUND 2400, .6:: SOUND 700, 2
  1278.     END IF
  1279.  
  1280.     FOR i = 1 TO 15
  1281.         _DELAY i / 150
  1282.         IF i / 2 = i \ 2 THEN
  1283.             SOUND 250, .1
  1284.             SCREEN 0, 0, 1, 1
  1285.         ELSE
  1286.             SCREEN 0, 0, 2, 2
  1287.             IF i < 13 THEN _DELAY i / 100: SCREEN 0, 0, 3, 3: COLOR 0, 7: CLS
  1288.         END IF
  1289.     NEXT
  1290.  
  1291.     PCOPY 2, 0
  1292.     SCREEN 0, 0, 0, 0
  1293.     _DELAY 1.5

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

I still have to look into a couple more effects before I'm ready to open a "programs" thread. I've also been puttering around adding a spell check function to my WP, and I need to spend some time looking over what Steve posted for me on some new screen 0 hardware rendering effects.

Pete

Edit: Completed the switch to hardware rendering overlay for high score board. Also fixed a bug Jack found.

Edit: New improved system to enter high score initials. See post revisons on how to play, at top of post.

Edit: Added a title and a new explosion effect plus point scoring when your tank's missile blows up an enemy's missile.
Title: Re: Competition
Post by: bplus on October 16, 2021, 11:30:19 pm
Oh yeah! way to stay with one key requirement for High Scores.

I read that request for an effect with screen 0, wondered if the command to print without back ground would work in screen 0 and basically take care of what you wanted???

Cobalt showed us the word, unfortunately it didn't stick in my memory, maybe it was two keywords.
Title: Re: Competition
Post by: SMcNeill on October 17, 2021, 12:10:35 am
I read that request for an effect with screen 0, wondered if the command to print without back ground would work in screen 0 and basically take care of what you wanted???

You guys need to study up on SCREEN 0 and how it’s stored in memory...

Every point in SCREEN 0 is represented by 2 bytes -- character and color.


COLOR 15,4
LOCATE 1, 1: PRINT “A”

Now the above stores 2 bytes in memory for that position.  65 (for A) and 15 * 16 + 4 for the color. (15 foreground + 4 background...  Gives us a max value of 255 with blinking off so a single byte holds both values.)

So CHR$(65) + CHR$(244) represents that bright white “A” on a red background.

Now, how can you merge *ANYTHING* onto that spot, without overwriting those 2 bytes of info?

LOCATE 1, 1: PRINT “/”

Now if if we magically make the background of that slash have X alpha with _PALETTECOLOR, how the heck do we blend that color with the COLOR 4 background?

And how does that slash print over the A?  There’s no ASCII character representing a slashed-A symbol, so which of our 256 ASCII values do we store for that combination A + /?

SCREEN 0 is a very simple WYSIWYG interface.  You can LOOK at the screen and basically decode how it's represented in memory byte-by-byte.   It doesn’t allow for color blends, alpha levels, character merging or overlapping...

It just stores 2 bytes for each location:  ASCII character to display, color to display it.



Of course, this layout also has ADVANTAGES over other modes.

SCREEN 0 is the *only* screen that can tell the difference in a CHR$(32) and a CHR$(255) printed on.  Both are basically spaces, but SCREEN 0 can still tell the difference in them by the way it stores screen information.
Title: Re: Competition
Post by: Pete on October 17, 2021, 12:58:49 am
I helped shed light on the difference with how the SCREEN function cannot function as perfectly in graphics screens ass it does in screen 0. The ability to store the color and character in a graphics project requires mapping with a matrix. I made a graphics GUI using that approach. Maybe someday I'll see why it displayed correctly in the SDL version, but had a slight misalignment problem when we switched to GL.

So for this overlay idea, I took Steve's code and modified it a bit, to get a little bit closer to what I'm thinking about as a use.

Code: QB64: [Select]
  1. Screen0 = _NEWIMAGE(80, 25, 0)
  2. SCREEN Screen0
  3.  
  4. 'font = _LOADFONT("courbd.ttf", 48, "monospace")
  5. 'IF font <= 0 THEN font = 16
  6. '_FONT font
  7.  
  8. 'This is going to be the screen I use as an overlay.
  9.  
  10. COLOR 0, 7
  11. FOR x = 1 TO 25
  12.     LOCATE x, 1: PRINT STRING$(80, 176);
  13.  
  14. 'Now the above is just Pete's background in Screen0.
  15. 'Now I'm going to create the Overly
  16.  
  17. _DEST Overlay
  18. COLOR MidnightBlue, 0
  19. 'IF font <= 0 THEN font = 16
  20. '_FONT font
  21. text$ = "This is text wrote over the background"
  22. _PRINTSTRING ((_WIDTH - _PRINTWIDTH(text$)) \ 2, _HEIGHT \ 2), text$
  23.  
  24. _DEST 0 'reset our dest back to the normal screen 0 screen
  25.  
  26. 'Turn our software overlay into a hardware image
  27. Overlay_Hardware = _COPYIMAGE(Overlay, 33)
  28.  
  29. 'And then my impressive main program to toggle between showing and not
  30. 'showing the overlay.
  31.     k = _KEYHIT
  32.     IF k = 32 THEN Show_Overlay = NOT Show_Overlay
  33.     IF Show_Overlay THEN _PUTIMAGE (0, 0), Overlay_Hardware
  34.     _DISPLAY
  35.     _LIMIT 30
  36. LOOP UNTIL k = 27
  37.  
  38.  

That's pretty cool how the overlay effect, using hardware imaging, does not disturb the screen 0 screen contents.

Pete
Title: Re: Competition
Post by: bplus on October 17, 2021, 08:58:13 am
@Pete 

I found the stuff I was talking about and it turns out graphics screen using _PrintMode. But I think this game of yours might have you ready to grad-e-ate to graphics :) screen 12 might be a gentle transition. If you need to know what characters you have printed on screen you can keep am array to track. If you need to know if a chr$(32) or a chr$(255) then I have to ask why? ;-))
Title: Re: Competition
Post by: Pete on October 17, 2021, 11:53:06 am
LOL @ "grad-e-ate" You used the term improperly, though. Every varmint knows ya sez, "Ain't ya grad-e-ate your breakfast!"

 - Sam
Title: Re: Competition
Post by: jack on October 19, 2021, 12:28:06 pm
Pete, there's a problem in line 350, illegal function call
the error happened in second wave about half way trough
Title: Re: Competition
Post by: Pete on October 19, 2021, 12:51:44 pm
That's the part where the aliens have landed.

        FOR i = j TO 1 STEP -1
            LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2
            PRINT LTRIM$(RTRIM$(a(i)));
            LOCATE CSRLIN - 2
        NEXT

The error line:  LOCATE , ialiencol + INSTR(a(i), CHR$(79)) - 2

This may be some instance where the variable ialiencol = 2 and the INSTR() function is not detecting CHR$(79) in the array. That would make the equation 2 + 0 - 2, leaving a zero in the LOCATE statement, and thus the error. I'll have to run a few tests.

Can you recall how many alien ships (bats) were in the bottom row of the screen when it errored out?

Thanks,

Pete
Title: Re: Competition
Post by: jack on October 19, 2021, 01:01:01 pm
no, mayby less than half
Title: Re: Competition
Post by: Pete on October 20, 2021, 03:37:29 am
Okay, fixed the bug Jack found and finished switching out the hardware overlay scoreboard.

https://www.qb64.org/forum/index.php?topic=4245.msg137017#msg137017

Pete
Title: Re: Competition
Post by: bplus on October 20, 2021, 11:51:15 am
Hi @Pete

Assuming reply #102 in this thread is latest, I tested last night and this morning and am having a very hard time getting initials correct. It seems you have to hold alt key down to move letters at all and I am always going past letter stop by one and am getting farther and farther right having to backspace a bunch. At one point I swear the backspace never appears! Anyway result is always wrong or quit. Shouldn't it be press alt key one to move up letter one time? I press once and no move, again once and no move, I have to hold down for it to cycle letters. Just some feed back, luv everything else, the look of the High Score Dialog is great!
Title: Re: Competition
Post by: Pete on October 20, 2021, 03:19:50 pm
That's a really valid criticism of the enter your initials part. Okay, let's scrap that crap, and how about giving this a go...

Input routine demo only. Not the game. Tap the alt key to advance initials. Leave it unpressed for 2 seconds, and the initial showing will be automatically input. If you make a mistake, hold the Alt key down for a short time, and you can redo from start. It finishes when the last initial is input, and starts flashing your initials for 2.5 seconds. Press the Alt key anytime while initials flash to redo from start; otherwise, just wait until they stop flashing, and your initials are entered.

Oh, and for Mark, it will rerun after ending...
 
Code: QB64: [Select]
  1. DIM SHARED rank: rank = 1
  2.  
  3. DIM SHARED intro%: intro% = -1
  4.  
  5. skip_intro:
  6. DIM SHARED Overlay, font
  7. DIM SHARED lmargin%, rmargin%, topmargin%, screenwidth%, level, ibk, ileadingrow
  8. DIM SHARED irow, icol, inextrnd, imaxalienmissiles, alienforce%, ileadingmax, imaxalienforce, ihits, score$
  9.  
  10. SCREEN 0, 0, 0, 0
  11. swidth = _WIDTH
  12.  
  13. score$ = "000000"
  14. imaxalienforce = 6
  15. imaxalienmissiles = 3
  16. lmargin% = 2
  17. rmargin% = 79
  18. topmargin% = 3
  19. ialiencolstat = 6
  20. iwin = 3 ' 3 Levels.
  21. screenwidth% = rmargin% - lmargin% + 1
  22. ibk = 0 ' Background color
  23.  
  24. DIM SHARED a(imaxalienforce) AS STRING * 68
  25.  
  26. 'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.
  27. 'font& = _LOADFONT(fontpath$, 25, "monospace")
  28. '_FONT font&
  29.  
  30. score$ = "069000": CALL displayhighscores: RUN
  31.  
  32. SUB displayhighscores
  33.  
  34.     COLOR 0, 3
  35.     LOCATE 25, 68: PRINT "Score "; score$;
  36.  
  37.     DIM hs AS STRING * 25
  38.     REDIM highscore$(6), hsdata$(6)
  39.     DO
  40.         ''' IF _FILEEXISTS("ascii-invaders-high-score.dat") THEN
  41.         ''' OPEN "ascii-invaders-high-score.dat" FOR RANDOM AS #1 LEN = 25
  42.         ''' FOR i = 1 TO 5
  43.         ''' GET #1, i, hs
  44.         ''' highscore$(i) = MID$(hs, 10, 6): hsdata$(i) = hs
  45.         ''' NEXT
  46.         ''' CLOSE #1
  47.         ''' ELSE
  48.         FOR i = 1 TO 5
  49.             hsdata$(i) = SPACE$(25)
  50.         NEXT
  51.         ''' END IF
  52.  
  53.         IF VAL(score$) > VAL(highscore$(5)) THEN
  54.  
  55.             IF VAL(score$) > VAL(highscore$(1)) THEN
  56.                 msg$ = " HIGH SCORE / Enter Your Initials! "
  57.             ELSE
  58.                 msg$ = " Top 5 Score. Enter Your Initials! "
  59.             END IF
  60.  
  61.             GOSUB hiscore
  62.  
  63.             a = 14
  64.             OUT &H3C8, 0
  65.             OUT &H3C9, 20 - a
  66.             OUT &H3C9, 20 - a
  67.             OUT &H3C9, 20 - a
  68.  
  69.             OUT &H3C8, 8
  70.             OUT &H3C9, 30 - a
  71.             OUT &H3C9, 30 - a
  72.             OUT &H3C9, 30 - a
  73.  
  74.             OUT &H3C8, 7
  75.             OUT &H3C9, 30 - a
  76.             OUT &H3C9, 30 - a
  77.             OUT &H3C9, 30 - a
  78.  
  79.             OUT &H3C8, 3
  80.             OUT &H3C9, 30 - a
  81.             OUT &H3C9, 30 - a
  82.             OUT &H3C9, 30 - a
  83.  
  84.             GOSUB hardware_overlay
  85.  
  86.             _FONT 16
  87.  
  88.             COLOR White, 0
  89.             t$ = msg$
  90.             PSLC 4.6, 41 - LEN(msg$) \ 2, t$
  91.  
  92.             font = _LOADFONT("lucon.ttf", 20, "monospace")
  93.             IF font <= 0 THEN font = 16
  94.             _FONT font
  95.  
  96.             DEF SEG = 0
  97.             delay = .4
  98.             lscr = 19
  99.             z3 = TIMER
  100.             DO
  101.                 initials$ = "": i = 0: nxt = 0
  102.                 COLOR , _RGB(24, 24, 24): t$ = "   " ' Blank initials for redo. Okay to blank at start.
  103.                 PSL 5 + rank * 2, lscr, t$
  104.                 _DISPLAY
  105.                 DO
  106.                     _LIMIT 60
  107.                     IF ABS(z3 - TIMER) > .3 AND kflag > -2 THEN
  108.                         underline 5 + rank * 2, lscr + nxt, 0
  109.                         _DISPLAY
  110.                         z3 = TIMER
  111.                     END IF
  112.  
  113.                     SELECT CASE kflag
  114.                         CASE 0
  115.                             IF ABS(z1 - TIMER) > 1.5 AND i AND nxt < 3 THEN
  116.                                 SOUND 1500, 1
  117.                                 underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  118.                                 _DISPLAY
  119.                                 initials$ = initials$ + CHR$(64 + i)
  120.                                 nxt = nxt + 1 ' Next initial
  121.                                 i = 0 ' Reset alphabet.
  122.                                 z1 = TIMER
  123.                                 IF nxt = 3 THEN
  124.                                     kflag = -2 ' All 3 initials have been input.
  125.                                     underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  126.                                     _DISPLAY
  127.                                 END IF
  128.                             END IF
  129.  
  130.                             IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  131.                                 kflag = -1 ' Alt key pressed.
  132.                                 z1 = TIMER: z2 = TIMER
  133.                                 i = i + 1: IF i > 26 THEN i = 1
  134.                                 COLOR , _RGB(24, 24, 24): t$ = " "
  135.                                 PSL 5 + rank * 2, lscr + nxt, t$
  136.                                 COLOR DarkOrange: t$ = CHR$(64 + i)
  137.                                 SOUND 1000, .1
  138.                                 PSL 5 + rank * 2, lscr + nxt, t$
  139.                                 underline 5 + rank * 2, lscr + nxt, 0
  140.                                 _DISPLAY
  141.                             END IF
  142.                         CASE -1
  143.                             IF ABS(z2 - TIMER) > 2 THEN ' Key down long enough to indicate redo input.
  144.                                 IF nxt > 0 THEN ' Redo last initial input.
  145.                                     SOUND 300, .5
  146.                                     FOR nxt = 0 TO 3
  147.                                         underline 5 + rank * 2, lscr + nxt, -1: uflag = 0
  148.                                     NEXT
  149.                                     nxt = 0: i = 0
  150.                                     initials$ = ""
  151.                                     COLOR , _RGB(24, 24, 24): t$ = "   "
  152.                                     PSL 5 + rank * 2, lscr, t$
  153.                                     _DISPLAY
  154.                                     z1 = TIMER ' Reset enter timer.
  155.                                 ELSE
  156.                                     SOUND 300, .5
  157.                                     i = 0
  158.                                     COLOR , _RGB(24, 24, 24): t$ = " "
  159.                                     PSL 5 + rank * 2, lscr, t$
  160.                                     _DISPLAY
  161.                                     z1 = TIMER ' Reset enter timer.
  162.                                 END IF
  163.                                 z2 = TIMER
  164.                             END IF
  165.  
  166.                             IF PEEK(1047) MOD 16 <> 7 AND PEEK(1047) MOD 16 <> 8 THEN ' Alt key was released.
  167.                                 kflag = 0 ' Alt key up
  168.                                 z1 = TIMER
  169.                             END IF
  170.                         CASE -2 ' Finished. Initials will flash until confirmed by 2-second timer.
  171.                             z1 = TIMER: z2 = TIMER
  172.                             j = 0
  173.                             DO
  174.                                 IF ABS(z1 - TIMER) > .3 THEN j = -j - 1: z1 = TIMER
  175.                                 IF j THEN
  176.                                     COLOR DarkOrange: t$ = initials$
  177.                                     PSL 5 + rank * 2, lscr, t$
  178.                                     _DISPLAY
  179.                                 ELSE
  180.                                     COLOR _RGB(24, 24, 24): t$ = initials$
  181.                                     PSL 5 + rank * 2, lscr, t$
  182.                                     _DISPLAY
  183.                                 END IF
  184.  
  185.                                 IF ABS(z2 - TIMER) > 2.5 AND j THEN
  186.                                     kflag = -3
  187.                                     EXIT DO
  188.                                 END IF
  189.  
  190.                                 IF PEEK(1047) MOD 16 = 7 OR PEEK(1047) MOD 16 = 8 THEN
  191.                                     BEEP
  192.                                     kflag = -4
  193.                                     EXIT DO
  194.                                 END IF
  195.                             LOOP
  196.                         CASE -3
  197.                             _DELAY 1
  198.                             l$ = "8"
  199.                             n$ = "n24": PLAY "L" + l$ + n$
  200.                             n$ = "n28": PLAY "L" + l$ + n$
  201.                             n$ = "n28": PLAY "L" + l$ + n$
  202.                             l$ = "7"
  203.                             n$ = "n31": PLAY "L" + l$ + n$
  204.                             l$ = "9"
  205.                             n$ = "n28": PLAY "L" + l$ + n$
  206.                             l$ = "3"
  207.                             n$ = "n31": PLAY "L" + l$ + n$
  208.                             kflag = 1
  209.                             _DELAY 1: EXIT DO
  210.                         CASE -4
  211.                             kflag = 0 ' Repeat enter initials
  212.                             nxt = 0
  213.                             i = 0
  214.                             EXIT DO
  215.                     END SELECT
  216.                 LOOP
  217.                 IF kflag > 0 THEN kflag = 0: EXIT DO ' Exit routine.
  218.             LOOP
  219.             DEF SEG
  220.  
  221.             hsname$ = initials$
  222.  
  223.             MID$(hsdata$(rank), 5, 3) = hsname$ + SPACE$(3 - LEN(hsname$))
  224.             '''OPEN "ascii-invaders-high-score.dat" FOR RANDOM AS #1 LEN = 25
  225.             '''FOR i = 1 TO 5
  226.             ''' hs = hsdata$(i)
  227.             '''IF LEFT$(hs, 1) = "" THEN MID$(hs, 1, 2) = "0" + LTRIM$(STR$(i))
  228.             '''PUT #1, i, hs
  229.             '''NEXT
  230.             '''CLOSE #1
  231.  
  232.             _DELAY 1
  233.             _DISPLAY ' Remove scoreboard.
  234.             _DELAY 1
  235.             _FREEIMAGE Overlay
  236.             _FONT 16 'select inbuilt 8x16 default font
  237.             _FREEFONT font
  238.  
  239.             _DEST 0 'Reset dest back to the normal screen 0.
  240.  
  241.             _AUTODISPLAY
  242.             COLOR 6, 0
  243.             msg$ = SPACE$(40)
  244.             LOCATE 4, 41 - LEN(msg$) \ 2
  245.             PRINT msg$;
  246.             PALETTE
  247.             _DELAY 1
  248.  
  249.             EXIT DO
  250.         ELSE
  251.             EXIT DO ' Not in the top 5 highest scores so exit sub.
  252.         END IF
  253.     LOOP
  254.     EXIT SUB
  255.  
  256.     hardware_overlay:
  257.     Overlay = _NEWIMAGE(_WIDTH * _FONTWIDTH, _HEIGHT * _FONTHEIGHT, 32)
  258.  
  259.     _DEST Overlay
  260.     _DISPLAY ' Turn autodisplay off.
  261.  
  262.     font = _LOADFONT("lucon.ttf", 20, "monospace")
  263.     IF font <= 0 THEN font = 16
  264.     _FONT font
  265.  
  266.     bxy% = 3
  267.     bxx% = 13
  268.     COLOR DarkOrange, 0
  269.     t$ = " " + CHR$(218) + STRING$(27, CHR$(196)) + CHR$(191) + " "
  270.     PSL bxy%, bxx% - 1, t$
  271.     FOR i = 1 TO 12
  272.         t$ = " " + CHR$(179) + STRING$(27, CHR$(32)) + CHR$(179) + " "
  273.         PSL bxy% + i, bxx% - 1, t$
  274.     NEXT
  275.     t$ = " " + CHR$(192) + STRING$(27, CHR$(196)) + CHR$(217) + " "
  276.     PSL bxy% + i, bxx% - 1, t$
  277.  
  278.     bxy% = 4
  279.     COLOR Black, DarkOrange
  280.     t$ = "    NAME   SCORE    DATE   "
  281.     PSL bxy% + 1, bxx% + 1, t$
  282.  
  283.     COLOR DarkOrange, 0
  284.     FOR i = 1 TO 5
  285.         t$ = hsdata$(i)
  286.         PSL bxy% + 1 + i * 2, bxx% + 2, t$
  287.     NEXT
  288.  
  289.     _DISPLAY
  290.  
  291.     RETURN
  292.  
  293.     hiscore:
  294.     FOR i = 1 TO 5
  295.         IF VAL(score$) > VAL(highscore$(i)) THEN rank = i: EXIT FOR
  296.     NEXT
  297.  
  298.     hsdata$(6) = SPACE$(25)
  299.     MID$(hsdata$(6), 10, 6) = score$
  300.     MID$(hsdata$(6), 18, 8) = MID$(DATE$, 1, 6) + MID$(DATE$, 9, 2)
  301.     highscore$(6) = score$
  302.     FOR i = 1 TO 6
  303.         FOR j = 1 TO 6
  304.             IF i <> j THEN
  305.                 IF VAL(highscore$(i)) > VAL(highscore$(j)) THEN
  306.                     SWAP highscore$(i), highscore$(j)
  307.                     SWAP hsdata$(i), hsdata$(j)
  308.                 END IF
  309.             END IF
  310.         NEXT
  311.     NEXT
  312.     FOR i = 1 TO 5
  313.         MID$(hsdata$(i), 1, 2) = "0" + LTRIM$(STR$(i))
  314.     NEXT
  315.  
  316.     RETURN
  317.  
  318.  
  319. SUB PSLC (y, x, t$)
  320.     _PRINTSTRING ((x - 1) * 8, (y - 1) * 16), t$
  321.  
  322. SUB PSL (y, x, t$)
  323.     _PRINTSTRING ((x - 1) * _FONTWIDTH, (y - 1) * _FONTHEIGHT), t$
  324.     Overlay_Hardware = _COPYIMAGE(Overlay, 33)
  325.     _PUTIMAGE (0, 0), Overlay_Hardware
  326.  
  327. SUB underline (y, x, uflag)
  328.     STATIC ucnt
  329.     ucnt = -ucnt - 1
  330.     IF ucnt OR uflag THEN
  331.         LINE ((x - 1) * _FONTWIDTH, y * _FONTHEIGHT)-((x - 1) * _FONTWIDTH + 12, y * _FONTHEIGHT), _RGB(24, 24, 24), BF
  332.     ELSE
  333.         LINE ((x - 1) * _FONTWIDTH, y * _FONTHEIGHT)-((x - 1) * _FONTWIDTH + 12, y * _FONTHEIGHT), DarkOrange, BF
  334.     END IF
  335.  
  336.     Overlay_Hardware = _COPYIMAGE(Overlay, 33)
  337.     _PUTIMAGE (0, 0), Overlay_Hardware

Pete
Title: Re: Competition
Post by: bplus on October 20, 2021, 04:42:18 pm
OK Pete what did you edit? :)

I tested before edit and was going to request you cycle back through capital letters if missed on first run through, you are or were cycling through all of ASCII yikes!

But I was able to get my initials a couple of times if I was careful not to accidently go past the letter to wait on, I would say much improved but more tweaks ahead.

Also I put the call to sub in loop and it never looped around again and again for practice, just one run in sub and it quits.
Title: Re: Competition
Post by: Pete on October 20, 2021, 05:01:56 pm
Yeah, I noticed that loop situation and edited it, along with a couple of other small tweaks. I'm thinking of having it flash the initials once the last one is input, and if the user doesn't engage the Alt key while flashing, it finishes. If the user does engage the Alt key, it does a redo.

Pete
Title: Re: Competition
Post by: Pete on October 20, 2021, 06:26:45 pm
Okay, see newly edited and revised version with flashing 3-initials at end of input so user can press Alt to redo.

Pete
Title: Re: Competition
Post by: bplus on October 20, 2021, 08:53:33 pm
Yes that's working for me, just need to remember if it's flashing and correct to leave it alone. Good by me.
Title: Re: Competition
Post by: Pete on October 20, 2021, 09:03:21 pm
I added one more small tweak, the ability to redo the first initial if you go past it.

Yes, this one-button challenge is certainly doable, but waiting as input instead of action for input is a bit hard to get used to at first.

Thanks for taking it for a test run!

Pete
Title: Re: Competition
Post by: jack on October 20, 2021, 09:52:20 pm
Pete, that last initials routine works really well
Title: Re: Competition
Post by: Pete on October 20, 2021, 10:40:42 pm
@jack Yep. it's a keeper.

I incorporated it just now to the game at: https://www.qb64.org/forum/index.php?topic=4245.msg137017#msg137017

Thanks for trying it out!

Pete
Title: Re: Competition
Post by: bplus on October 21, 2021, 04:05:28 pm
@Pete Just tested latest update with High Score tracking, excellent!

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Competition
Post by: bplus on October 21, 2021, 04:07:47 pm
@Pete Have you thought about a _Title " ??? "
Title: Re: Competition
Post by: Pete on October 21, 2021, 11:23:54 pm
Okay, I just made another update with a title. See Edit notes for additions.

https://www.qb64.org/forum/index.php?topic=4245.msg137017#msg137017

Pete
Title: Re: Competition
Post by: bplus on November 01, 2021, 12:41:12 pm
Well I am voting for Pete's, a great remake of an old program with plenty of mods to make it new and better. Nice application of the one key restriction specially including entering initials in high scores section. Great Halloween theme adaptation plus we get one of The Bob's masterpieces included.

And besides me who else tried? Dav had a couple of abandoned projects, the Witch and Candy thing had potential, maybe next year! Steve also had half hearted thing started but maybe saving for the Christmas rush :-))

@Pete nice strategy to post early and scare everyone off! :) Would you (or with your permission I will) post a copy in Programs section so that it might be accessed later from Library Games section for comments and feedback from the future.
Title: Re: Competition
Post by: SMcNeill on November 01, 2021, 01:00:18 pm
Aye.  I just didn't have time.  Halloween is always crazy busy here on the farm.
Title: Re: Competition
Post by: Qwerkey on November 01, 2021, 01:08:51 pm
Well I am voting for Pete's

Are we ready to place in the Library?

By the way, Fellippe pointed out to me that "Library" has its Special Meaning in the coding sphere.  @bplus & I are Librarians, but can anybody think of an alternative word for our curated works section?
Title: Re: Competition
Post by: bplus on November 01, 2021, 01:18:22 pm
Are we ready to place in the Library?

By the way, Fellippe pointed out to me that "Library" has its Special Meaning in the coding sphere.  @bplus & I are Librarians, but can anybody think of an alternative word for our curated works section?

Well I did say a week for voting and no one (me) can't vote for them self so, but give it a week, no hurry. It'd be a shame if Pete won by only one vote. Dav, Steve and TempodiBasic can say something because they participated in the one key part. Pete has to stay quiet or he'll cause a tie LOL!

@Qwerkey, how about Curators? or Caretakers?
Google says for synonyms:
Quote
curator
noun
custodian
keeper
conservator
guardian
caretaker
steward

PS I forgot to mention Cobalt who also gave one key a try with Halloween theme, sorry I saved best for last ;-))
Title: Re: Competition
Post by: bplus on November 08, 2021, 11:01:38 am
OK @Qwerkey 1 week wait is over, thanks to all who participated.

I made a zip package of Pete's One Key Halloween code, Winner of the One Key Halloween 2021 Competition.
I am pretty sure it is the most up-to-date copy of Pete's edits, just source and sound files.
See if it works OK for you and check with Pete about credits and permission to post in Programs Board.

Title: Re: Competition
Post by: Qwerkey on November 08, 2021, 12:45:45 pm
@bplus Aye, aye cap'n will do.
Title: Re: Competition
Post by: xra7en on November 08, 2021, 05:57:25 pm
long thread on this

I thought of a good one (too lazy right now ) but how about a woodpecker on a tree.

1 key move left and right - to avoid falling walnuts (or w/e) sorta like a flappy bird but one key!
each hit of the key switches sides :-)

random nuts fall

time speed up.


could be addictive.
humans are weird like that

Title: Re: Competition
Post by: bplus on November 08, 2021, 06:43:39 pm
@xra7en

Interesting idea, save it for Christmas to help Santa get down chimney :-))
Title: Re: Competition
Post by: xra7en on November 08, 2021, 08:05:44 pm
Ho ho ho!

love it.

dodging coal!