03-23-2005, 04:06 PM
Challenge partly completed:
YES i know there are 2 extra sprites, but i will only have to tweak the code slightly to get it to include multiple sprite
Code:
DIM UFO(1000), ship(1000), shot(1000)
CLS
SCREEN 7, 0, 1, 0
FOR y = 1 TO 8
FOR x = 1 TO 8
READ shipclr
PSET (x, y), shipclr
NEXT
NEXT
DATA 00,15,15,15,15,15,15,00
DATA 15,15,15,15,15,15,15,15
DATA 15,00,15,15,15,15,00,15
DATA 15,15,15,15,15,15,15,15
DATA 15,15,15,00,00,15,15,15
DATA 15,00,15,15,15,15,00,15
DATA 15,00,15,15,15,15,00,15
DATA 15,00,00,00,00,00,00,15
GET (1, 1)-(8, 8), ship
CLS
FOR y = 1 TO 5
FOR x = 1 TO 9
READ ufoclr
PSET (x, y), ufoclr
NEXT: NEXT
DATA 00,00,15,15,15,15,15,00,00
DATA 00,15,15,15,15,15,15,15,00
DATA 00,15,00,15,00,15,00,15,00
DATA 00,15,15,15,15,15,15,15,00
DATA 15,15,15,15,15,15,15,15,15
GET (1, 1)-(9, 5), UFO
CLS
FOR y = 1 TO 5
FOR x = 1 TO 9
READ shotclr
PSET (x, y), shotclr
NEXT: NEXT
DATA 00,00,00,00,15,00,00,00,00
DATA 00,00,00,00,15,00,00,00,00
DATA 00,00,15,15,15,15,15,00,00
DATA 00,15,15,15,15,15,15,15,00
DATA 15,15,15,15,15,15,15,15,15
GET (1, 1)-(9, 5), shot
CLS
x = 280
y = 10
espeed = 1
playerx = 25
playery = 190
DO
PCOPY 1, 0
CLS
key$ = INKEY$
IF shot = 1 AND sx > x AND sx < x + 9 AND sy > y AND sy < y + 5 THEN
shot = 0
END
END IF
IF shot = 1 THEN
sy = sy - 2
PSET (sx, sy)
END IF
IF e <> 1 THEN
PUT (x, y), UFO
x = x - espeed
END IF
IF x <= 20 THEN
espeed = -1
y = y + 9
END IF
IF x >= 280 THEN
espeed = 1
y = y + 10
END IF
IF y >= 200 THEN
PCOPY 1, 0
FOR i = 1 TO 100
PRINT "Game Over"
PCOPY 1, 0
NEXT
END
END IF
IF playerx >= 20 AND key$ = "a" THEN playerx = playerx - 5
IF playerx <= 280 AND key$ = "d" THEN playerx = playerx + 5
PUT (playerx, playery), shot
IF x = playerx AND y = playery THEN
PCOPY 1, 0
FOR i = 1 TO 100
PRINT "Game Over"
PCOPY 1, 0
NEXT
END
END IF
IF key$ = "s" THEN
shot = 1
sx = playerx + 4
sy = playery
PSET (sx, sy)
END IF
LOOP WHILE key$ <> CHR$(27)
END
YES i know there are 2 extra sprites, but i will only have to tweak the code slightly to get it to include multiple sprite