Ok people! Here ya have it! Not the best thing there is but it'll help newbies get the hang of 3D and maybe even help make a space fighting game or whatever. (All textures taken from Cartography Shop, engine by me of course... if you even call it an engine
)
LINK REMOVED
(If the site don't work for you, just replace the images with your own... I hate Geocities :/ )
If you can't understand a part, let me know. This originally was a test but now I'm posting it on here for people to learn from, I didn't have the decency of adding Reminders >_<
TO DBP NEWCOMERS: Just the first part, don't look all worried when you come to that, that's only making walls without using a model file... so really that part is the easiest out of the whole code. (But just takes a while) The rest you should be able to get without too much difficulty. The keystate part is for a specific key. (If I'm correct, I believe Anime Blood has a program to tell you which number is for which key when you hit it)
(Insert own pictures unless downloaded .zip file)
Rem Project: Airplane
Rem Created by Yart
Rem Created: 7/14/2004 10:04:02 PM
Rem ***** Main Source File *****
sync on
sync rate 40
speedat = 0
correcttilt = 0
hidestats = 0
st = 0
tr = 0
load image "texture1.jpg",1
load image "texture2.jpg",2
load image "texture3.jpg",3
load image "texture4.jpg",4
load image "texture5.jpg",5
make object box 1,1000,1,1000
make object box 2,1000,1,1000
make object box 3,1000,1,1000
make object box 4,1000,1,1000
make object box 5,1000,1,1000
make object box 6,1000,1,1000
make object box 7,1000,1,1000
make object box 8,1000,1,1000
make object box 9,1000,1,1000
make object box 10,3000,3000,1
make object box 11,3000,3000,1
make object box 12,1,3000,3000
make object box 13,1,3000,3000
make object box 14,1000,1,1000
make object box 15,1000,1,1000
make object box 16,1000,1,1000
make object box 17,1000,1,1000
make object box 18,1000,1,1000
make object box 19,500,500,500
position object 1,0,0,0
position object 2,0,0,1000
position object 3,0,0,-1000
position object 4,1000,0,0
position object 5,-1000,0,0
position object 6,1000,0,1000
position object 7,1000,0,-1000
position object 8,-1000,0,1000
position object 9,-1000,0,-1000
position object 10,0,1500,1500
position object 11,0,1500,-1500
position object 12,-1500,1500,0
position object 13,1500,1500,0
position object 14,0,3000,0
position object 15,1000,3000,1000
position object 16,1000,3000,-1000
position object 17,-1000,3000,1000
position object 18,-1000,3000,-1000
position object 19,0,1500,0
texture object 1,1
texture object 2,2
texture object 3,2
texture object 4,2
texture object 5,2
texture object 6,2
texture object 7,2
texture object 8,2
texture object 9,2
texture object 10,3
texture object 11,3
texture object 12,4
texture object 13,4
texture object 14,1
texture object 15,5
texture object 16,5
texture object 17,5
texture object 18,5
set object wireframe 19,1
set object light 19,0
set object transparency 19,1
color object 19, rgb(255,0,0)
position camera 0,50,-400
autocam off
point camera 0,0,0
xrotate camera 0
yrotate camera 0
zrotate camera 0
set camera range 1,8000000
Rem Start the Fun Stuff!
do
if upkey() = 1 then pitch camera down 2
if downkey() = 1 then pitch camera up 2
if leftkey() = 1 and st = 0 then roll camera left 2 else if leftkey() = 1 and st = 1 then tr = tr - 2
if rightkey() = 1 and st = 0 then roll camera right 2 else if rightkey() = 1 and st = 1 then tr = tr + 2
if tr < -15 then tr = -15
if tr > 15 then tr = 15
if tr < 0 then tr = tr + 0.1
if tr > 0 then tr = tr - 0.1
roll camera right tr
if keystate(30) = 1 then speedat = speedat + 1
if keystate(44) = 1 then speedat = speedat - 1
if keystate(16) = 1 and correcttilt = 0 then correcttilt = 1 else if keystate(16) = 1 and correcttilt = 1 then correcttilt = 0
if keystate(31) = 1 and st = 0 then st = 1 else if keystate(31) = 1 and st = 1 then st = 0
if keystate(35) = 1 and hidestats = 0 then hidestats = 1 else if keystate(35) = 1 and hidestats = 1 then hidestats = 0
if keystate(23) = 1 and hidestats = 0 then hidestats = 2 else if keystate(23) = 1 and hidestats = 2 then hidestats = 0
if keystate(47) = 1 and enterownvariable = 0 then enterownvariable = 1
if correcttilt = 1 and camera angle z() < 0 and camera angle z() > -91 then roll camera right 0.1
if correcttilt = 1 and camera angle z() > 0 and camera angle z() < 91 then roll camera left 0.1
if correcttilt = 1 and camera angle z() < -90 and camera angle z() > -180 then roll camera left 0.1
if correcttilt = 1 and camera angle z() > 90 and camera angle z() < 180 then roll camera right 0.1
if correcttilt = 1 and camera angle x() < 0 and camera angle x() > -91 then pitch camera up 0.1
if correcttilt = 1 and camera angle x() > 0 and camera angle x() < 91 then pitch camera down 0.1
if correcttilt = 1 and camera angle x() < -90 and camera angle x() > -180 then pitch camera down 0.1
if correcttilt = 1 and camera angle x() > 90 and camera angle x() < 180 then pitch camera up 0.1
move camera speedat
xaxisshow = camera angle x()
xaxisshow = wrapvalue(xaxisshow)
yaxisshow = camera angle y()
yaxisshow = wrapvalue(yaxisshow)
zaxisshow = camera angle z()
zaxisshow = wrapvalue(zaxisshow)
xposition = camera position x()
yposition = camera position y()
zposition = camera position z()
if hidestats = 2 then goto _skipstats
text 0,0,"Airplane created by Yart | S to Toggle Smoothen Turns"
text 0,10,"Arrows to Move, A to Accelerate, Z to Brake, Q to Toggle Correct Tilt"
text 0,20,"H to Hide/Show Stats, I to Hide/Show All"
if hidestats = 1 then goto _skipstats
set cursor 0,30
print "Correct Tilt: "; correcttilt
set cursor 0,40
print "Smoothen Turns: "; st
set cursor 0,50
print "Speed: "; speedat
set cursor 0,60
print "X Angle: "; xaxisshow
set cursor 0,70
print "Y Angle: "; yaxisshow
set cursor 0,80
print "Z Angle: "; zaxisshow
set cursor 0,90
print "X Position: "; xposition
set cursor 0,100
print "Y Position: "; yposition
set cursor 0,110
print "Z Position: "; zposition
_skipstats:
sync
loop
Pie!