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 / Menu Interface / Function Error

Author
Message
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 9th Mar 2003 19:57
Starting this game off i have made a .BMP main menu with click zone areas so the user can select their options. However DB doesn't like function for the Zone click area to work, i got this function from the DBInterface Builder.
The error msg is at line 45: 'Program ran into a function declaration'
Any Suggestions?

`setting visaul properties
set display mode 640,480,32
hide mouse
sync on
sync rate 400

`wait and suspend
load bitmap "graphics\main001.bmp"
wait (12)
set cursor 280,400
print "Press any Key to Continue"
suspend for key
`fade out screen
for f=0 to 255 step 8
r=255-f
g=255-f
b=255-f
set gamma r,g,b
next f
cls

`load company logo BS
load bitmap "graphics\mainlogo.bmp"
`fade back in menu screen
for f=0 to 255 step 8
r=f
g=f
b=f
set gamma r,g,b
next f
`start of menu commands
show mouse
`cls
sync rate 120
sync on
gosub main:
main:
sync
do

`BACKGROUND FOR MENU
load bitmap "graphics\crow.bmp"
`Zone clicked function
function zoneclicked(x1,y1,x2,y2)
clicked=0
if mousex()>x1 and mousex()y1 and mousey()0 and XTest#0 and ZTest#x1 and mousex()y1 and mousey()
Not much time has passed but already she likes Concrete better then Grass.
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 9th Mar 2003 20:53
Ok, your problem is that your do doesn't have a loop. Is the program cut off?

error 45 happens if you run into a function itself. You should call it.

Maby you can repost your code, I am pretty sure it's cut off.

Cheers.


Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2003 12:22
You were right it was cut off. In future i should recheck after making a post!



Not much time has passed but already she likes Concrete better then Grass.
CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 14th Mar 2003 01:24
just a little correction..
why not simply do:

for f=255 to 0 step -8
r=f
g=f
b=f

Nice work tho
Cheers

CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 14th Mar 2003 01:36
ohh ohh my bad
didnt work
tried it
(geez me being a complete n00b yet claiming to be wiser than more xperienced codes... what was i thinking )

Cheers

CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 14th Mar 2003 01:47
Heh actualy it does work (just me who made a typo)



Cheers

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 14th Mar 2003 08:35
DBInterface Builder?

"Computers are useless they can only give you answers."

Login to post a reply

Server time is: 2024-09-19 22:37:30
Your offset time is: 2024-09-19 22:37:30