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.

Newcomers DBPro Corner / Black Screen?

Author
Message
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 20th Jul 2011 00:54
//-------GLOBALVARS-------------\\
Global Health = 100
Global Mana = 100
Global Easy = 0
Global Normal = 0
Global Hard = 0
//------------------------------\\

maximize window
Sync on : sync rate 40
disable escapekey

gosub mnuVars

Do

set text size 15
set text font "Courier"

Ink white, white
center text screen width()/2, 180, "//------------------------------\\"

if selectedItem <> 0
Ink white, white
center text screen width()/2, 200, mnuItems$(0)
Else
ink red, red
center text screen width()/2, 200, mnuItems$(0)
endif

if selectedItem <> 1
Ink white, white
center text screen width()/2, 220, mnuItems$(1)
Else
ink red, red
center text screen width()/2, 220, mnuItems$(1)
endif
if selectedItem <> 2
Ink white, white
center text screen width()/2, 240, mnuItems$(2)
Else
ink red, red
center text screen width()/2, 240, mnuItems$(2)
endif
if selectedItem <> 3
Ink white, white
center text screen width()/2, 260, mnuItems$(3)
Else
ink red, red
center text screen width()/2, 260, mnuItems$(3)
endif

Ink white, white
center text screen width()/2, 280, "//------------------------------\\"

if upkey()=0 and up = 1
up = 0
endif

if upkey() = 1 and up = 0
selectedItem = selectedItem - 1
up = 1
endif

if downkey() = 0 and down = 1
down = 0
endif

if downkey() = 1 and down = 0
selectedItem = selectedItem + 1
down = 1
endif

if selectedItem < 0
selectedItem = 4
endif

if selectedItem > 4
selectedItem = 0
endif

REM Continue
if selectedItem = 0 and returnkey() = 1
endif

REM StartGame
if selectedItem = 1 and returnkey() = 1
Goto Difficulty
endif

REM Quit
if selectedItem = 3 and returnkey() = 1
cls
ink white, white
center text screen width()/2, 220, "Quitting..."
end
endif

Sync
loop

REM VARIABLES

mnuVars:
Dim mnuItems$(4)
mnuItems$(0)= "Continue"
mnuItems$(1)= "New Game"
mnuItems$(2)= "Load Game"
mnuItems$(3)= "Quit"

selectedItem = 0
up = 0
down = 0

red = RGB(255, 0, 0)
white = RGB(255, 255, 255)
return

Difficulty:

cls

gosub mnuVars

Do

set text size 15
set text font "Courier"

if selectedItem <> 0
Ink white, white
center text screen width()/2, 200, mnuItems$(0)
Else
ink red, red
center text screen width()/2, 200, mnuItems$(0)
endif

if selectedItem <> 1
Ink white, white
center text screen width()/2, 220, mnuItems$(1)
Else
ink red, red
center text screen width()/2, 220, mnuItems$(1)
endif
if selectedItem <> 2
Ink white, white
center text screen width()/2, 240, mnuItems$(2)
Else
ink red, red
center text screen width()/2, 240, mnuItems$(2)
endif

if upkey()=0 and up = 1
up = 0
endif

if upkey() = 1 and up = 0
selectedItem = selectedItem - 1
up = 1
endif

if downkey() = 0 and down = 1
down = 0
endif

if downkey() = 1 and down = 0
selectedItem = selectedItem + 1
down = 1
endif

if selectedItem < 0
selectedItem = 4
endif

if selectedItem > 4
selectedItem = 0
endif

REM EASY
if selectedItem = 0 and returnkey() = 1
Global Easy = 1
cls
ink white, white
center text screen width()/2, 220, "Changed difficulty to easy"
endif

REM NORMAL
if selectedItem = 1 and returnkey() = 1
Global Normal = 1
cls
ink white, white
center text screen width()/2, 220, "Changed difficulty to normal"
endif

REM HARD
if selectedItem = 2 and returnkey() = 1
Global Hard = 1
cls
ink white, white
center text screen width()/2, 220, "Changed difficulty to hard"
endif

Sync
loop

REM VARIABLES

mnuVars:
Dim mnuItems$(3)
mnuItems$(0)= "Easy"
mnuItems$(1)= "Normal"
mnuItems$(2)= "Hard"
return
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 20th Jul 2011 08:45 Edited at: 20th Jul 2011 11:11
your problem lies in your

commands.
change

to


and you will be able to see the text.

You should use the code button at the top of the page when posting code.
It preserves indenting and makes your code much easier to read.

I would also avoid using the goto command in your projects.
http://forum.thegamecreators.com/?m=forum_view&t=96505&b=7

in your posted code you need a gosub in its place anyway.

hope this helps.

kezzla

Sometimes I like to use words out of contents
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Jul 2011 11:02 Edited at: 20th Jul 2011 11:05
Also I would suggest using "CLS" at the start of your loop otherwise your text will stay on the screen and will get unreadable after a while.

Also you have multiple loops but you are using "end" within them to quit each loop. Use "exit" if you want to quit a loop as "end" will close the program.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 20th Jul 2011 19:58
Or you could paste a nice image in the background instead, rather than a plain screen cls.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2024-11-22 19:07:46
Your offset time is: 2024-11-22 19:07:46