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.

DarkBASIC Discussion / new Level loading gives weird camera problem

Author
Message
Oibaf2000
21
Years of Service
User Offline
Joined: 31st Jan 2004
Location:
Posted: 23rd Jul 2004 19:56
I have built a game using matrixes created with matedit. So I am using the matedit loadmatrix code to load the level. I can load a level and walk around the matrix with no issues. But when the end level condition is met, I want to load the next level. I cleanup all the objects, images and delete the existing matrix. Then load the new matrix. But now when I try to walk the world the camera simple gains altitude instead of moving as normal. If i start with this new level first, it works fine. I just don't get what possibly can be happening, if the player movement routine was workign why when laoding a new level would simply do something else? Are there any tips, areas I should look into to figure out the problem? As a thought I decided maybe the loadmtrix arrays had unwated info in them so before I laod the new level I undim them and then dim again, but that didn;t help. Any best pratices, insights, or comment will be greatly appreciated.



pseudo code:

main:
gosub initialize variables
gosub loadlevel


do
AmtToMove=0
CX#=Camera Angle X(): CY#=Camera Angle Y(): CZ#=Camera Angle Z()
CY# = WrapValue(CY#+MousemoveX()):`controls turning movement of player
Rotate Camera CX#,CY#,CZ#
Gh#=Get Ground Height(1,Camera Position x(),Camera Position z())+HeightOffset(0):`place the camera a reasonable height above the ground

gosub task1
gosub task2
gosub controlplayer
if level win condition is met
recordscore
clean up old objects, bitmaps, lights, arrays
cls
goto main
endif
if level loose condition is met
endgame
endif
loop

Oibaf2000
21
Years of Service
User Offline
Joined: 31st Jan 2004
Location:
Posted: 25th Jul 2004 02:12
just bumping my post ..cuase i still need some help figuring this out....
sarin
21
Years of Service
User Offline
Joined: 20th Mar 2004
Location: nowhere
Posted: 25th Jul 2004 18:15
ok, im not really seeing a cause for it, but i have a question; why r u positioning the camera at the oldy position, instead of using the gh#? that may be ur prob, but im not sure

Sarin

Login to post a reply

Server time is: 2025-05-25 01:09:42
Your offset time is: 2025-05-25 01:09:42