Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / who needs Score and Life, I DO !!!

Author
Message
johnvn
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: United Kingdom
Posted: 18th Apr 2003 19:14
hi i have partly don my game but i cant get the score to appear, iam thinking that maybe it is workin just the text aint displayin, can someone have a look cos its doin my head in, cheers john

SYNC ON
SYNC RATE 0
CLS 50


lastbulletfired = timer()

ROF = 2
ROF = 1000 / ROF
maxbullets = 80
rem length = 5
dim Bullets(maxbullets, 3)
gunposition = Screen Width() / 30
gunlength = Screen Height() / 10
gunspeed = 10
bulletspeed = 20
currentbullet = 1
score = 0
gameover = 0
xpos = RND(600)+20
ypos = 0
RANDOMIZE TIMER()
playerimage = 10
level = 0

yposmax = 480
yposmin = 0
xposmax = 640
xposmin = 0
gravity = 5

life = 100





rem gosub start

rem gosub play
rem gosub guncontroll
rem gosub playercontroll
rem gosub firingcontroll
rem gosub bulletcontroll
rem gosub gfx
rem gosub offscreen
rem gosub makeenemy
rem gosub collision
rem gosub background










REM ****************************************************

start:

if level = 0 then gosub introduction

return

introduction:


TEXT 20,450, "START : space twice"
suspend for key
IF spacekey() = 1 then gosub play
IF spacekey() = 1 then level = level + 1
return

play:




do
gosub guncontroll
gosub playercontroll
gosub firingcontroll
gosub bulletcontroll
gosub gfx
gosub offscreen
gosub makeenemy
gosub collision
gosub background
loop


return


guncontroll:

if leftkey() = 1 then gunposition = gunposition - gunspeed
if rightkey() = 1 then gunposition = gunposition + gunspeed

return

playercontroll:

LOAD IMAGE "C:\WINDOWS\Desktop\darkbasic\player1.bmp",1



sprite 1, (gunposition) - 20, 455,1


IF leftkey() = 1 then gunposition = gunposition - gunspeed
IF rightkey() = 1 then gunposition = gunposition + gunspeed

return

firingcontroll:


if spacekey() = 1
if bullets(currentbullet, 3) 1
if lastbulletfired maxbullets
currentbullet = 1
endif
endif
endif
endif

return


bulletcontroll:


for a = 1 to maxbullets

if bullets(a, 3) = 1
bullets(a, 2) = bullets(a, 2) - (bulletspeed + 20)
endif

next a

return


gfx:

LOAD IMAGE "C:\WINDOWS\Desktop\darkbasic\player1.bmp",3
line gunposition, screen height() - gunlength, gunposition, screen height()


sprite 3, bullets(a, 1), bullets(a, 2)- bulletspeed,3
for a = 1 to maxbullets

if bullets(a, 3) = 1
sprite 3, bullets(a, 1)-20, bullets(a, 2)- bulletspeed,3

endif
next a

return

offscreen:

for a = 1 to maxbullets
if bullets(a, 2)
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 18th Apr 2003 23:02 Edited at: 18th Apr 2003 23:07
Johnvn,
edit:
just realized that you used all caps for LIFE at the point where you print the str$

change that to life.


I looked your code over very breifly and with regard to printing the score it looks ok. Perhaps try to force the ink color to white by typing:

ink rgb(255,255,255),1

either put this at the beginning of your code or before you print.
If your bitmap that you are loading has a light background try setting the ink to black using the following

ink rgb(0,0,0),1

The only other thing I can think of (which I'll have to check through your code more dilligently) is that you may be erasing the screen by loading another bitmap causing you not to see the output. try placing a wait statement after your text command

Let me know if this helps

Login to post a reply

Server time is: 2024-03-28 18:15:09
Your offset time is: 2024-03-28 18:15:09