Post by Aldex on Mar 31, 2006 17:59:17 GMT -5
Hey all.
Tell me what do you think about this lil' game i made...
so what do you think about it???
Tell me what do you think about this lil' game i made...
'Space Ship 25X
'By Diego I. Pinate M.
resizeText(55,25)
struc player
dim x
dim y 'Shot Types:
dim hp '1 = normal
dim score '2 = dual
dim shotType
dim bulletOnScreen
endstruc
dim player ship
ship.x = 27
ship.y = 20 'Player Starting variables
ship.hp = 100
ship.shotType = 1
ship.bulletOnScreen = FALSE
dim bulletx,bullety,bullet2x,bullet2y
const enemyMax = 10
dim badx(enemyMax),bady(enemyMax),badOnScreen(enemyMax),badhp(enemyMax)
dim bombOnScreen(enemyMax),bombx(enemyMax),bomby(enemyMax)
dim PwrUpx,PwrUpy,PwrUpOnScreen,PwrUpOn
PwrUpOnScreen = FALSE
PwrUpOn = FALSE
dim i: i = 1
for i = 1 to enemyMax
badx(i) = rnd () % 50 'Set a number of baddies on game
bady(i) = rnd () % 30
badOnScreen(i) = TRUE
badhp(i) = 3
bombOnScreen(i) = FALSE
next
const starsMax = 50 'Stars for the space environment, also "*"
dim starx(starsMax), stary(starsMax)
dim s: s =1
for s = 1 to starsMax
starx(s) = rnd () % 50
stary(s) = rnd () % 17
next
TextMode(TEXT_BUFFERED)
while true
If ScanKeyDown(VK_UP) then
ship.y = ship.y - 1
endif
If ScanKeyDown(VK_DOWN) then
ship.y = ship.y + 1 'Movements
endif
If ScanKeyDown(VK_LEFT) then
ship.x = ship.x - 1
endif
If ScanKeyDown(VK_RIGHT) then
ship.x = ship.x + 1
endif
If ship.bulletOnScreen = TRUE then
If ship.shotType = 1 then
bullety = bullety - 1
endif
If ship.shotType = 2 then
bullety = bullety - 1
bullet2y = bullet2y - 1
endif
If bullety < 1 then
ship.bulletOnScreen = FALSE 'Shot thing
endif
If bullet2y < 1 and ship.shotType = 2 then
ship.bulletOnScreen = FALSE
endif
else
if ScanKeyDown(VK_SPACE) then
if ship.shotType = 1 then
bulletx = ship.x + 1
bullety = ship.y - 1
ship.bulletOnScreen = TRUE
endif
if ship.shotType = 2 then
bulletx = ship.x
bullety = ship.y - 1
bullet2x = ship.x + 2
bullet2y = ship.y - 1
ship.bulletOnScreen = TRUE
endif
endif
endif
cls
for s = 1 to starsMax
locate starx(s),stary(s):
Color(100,100,100)
print "*" 'First thing, draw stars on the back
stary(s) = stary(s) + 1
If stary(s) >= 25 then
stary(s) = 0
starx(s) = rnd () % 55
endif
next
if ship.bulletOnScreen = true then
if ship.shotType = 1 then
locate bulletx,bullety:
color(255,255,0)
print "!"
endif
if ship.shotType = 2 then
locate bulletx,bullety:
color(255,255,0)
print "!"
locate bullet2x,bullet2y:
color(255,255,0)
print "!"
endif
endif
for i = 1 to enemyMax
if badOnScreen(i) = TRUE then
locate badx(i),bady(i):
if badhp(i) = 3 then
Color(150,255,150)
endif
if badhp(i) = 2 then
Color(175,220,150) 'Color of the current hp
endif
if badhp(i) = 1 then
Color(255,150,150)
endif
print "[-]"
badx(i) = badx(i) + 1
if badx(i) > 50 then
badx(i) = 0
bady(i) = rnd () % 17
endif
if bulletx >= badx(i) - 1 and bulletx <= badx(i) +1 and bullety = bady(i) and badhp(i) > 0 then
ship.bulletOnScreen = FALSE
badhp(i) = badhp(i) - 1
ship.score = ship.score + 100
endif
if bullet2x >= badx(i) - 1 and bullet2x <= badx(i) +1 and bullet2y = bady(i) and badhp(i) > 0 then
ship.bulletOnScreen = FALSE
badhp(i) = badhp(i) - 1
ship.score = ship.score + 100
endif
if badhp(i) < 1 then
badOnScreen(i) = FALSE
endif
if ship.x >= badx(i) - 1 and ship.x <= badx(i) + 1 and ship.y = bady(i) then
ship.hp = ship.hp - 10
ship.y = ship.y + 2
endif
if bombOnScreen(i) then
locate bombx(i),bomby(i):
Color(255,100,200)
print "O"
bomby(i) = bomby(i) + 1
if bomby(i) > 25 then
bombOnScreen(i) = FALSE
endif
if bomby(i) = ship.y and bombx(i) >= ship.x - 1 and bombx(i) <= ship.x + 1 then
bombOnScreen(i) = FALSE
ship.hp = ship.hp - 15
endif
else
bombx(i) = badx(i) + 1
bomby(i) = bady(i) + 1
bombOnScreen(i) = TRUE
endif
endif
next
locate ship.x,ship.y:
Color(250,0,0)
print "<+>"
if PwrUpOnScreen then
locate PwrUpx,PwrUpy:
Color(255,255,0)
print "P"
PwrUpy = PwrUpy + 1
if PwrUpx >= ship.x - 1 and PwrUpx <= ship.x + 1 and PwrUpy = ship.y then
PwrUpOn = TRUE
PwrUpOnScreen = FALSE
ship.shotType = ship.shotType + 1
endif
If PwrUpy > 27 then
PwrUpOnScreen = FALSE
endif
else
if PwrUpOn = FALSE then
If ship.score > 1400 then
PwrUpOnScreen = TRUE
PwrUpx = rnd () % 50
PwrUpY = 0
endif
endif
endif
locate 0,0:
Color(255,255,255)
print "LIFE: "
Color(255,0,0)
print ship.hp
locate 0,1:
Color(255,255,255)
print "SCORE: "
Color(255,0,0)
print ship.score
locate 0,2:
Color(255,255,255)
print "WEAPON: "
Color(255,255,0)
If ship.shotType = 1 then
print "Normal Shot"
endif
If ship.shotType = 2 then
print "Dual Shot"
endif
If ship.hp <= 0 then
ship.hp = 0
locate 22,13:
Color(255,255,0)
print "Game Over"
drawtext()
Sleep(20000)
end
endif
If ship.score >= 3000 then
locate 22,13:
Color(255,255,0)
print "YOU WON"
drawtext()
Sleep(20000)
end
endif
drawtext()
sleep(75)
wend
so what do you think about it???