Ok, Asteroid is ja auch das erste game, das ich jemals auf dem PC programmiert hab ^^
Und bandit hab ich *fast* nur von meinem Taschenrechner abgeschrieben; es ist mal in Mathe entstanden...
Hättest du mal Inavder gespielt ^^.
Die Garfik ist die selbe, aber dafür gibt´s wenigtens so ne Art KI und nen Multiplayermode
Achso, wo ich schonmal bei invader bin, villeicht könnt ihr mir bei einem Problem helfen, das ich schonmal in ner Newsgroup gepostet hab.
Leider gab´s noch keine antwort...
Das ist zwar absolut offtopic, aber:
I thought about saving the control settings of my little games in a
control.txt file.
Well, it works with all keys exept the ones whiches ASCII code contains
something like chr$(0)+...
So, here is the problem:
OPEN "control.txt" FOR INPUT AS #1
INPUT #1, up$
INPUT #1, down$
INPUT #1, lft$
INPUT #1, rght$
INPUT #1, fire$
INPUT #1, up2$
INPUT #1, down2$
INPUT #1, lft2$
INPUT #1, rght2$
INPUT #1, fire2$
CLOSE
This runns at the top of the program instead of up$ = CHR$(0) + "H" (in
Invader, for example)
later, in the setup part of the menue:
setup:
COLOR 7, 0
CLS
LOCATE 15, 15: PRINT "Press key for up"
DO: up$ = INKEY$: LOOP WHILE up$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for down"
DO: down$ = INKEY$: LOOP WHILE down$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for left"
DO: lft$ = INKEY$: LOOP WHILE lft$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for right"
DO: rght$ = INKEY$: LOOP WHILE rght$ = ""
CLS
CLS
LOCATE 15, 15: PRINT "Press key for fire"
DO: fire$ = INKEY$: LOOP WHILE fire$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for up"
DO: up2$ = INKEY$: LOOP WHILE up2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for down"
DO: down2$ = INKEY$: LOOP WHILE down2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for left"
DO: lft2$ = INKEY$: LOOP WHILE lft2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for right"
DO: rght2$ = INKEY$: LOOP WHILE rght2$ = ""
CLS
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for fire"
DO: fire2$ = INKEY$: LOOP WHILE fire2$ = ""
OPEN "control.txt" FOR OUTPUT AS #1
WRITE #1, up$
WRITE #1, down$
WRITE #1, lft$
WRITE #1, rght$
WRITE #1, fire$
WRITE #1, up2$
WRITE #1, down2$
WRITE #1, lft2$
WRITE #1, rght2$
WRITE #1, fire2$
CLOSE
GOTO wahl2
If I press the keys for player one and take something like arrow up (CHR$(0)
+ "H") and so on, in the controls.txt there is the following:
" H"
" P"
" K"
" M"
" "
"w"
"s"
"a"
"d"
" "
Player 1 can´t move any more, he only can shot. Player 2 can do all the
things he wants to do. These are the controlthings of player 1 (the oners of
player 2 are the same, there is only a "2" behind the variables.)
IF INKEY$ = rght$ THEN
LOCATE B, A: PRINT " "
A = A + 1
IF A > 70 THEN
A = 2
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = lft$ THEN
LOCATE B, A: PRINT " "
A = A - 1
IF A < 1 THEN
A = 70
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = up$ THEN
LOCATE B, A: PRINT " "
B = B - 1
IF B < 1 THEN
B = 1
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = down$ THEN
LOCATE B, A: PRINT " "
B = B + 1
IF B > 23 THEN
B = 23
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = fire$ AND shot <> 1 THEN
shot = 1
BulettY = B - 1
BulettX = A
END IF
So what can I do to use the arrow keys and save them?
With up$ = CHR$(0) + "H" everything worked, but you had to configurate the
controls after every restart of the program again and again...
Thank you for help!
(Sorry, ich hab´s nur kopiert, es muss mal ohne code tags gehen...)
Hier nochmal der ganze Invader code:
Code: Alles auswählen
CLS
up$ = CHR$(0) + "H"
down$ = CHR$(0) + "P"
lft$ = CHR$(0) + "K"
rght$ = CHR$(0) + "M"
fire$ = CHR$(32)
up2$ = "w"
down2$ = "s"
lft2$ = "a"
rght2$ = "d"
fire2$ = "q"
shot2 = 0
A = 25
B = 23
A2 = 30
B2 = 22
shot2 = 0
Life2 = 3
score = 0
level = 2
DIM GegnerX(100)
DIM GegnerY(100)
DIM Gegnershot(100)
DIM shotX(100)
DIM shotY(100)
life = 3
FOR x = 1 TO level
RANDOMIZE TIMER
GegnerX(x) = INT(70 * RND + 1)
GegnerY(x) = INT(20 * RND + 1)
NEXT
LOCATE 4, 20: COLOR 14: PRINT "B"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 21: COLOR 14: PRINT "e"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 22: COLOR 14: PRINT "n"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 23: COLOR 14: PRINT "p"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 24: COLOR 14: PRINT "i"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 25: COLOR 14: PRINT "c"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 26: COLOR 14: PRINT "c"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 27: COLOR 14: PRINT "o"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .2
LOCATE 4, 28: COLOR 14: PRINT "S"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .1
LOCATE 4, 29: COLOR 14: PRINT "o"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .1
LOCATE 4, 30: COLOR 14: PRINT "f"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .1
LOCATE 4, 31: COLOR 14: PRINT "t"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .1
SLEEP 1
LOCATE 5, 25: PRINT "Games"
SLEEP 1
FOR x = 1 TO 22
LOCATE 6, x: PRINT " Presents"
starttime! = TIMER
DO
LOOP UNTIL TIMER > starttime! + .01
NEXT
SLEEP 1
FOR hz = 100 TO 1000 STEP 100
SOUND hz, 2
NEXT
COLOR 6
LOCATE 8, 18: PRINT "Invader"
SLEEP 1
start:
COLOR 7, 0
LOCATE 10, 20: PRINT "Start Game"
LOCATE 11, 20: PRINT "Setup"
LOCATE 12, 20: PRINT "Stroy"
wahl1:
COLOR 7, 0
CLS
COLOR 7, 0
LOCATE 10, 20: PRINT "Start Game"
LOCATE 11, 20: PRINT "Setup"
LOCATE 12, 20: PRINT "Stroy"
LOCATE 13, 20: PRINT "Multiplayer"
LOCATE 4, 20: COLOR 14: PRINT "BenpiccoSoft"
LOCATE 5, 25: PRINT "Games"
LOCATE 6, 23: PRINT "Presents"
COLOR 6
LOCATE 8, 18: PRINT "Invader"
LOCATE 10, 20: COLOR 7, 4: PRINT "Start Game"
DO: taste$ = INKEY$: LOOP WHILE taste$ = ""
SELECT CASE taste$
CASE CHR$(13): CLS : GOTO begin
CASE CHR$(0) + "P": GOTO wahl2
CASE CHR$(0) + "H": GOTO wahl4
CASE ELSE: GOTO wahl1
END SELECT
wahl2:
COLOR 7, 0
CLS
COLOR 7, 0
LOCATE 10, 20: PRINT "Start Game"
LOCATE 11, 20: PRINT "Setup"
LOCATE 12, 20: PRINT "Stroy"
LOCATE 13, 20: PRINT "Multiplayer"
LOCATE 4, 20: COLOR 14: PRINT "BenpiccoSoft"
LOCATE 5, 25: PRINT "Games"
LOCATE 6, 23: PRINT "Presents"
COLOR 6
LOCATE 8, 18: PRINT "Invader"
LOCATE 11, 20: COLOR 7, 4: PRINT "Setup"
COLOR 7, 0
DO: taste$ = INKEY$: LOOP WHILE taste$ = ""
SELECT CASE taste$
CASE CHR$(13): CLS : GOTO setup
CASE CHR$(0) + "P": GOTO wahl3
CASE CHR$(0) + "H": GOTO wahl1
CASE ELSE: GOTO wahl2
END SELECT
setup:
COLOR 7, 0
CLS
LOCATE 15, 15: PRINT "Press key for up"
DO: up$ = INKEY$: LOOP WHILE up$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for down"
DO: down$ = INKEY$: LOOP WHILE down$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for left"
DO: lft$ = INKEY$: LOOP WHILE lft$ = ""
CLS
LOCATE 15, 15: PRINT "Press key for right"
DO: rght$ = INKEY$: LOOP WHILE rght$ = ""
CLS
CLS
LOCATE 15, 15: PRINT "Press key for fire"
DO: fire$ = INKEY$: LOOP WHILE fire$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for up"
DO: up2$ = INKEY$: LOOP WHILE up2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for down"
DO: down2$ = INKEY$: LOOP WHILE down2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for left"
DO: lft2$ = INKEY$: LOOP WHILE lft2$ = ""
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for right"
DO: rght2$ = INKEY$: LOOP WHILE rght2$ = ""
CLS
CLS
LOCATE 15, 15: PRINT "Player 2, Press key for fire"
DO: fire2$ = INKEY$: LOOP WHILE fire2$ = ""
GOTO wahl2
wahl3:
COLOR 7, 0
CLS
COLOR 7, 0
LOCATE 10, 20: PRINT "Start Game"
LOCATE 11, 20: PRINT "Setup"
LOCATE 12, 20: PRINT "Stroy"
LOCATE 13, 20: PRINT "Multiplayer"
LOCATE 4, 20: COLOR 14: PRINT "BenpiccoSoft"
LOCATE 5, 25: PRINT "Games"
LOCATE 6, 23: PRINT "Presents"
COLOR 6
LOCATE 8, 18: PRINT "Invader"
LOCATE 12, 20: COLOR 7, 4: PRINT "Story"
COLOR 7, 0
DO: taste$ = INKEY$: LOOP WHILE taste$ = ""
SELECT CASE taste$
CASE CHR$(13): CLS : GOTO story
CASE CHR$(0) + "H": GOTO wahl2
CASE CHR$(0) + "P": GOTO wahl4
CASE ELSE: GOTO wahl3
END SELECT
story:
CLS
COLOR 7, 1
CLS
PRINT "You are the captan of a spaceship, the U.S.S. Developer."
PRINT "But on an ordanary mission your ship came into a field of asteroids!"
PRINT "You could escape, but suddely there are other ships."
PRINT "And they donït look friendly. So you have do defend yourself."
PRINT "Good luck!"
SLEEP
GOTO wahl3
wahl4:
COLOR 7, 0
CLS
COLOR 7, 0: LOCATE 8, 18: PRINT "Invader"
LOCATE 10, 20: PRINT "Start Game"
LOCATE 11, 20: PRINT "Setup"
LOCATE 12, 20: PRINT "Stroy"
LOCATE 4, 20: COLOR 14: PRINT "BenpiccoSoft"
LOCATE 5, 25: PRINT "Games"
LOCATE 6, 23: PRINT "Presents"
COLOR 6: LOCATE 8, 18: PRINT "Invader"
LOCATE 13, 20: COLOR 7, 12: PRINT "Multiplayer"
COLOR 7, 0
DO: taste$ = INKEY$: LOOP WHILE taste$ = ""
SELECT CASE taste$
CASE CHR$(13): CLS : multiplayer = 1: GOTO begin
CASE CHR$(0) + "H": GOTO wahl3
CASE CHR$(0) + "P": GOTO wahl1
CASE ELSE: GOTO wahl3
END SELECT
begin:
COLOR 15, 0
CLS
PRINT "Dificulty"
PRINT "1=easy"
PRINT "2=normal"
PRINT "3=hard"
PRINT "4=crasy"
INPUT "", dif%
SELECT CASE dif%
CASE 1: IQA = 30
CASE 2: IQA = 20
CASE 3: IQA = 10
CASE 4: IQA = 5
CASE ELSE: GOTO begin
END SELECT
amount:
CLS
INPUT "Ammount of enemys ", level
IF level > 100 THEN
GOTO amount
END IF
CLS
FOR x = 1 TO level
GegnerX(x) = INT(65 * RND) + 1
GegnerY(x) = INT(20 * RND) + 1
NEXT
1 :
RANDOMIZE TIMER
Getkey$ = INKEY$
IF (INT((IQA * 10) * RND)) = 5 AND leben = 0 THEN
leben = 1
LebenX = INT(65 * RND) + 1
lebenY = INT(20 * RND) + 1
YP = 1
END IF
l = 0
IF score / 10 > IQA * 2 THEN
IQA = IQA + 1
END IF
IF score / 10 > level * 5 AND IQA > level * 10 THEN
level = level + 1
GegnerX(level) = INT(65 * RND) + 1
GegnerY(level) = INT(20 * RND) + 1
END IF
COLOR 15, 0
LOCATE 1, 71: PRINT score
RANDOMIZE TIMER
IF INKEY$ = fire$ AND shot <> 1 THEN
shot = 1
BulettY = B - 1
BulettX = A
END IF
LOCATE 22, 70: PRINT "Life:"
FOR l = life TO 1 STEP -1
LOCATE 23, (73 - l): PRINT CHR$(177)
NEXT
IF life = 0 THEN
LOCATE B, A: PRINT "XXX"
GOTO death
END IF
IF multilplayer = 1 THEN
LOCATE 20, 70: PRINT "Life:"
FOR l = Life2 TO 1 STEP -1
LOCATE 21, (73 - l): PRINT CHR$(178)
NEXT
END IF
IF leben = 1 AND lebenY <= 23 AND YP = 1 THEN
LOCATE lebenY, LebenX: PRINT "1UP"
YP = 2
LOCATE B, A: COLOR 15: PRINT ">-<"
FOR x = 1 TO level
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
NEXT
starttime! = TIMER
DO: LOOP UNTIL TIMER > starttime! + .001
LOCATE lebenY, LebenX: PRINT " "
lebenY = lebenY + 1
END IF
IF shot2 = 1 AND BulettY2 > 0 AND multiplayer = 1 THEN
LOCATE BulettY2, BulettX2: COLOR 4: PRINT "! !"
END IF
LOCATE B, A: COLOR 15: PRINT ">-<"
IF multiplayer = 1 THEN
GOTO multi
END IF
endmulti:
FOR x = 1 TO level
RANDOMIZE TIMER
IF INT(IQA * RND) = 1 THEN
GOTO enemy
END IF
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
NEXT
IF leben = 1 THEN
GOTO life
END IF
endleben:
IF shot = 1 AND BulettY > 0 THEN
LOCATE BulettY, BulettX: COLOR 14: PRINT "! !"
starttime! = TIMER
DO: LOOP UNTIL TIMER > starttime! + .01
LOCATE BulettY, BulettX: PRINT " "
BulettY = BulettY - 1
END IF
FOR x = 1 TO level
IF shot = 1 AND BulettY = GegnerY(x) AND BulettX + 1 = GegnerX(x) OR shot =
1 AND BulettY = GegnerY(x) AND BulettX = GegnerX(x) OR shot = 1 AND BulettY
= GegnerY(x) AND BulettX + 1 = GegnerX(x) THEN
score = score + 10
SOUND 1000, 1
SOUND 1500, 1
shot = 0
LOCATE GegnerY(x), GegnerX(x): PRINT " x "
LOCATE GegnerY(x), GegnerX(x): PRINT "xxx"
LOCATE GegnerY(x), GegnerX(x): PRINT "x x"
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = INT(65 * RND) + 1
GegnerY(x) = INT(20 * RND) + 1
END IF
NEXT
IF shot = 1 AND BulettY = 0 THEN
shot = 0
END IF
IF INKEY$ = rght$ THEN
LOCATE B, A: PRINT " "
A = A + 1
IF A > 70 THEN
A = 2
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = lft$ THEN
LOCATE B, A: PRINT " "
A = A - 1
IF A < 1 THEN
A = 70
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = up$ THEN
LOCATE B, A: PRINT " "
B = B - 1
IF B < 1 THEN
B = 1
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = down$ THEN
LOCATE B, A: PRINT " "
B = B + 1
IF B > 23 THEN
B = 23
END IF
LOCATE B, A: PRINT ">-<"
GOTO 1
END IF
IF Getkey$ = fire$ AND shot <> 1 THEN
shot = 1
BulettY = B - 1
BulettX = A
END IF
FOR x = 1 TO level
IF Gegnershot(x) = 1 AND shotY(x) < 23 THEN
LOCATE shotY(x), shotX(x): COLOR 12: PRINT CHR$(173) + " " + CHR$(173)
starttime! = TIMER
DO: LOOP UNTIL TIMER > starttime! + .01
LOCATE shotY(x), shotX(x): PRINT " "
shotY(x) = shotY(x) + 1
END IF
IF Gegnershot(x) = 1 AND shotY(x) = B AND shotX(x) + 1 = A OR Gegnershot(x)
= 1 AND shotY(x) = B AND shotX(x) + 1 = A + 1 OR Gegnershot(x) = 1 AND
shotY(x) = B AND shotX(x) + 2 = A + 1 THEN
SOUND 600, 1
SOUND 100, 2
LOCATE 23, (73 - life): PRINT " "
life = life - 1
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = GegnerX(x) + INT(3 * RND)
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
Gegnershot(x) = 0
END IF
IF Gegnershot(x) = 1 AND shotY(x) = 23 THEN
Gegnershot(x) = 0
END IF
NEXT
GOTO 1
death:
LOCATE 10, 30: COLOR 4: PRINT "game over"
SLEEP 1
COLOR 7
DO
LOOP UNTIL TIMER > starttime! + 1
starttime! = TIMER
OPEN "sav.sav" FOR INPUT AS #1
INPUT #1, highscore, typ$
CLOSE #1
PRINT "Highscore:"; highscore; typ$
IF score > highscore OR score2 > highscore THEN
PRINT "New Highscore!"
INPUT "Enter your name ", name$
OPEN "sav.sav" FOR OUTPUT AS #1
IF score >= score2 THEN
WRITE #1, score, name$
WRITE #1, "Do not change this file!"
CLOSE #1
END IF
IF score2 >= score THEN
WRITE #1, score2, name$
WRITE #1, "Do not change this file!"
CLOSE #1
END IF
SLEEP
END IF
SLEEP
CLS
Choice:
COLOR 15
PRINT "Continue?"
PRINT "yes/no"
INPUT "", Choice$
IF Choice$ = "Yes" OR Choice$ = "y" OR Choice$ = "YES" OR Choice$ = "Y" OR
Choice$ = "yes" THEN
score = 0
CLS
life = 3
shot = 0
Life2 = 3
shot2 = 0
GOTO begin
ELSE
IF Choice$ = "No" OR Choice$ = "n" OR Choice$ = "N" OR Choice$ = "NO" OR
Choice$ = "no" THEN
END
ELSE
CLS
GOTO Choice
END IF
END IF
enemy:
IF shot = 1 THEN
LOCATE BulettY, BulettX: COLOR 14: PRINT "! !"
END IF
COLOR 7
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
move = INT(IQA * RND + 1)
IF move > 5 THEN
GOTO 1
END IF
IF move = 1 AND GegnerX(x) < 70 OR INT(3 * RND) = 2 AND GegnerX(x) < A THEN
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = GegnerX(x) + 1
END IF
IF move = 2 AND GegnerX(x) > 1 OR INT(3 * RND) = 2 AND GegnerX(x) > A THEN
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = GegnerX(x) - 1
END IF
IF move = 3 AND GegnerY(x) < 22 THEN
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerY(x) = GegnerY(x) + 1
END IF
IF move = 4 AND GegnerX(x) > 1 THEN
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerY(x) = GegnerY(x) - 1
END IF
IF GegnerY(x) > 23 OR GegnerY(x) = 0 THEN
GegnerY(x) = 2
END IF
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
IF move = 5 AND Gegnershot(x) <> 1 THEN
Gegnershot(x) = 1
shotX(x) = GegnerX(x)
shotY(x) = GegnerY(x) + 1
END IF
GOTO 1
life:
YP = 1
IF lebenY >= 24 THEN
leben = 0
LOCATE 23, LebenX: PRINT " "
lebenY = 0
GOTO endleben
END IF
LOCATE lebenY, LebenX: PRINT "1UP"
IF lebenY = B AND LebenX + 1 = A OR lebenY = B AND LebenX + 1 = A + 1 OR
lebenY = B AND LebenX + 2 = A + 1 THEN
life = life + 1
score = score + 5
leben = 0
YP = 0
LOCATE lebenY, LebenX: PRINT " "
SOUND 1500, 3
SOUND 2000, 3
END IF
LOCATE lebenY, LebenX: PRINT " "
GOTO endleben
multi:
LOCATE 1, 1: PRINT score2
LOCATE 20, 70: PRINT "Life:"
FOR l = Life2 TO 1 STEP -1
LOCATE 21, (73 - l): PRINT CHR$(178)
NEXT
IF Life2 <= 0 THEN
LOCATE B2, A2: PRINT "XXX"
GOTO death
END IF
IF shot2 = 1 AND BulettY2 > 0 THEN
LOCATE BulettY2, BulettX2: COLOR 14: PRINT "! !"
starttime! = TIMER
DO: LOOP UNTIL TIMER > starttime! + .01
LOCATE BulettY2, BulettX2: PRINT " "
BulettY2 = BulettY2 - 1
END IF
FOR x = 1 TO level
IF shot2 = 1 AND BulettY2 = GegnerY(x) AND BulettX2 + 1 = GegnerX(x) OR
shot2 = 1 AND BulettY2 = GegnerY(x) AND BulettX2 = GegnerX(x) OR shot2 = 1
AND BulettY2 = GegnerY(x) AND BulettX2 + 1 = GegnerX(x) THEN
score2 = score2 + 10
SOUND 1000, 1
SOUND 1500, 1
shot2 = 0
LOCATE GegnerY(x), GegnerX(x): PRINT " x "
LOCATE GegnerY(x), GegnerX(x): PRINT "xxx"
LOCATE GegnerY(x), GegnerX(x): PRINT "x x"
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = INT(65 * RND) + 1
GegnerY(x) = INT(20 * RND) + 1
END IF
NEXT
IF shot2 = 1 AND BulettY2 = 0 THEN
shot2 = 0
END IF
IF leben = 1 THEN
IF lebenY = B2 AND LebenX + 1 = A2 OR lebenY = B2 AND LebenX + 1 = A2 + 1 OR
lebenY = B2 AND LebenX + 2 = A2 + 1 THEN
Life2 = Life2 + 1
score2 = score2 + 5
leben = 0
YP = 0
LOCATE lebenY, LebenX: PRINT " "
SOUND 1500, 3
SOUND 2000, 3
END IF
END IF
FOR x = 1 TO level
IF (Gegnershot(x) = 1 AND shotY(x) = B2 AND shotX(x) + 1 = A2) OR
(Gegnershot(x) = 1 AND shotY(x) = B2 AND shotX(x) + 1 = A2 + 1) OR
(Gegnershot(x) = 1 AND shotY(x) = B2 AND shotX(x) + 2 = A2 + 1) THEN
SOUND 600, 1
SOUND 100, 2
LOCATE 21, (73 - Life2): PRINT " "
Life2 = Life2 - 1
LOCATE GegnerY(x), GegnerX(x): PRINT " "
GegnerX(x) = GegnerX(x) + INT(3 * RND)
LOCATE GegnerY(x), GegnerX(x): PRINT "#-#"
Gegnershot(x) = 0
END IF
NEXT
LOCATE B2, A2: COLOR 15: PRINT ")^("
IF Getkey$ = rght2$ THEN
LOCATE B2, A2: PRINT " "
A2 = A2 + 1
IF A2 > 70 THEN
A2 = 2
END IF
LOCATE B2, A2: PRINT ")^("
GOTO endmulti
END IF
IF Getkey$ = lft2$ THEN
LOCATE B2, A2: PRINT " "
A2 = A2 - 1
IF A2 < 1 THEN
A2 = 70
END IF
LOCATE B2, A2: PRINT ")^("
GOTO endmulti
END IF
IF Getkey$ = up2$ THEN
LOCATE B2, A2: PRINT " "
B2 = B2 - 1
IF B2 < 1 THEN
B2 = 1
END IF
LOCATE B2, A2: PRINT ")^("
GOTO endmulti
END IF
IF Getkey$ = down2$ THEN
LOCATE B2, A2: PRINT " "
B2 = B2 + 1
IF B2 > 23 THEN
B2 = 23
END IF
LOCATE B2, A2: PRINT ")^("
GOTO endmulti
END IF
IF Getkey$ = fire2$ AND shot2 <> 1 THEN
shot2 = 1
BulettY2 = B2
BulettX2 = A2
END IF
GOTO endmulti