Ok, so I'm still pretty new to DBPro, been reading quite a few tuts, and trying to make sense of as much as I can. Anyways, I'm not bothering to try to start out on the next big RPG, and not even really anything graphical for starters, mainly what I want to work on is a simple "game" that involves a window with 25 panels, and those 25 panels all have a number in the center of them.
The idea is to see how long it takes a person to click on the numbered panels, in order, from 1 to 25.
So I've been cracking away at this all night, and my brain is starting to putout little puffs of smoke here and there. I have yet to program in the buttons (kind of dreading that... 25 buttons, ugh) or the logic to make sure the player is clicking them in order, or the timer, for that matter... what I have right now is lined drawn to make up the panels, and an "engine" per-say that picks a random number between 1 and 25, and then prints it into the center of a button.
This is where my problem is though, and I want it fixed before I move on. When the program runs, it dumps the numbers out there, but leaves an empty panel sometimes, and has issues, and doesn't wait for the "wait key" event, and just closes. What am I doing wrong here?
My code is here: (I know, it's very amateur code, but I'm a newb. Ideas are welcomed)
`*****************************************
`* Clickable Random Panels *
`* By: Ninjazz *
`*****************************************
sync on
sync rate 60
set display mode 1024,768,16
set window on
cls rgb(255,255,255)
ink rgb(0,0,0),rgb(255,255,255)
boxnum = 25
x=0
y=0
DIM Boxe$(boxnum)
Boxe$(1) = "1"
Boxe$(2) = "2"
Boxe$(3) = "3"
Boxe$(4) = "4"
Boxe$(5) = "5"
Boxe$(6) = "6"
Boxe$(7) = "7"
Boxe$(8) = "8"
Boxe$(9) = "9"
Boxe$(10) = "10"
Boxe$(11) = "11"
Boxe$(12) = "12"
Boxe$(13) = "13"
Boxe$(14) = "14"
Boxe$(15) = "15"
Boxe$(16) = "16"
Boxe$(17) = "17"
Boxe$(18) = "18"
Boxe$(19) = "19"
Boxe$(20) = "20"
Boxe$(21) = "21"
Boxe$(22) = "22"
Boxe$(23) = "23"
Boxe$(24) = "24"
Boxe$(25) = "25"
do
sync
gosub DrawBack
gosub Shaker
loop
wait key
end
DrawBack:
line 0,0,1005,0
line 0,151,1005,151
line 0,302,1005,302
line 0,453,1005,453
line 0,604,1005,604
line 0,755,1005,755
line 0,0,0,755
line 201,0,201,755
line 402,0,402,755
line 603,0,603,755
line 804,0,804,755
line 1005,0,1005,755
return
Shaker:
x = 100
y = 75
for n = 1 to 5
temp = rnd(boxnum)
print Boxe$(temp)
array delete element Boxe$(),temp
boxnum = boxnum - 1
set cursor x,y
x = x + 201
next n
x = 100
y = 226
for n = 6 to 10
temp = rnd(boxnum)
print Boxe$(temp)
array delete element Boxe$(),temp
boxnum = boxnum - 1
set cursor x,y
x = x + 201
next n
x = 100
y = 377
for n = 11 to 15
temp = rnd(boxnum)
print Boxe$(temp)
array delete element Boxe$(),temp
boxnum = boxnum - 1
set cursor x,y
x = x + 201
next n
x = 100
y = 528
for n = 16 to 20
temp = rnd(boxnum)
print Boxe$(temp)
array delete element Boxe$(),temp
boxnum = boxnum - 1
set cursor x,y
x = x + 201
next n
x = 100
y = 679
for n = 21 to 25
temp = rnd(boxnum)
print Boxe$(temp)
array delete element Boxe$(),temp
boxnum = boxnum - 1
set cursor x,y
x = x + 201
next n
return
Thanks,
Ninjazz