Hi, I am new to dark basic and rather than filling the forums with unrealated newb garbage I have been pretty well keeping to myself and trying to learn from some very nice tutorials. Though, I have come to an impass. For a school tech prep project I have decided to create a game. But, on too the problem. The game works great. The intro screen loads and curentely I have it setup where you can select new game. I setup a sample camera of the problem. It seems when you move it, well, duplicates the screen over and over. I tested the moving code in a brand new .dba file and it worked fine. Though, it won\'t work in my game. Test it out and see what I mean if you want.
Any help is greately appreciated on the topic. Oh, am I forgetting to delete something when I gosub?
`++++++++++++++++++++++++++++++
`Director Sean Britton
`Concept Artist Zac Taylor
`Modeling Brian Willaims
`Music Design Corey Rutter
`++++++++++++++++++++++++++++++
`Setup Subs and Such
gosub _Setup_Screen
gosub _Adver
gosub _Intro
gosub _Title
`Screen Setup
_Setup_Screen:
Sync ON
Sync Rate 60
Set Display Mode 800,600,16
Hide Mouse
Return
`Publisher Screens
_Adver:
Return
`Intro Screen
_Intro:
Return
`Title Screen
_Title:
`Loading
Print \"Loading...\"
Sync
Sync
`Load Stuff
Load Music \"Music\\Hermes.mid\",1
Load Image \"Images\\Textures\\grass08.bmp\",1
Make Matrix 1,1000,1000,25,25
Load Sound \"Efxs\\Buttons\\click.wav\",2
Load Sound \"Efxs\\Buttons\\pick.wav\",3
`Scene Control
Fog ON
Fog Color RGB(79,135,162)
Backdrop On
Color Backdrop RGB(79,135,162)
Fog Distance 350
Play Music 1
`Matrix Setup
Randomize Matrix 1,15
Prepare Matrix Texture 1,1,1,1
`Position Objects
`Camera Setup
Position Camera 500,0,500
ZRotate Camera 180
` Variables
selected = 1
set text size 16
`Title Screen Loop
_TLoop:
Do
cay# = camera angle y()
YRotate Camera wrapvalue(cay#+.06)
Gosub _Text
Sync
if returnkey()=1 and selected =1
gosub _NewG
Endif
if returnkey()=1 and selected =2
gosub _LoadG
Endif
if returnkey()=1 and selected =3
gosub _Tutorials
Endif
Loop
Return
`Text Handler
_Text:
if upkey()=1 and selected = 1 and w# = 10
selected = 3
w# = 0
Play Sound 2
endif
if upkey()=1 and selected = 2 and w# = 10
selected = 1
w# = 0
Play Sound 2
endif
if upkey()=1 and selected = 3 and w# = 10
selected = 2
w# = 0
Play Sound 2
endif
if downkey()=1 and selected = 1 and w# = 10
selected = 2
w# = 0
Play Sound 2
endif
if downkey()=1 and selected = 2 and w# = 10
selected = 3
w# = 0
Play Sound 2
endif
if downkey()=1 and selected = 3 and w# = 10
selected = 1
w# = 0
Play Sound 2
endif
if selected = 1
ink RGB(108,5,235),0
Text 600,350,\"New Game\"
ink RGB(20,210,220),0
Text 600,400,\"Load Game\"
Text 600,450,\"Tutorials\"
endif
if selected = 2
ink RGB(108,5,235),0
Text 600,400,\"Load Game\"
ink RGB(20,210,220),0
Text 600,350,\"New Game\"
Text 600,450,\"Tutorials\"
endif
if selected = 3
ink RGB(108,5,235),0
Text 600,450,\"Tutorials\"
ink RGB(20,210,220),0
Text 600,350,\"New Game\"
Text 600,400,\"Load Game\"
endif
if w# = 0 then inc w#
if w# < 10 then inc w#
if w# > 10 then w# = 10
Return
REM Start Game +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM Start Game +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM Start Game +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_NewG:
`Stop and delete things.
Stop Music 1
Delete Music 1
Delete Sound 2
Delete Matrix 1
Backdrop Off
Fog Off
Delete Image 1
Delete Sound 3
selected = 0
`Load all the painfull stuuffff!
Load Image \"Images\\Textures\\grass08.bmp\",1
`Town matrix
Make Matrix 1,100,100,25,25
Prepare Matrix Texture 1,1,1,1
Randomize Matrix 1,1
`Main game setup and loops.
Do
`SAMPLE MOVING
if upkey()=1 then move camera 1
if downkey()=1 then move camera -1
if rightkey()=1 then turn camera right 1
if leftkey()=1 then turn camera left 1
Sync
Loop
Return
_LoadG:
gosub _TLoop:
Return
_Tutorials:
gosub _TLoop:
Return