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 / backdrop help(freak)

Author
Message
koolaid
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 7th Feb 2003 08:15
ok i still cannot get this thing right i want to put skyspheres or skyboxes in my program surrounding the matrix there from darkmatter i requested help before but it doesnt make sense i know its easy but i cant get it right below is what im working on as of now its not a game everything ive learned so far.how and where in this code can i do this so it will work.if anyone can help me out please do.

Sync On
Sync Rate 25
Hide Mouse
autocam off

Backdrop on
Set camera range 1,1000

Fog on
Fog distance 1000
Fog color RGB(0,0,0)
Color Backdrop RGB(0,0,0)
ink rgb(0,0,255),rgb(0,0,0)
set cursor 320,240

Rem make matrix
Make matrix 1,10000,10000,20,20

Rem texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1

rem music
load music "endless.mid",1
play music 1
load sound "smallgravel.wav",1

rem Load object
Load object "swatidle.X",2
load object "thugmove.x",3
loop object 2
scale object 3,2000,2000,2000
scale object 2,2000,2000,2000
position object 3,4960,get ground height(1,5000,5500),5500
position object 2,5000,Get Ground Height(1,5000,5500),5500
set object collision to spheres 2
set object collision to polygons 3
rem Add walk animation data to your object appending to frame 100
append object "swatmove.x",2,100

rem Set new speed for your model
set object speed 2,10

rem start/Set object to interpolate to a new frame at a speed of 25%
set object interpolation 2,25
remend

Rem Main loop
Do
yAng=object angle y(2)

rem move object across matrix/controls
yAng=object angle y(2)
if rightkey()=1 then yrotate object 2,wrapvalue(yang+5)
if leftkey()=1 then yrotate object 2,wrapvalue(yang-5)
if upkey()=1 then move object 2,-4
if lower$(inkey$())="q" and downkey()=1
ghost object on 2
endif
if lower$(inkey$())="w" and downkey()=1
ghost object off 2
endif
rem stop game(pause screen)
if shiftkey()=1
print "Press a key to continue"
set cursor 320,240
stop object 2
stop music 1
suspend for key
print "you pressed a key"
set cursor 320,240
loop object 2
play music 1
endif

rem detect collision
if object collision(2,3)>0 then position object 2,xpos#,ypos#,zpos#
rem refresh screen
sync rate 30


rem If walk animation required, make sure can perform animation
if animpause=0
animpause=4
if upkey()=1
if animstate=0
rem then slowly interpolate to the first walk frame
animstate=1
set object frame 2,100
loop sound 1
stop object 2
endif
else
if animstate=1
rem else slowly interpolate to the first idle frame
animstate=0
stop sound 1
stop object 2
set object frame 2,0
endif
endif
else
rem Count down until the interpolation has finished
animpause=animpause-1
if animpause=0
if animstate=0 then loop object 2,0,20
if animstate=1 then loop object 2,100,125
endif
endif

`work out the height of the character
xPos#=object position x(2)
zPos#=object position z(2)
yPos#=get ground height(1,xPos#,zPos#)

`update the objects position
position object 2,xPos#,yPos#,zPos#

`update the camera
chase_cam(1)

`update the screen
sync
loop

rem chase function
function chase_cam(1)

`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(2)+360)

`grab the objects current position
xPos#=object position x(2)
yPos#=object position y(2)
zPos#=object position z(2)

`other variables
camDist=60
camHeight=30

`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newZvalue(zPos#,yAng#,camDist)

`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos#
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 8th Feb 2003 00:25
You need to

Load object "myskybox.x",1
Load image "myskytexture.bmp",1

Texture object 1,1
Scale object 1,x
Position object 1,x,y,z

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-05-18 17:41:28
Your offset time is: 2024-05-18 17:41:28