TGC Codebase Backup



3d working File Browser by Neodelito

27th Feb 2006 11:25
Summary

i make this 3d file browser in dark basic (not pro).. please considere the desing like a model.. they no use any models, only textures and box and spheres.. but they can skined and



Description

I make that in my old (crap) pc , its slow.. but maybe in your machine the movs are higspeed that you can fix put this line :

if inkey$()="x" then cmz#=0


i make this 3d file browser in dark basic (not pro).. please considere the desing like a model.. they no use any models, only textures and box and spheres.. but they can skined and use your own .x models .. only chage variables skin=0 for skin=1
i hope you like it...
[img]http://neodelito.webcindario.com/neodelito/e107_files/public/USERID_screenshot32423243.jpg[/img]

download here full 3d Version:
[href]http://neodelito.webcindario.com/neodelito/e107_files/public/USERID_browser2.rar[/href]

and a simple version here:
[href]http://neodelito.webcindario.com/neodelito/e107_files/public/USERID_browser.rar[/href]



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Rem * Title  : 3D Browser
Rem * Author : Jaime Andres Zegpi Badilla
Rem * Date   : Mi Examen
rem Hi. i'm jaime Zegpi Badilla, Im come from Los Angeles - Chile
rem if you have a question of this code mailme to jaimezegpi@yahoo.es
rem now if you are chilean o visit chile my cel number is 95056450
rem this code is in honnor of my love children's


rem Name of Code : L.C.B.M.J.

set text font "arial"

skin=0
base$=get dir$()
zfile$=base$+"skinsunofile.x"
zfolder$=base$+"skinsunofolder.x"
zup$=base$+"skinsunoup.x"
print zfile$


load image "folder.bmp",1
sprite 1,10,10,1
load image "file.bmp",2
sprite 2,10,10,2
load image "up.bmp",3
sprite 3,10,10,3

load image "ifolder.bmp",4
load image "ifile.bmp",5
load image "iup.bmp",6


load image "mira.bmp",10
sprite 10,10,10,10
load image "logo.bmp",20
sprite 20,10,10,20

load image "back.bmp",1001
make object sphere 1001,300
texture object 1001,1001
set object 1001,1,0,0,1

load music "fondo.mid",1
load sound "select.wav",1

dim archivos$(10000)
dim carpetas$(10000)
dim archivo$(10000)
dim carpeta$(10000)
dim tipo$(10000)
mydir$=get dir$()
hide mouse
rem el directorio actual se puede cambiar
set dir "c:"
ini=1
goto refrescar
inicio:
inicio2:
inic#=1
finc#=10
aini#=1
afin#=10
esf=10
y#=10
set camera range 3,300
loop music 1



sync on 
do
sprite 10,300,200,10
sprite 20,450,0,20
am#=am#+1
if am#>360 then am#=0
rotate object 1001,am#,am#,am#
rem Usa MOUSEMOVE para cambiar los ángulos de la cámara
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())

if leftkey()=1 then cy#=cy#-2
if rightkey()=1 then cy#=cy#+2
if shiftkey()=1 then y#=y#+1
if controlkey()=1 then y#=y#-1
if cy#>360 then cy#=0
if cy#<0 then cy#=360
if upkey()=1 then cmz#=cmz#+0.5
if cmz#>2 then cmz#=2
if downkey()=1 then cmz#=cmz#-0.5
if cmz#<-2 then cmz#=-2
x#=camera position x()
y#=camera position y()
z#=camera position z()

position camera x#,y#,z#
position object 1001,x#,y#,z#
rotate camera cx#,cy#,cz#
move camera cmz#

seleccion=0
hide sprite 1
hide sprite 2
hide sprite 3

for t=1 to obj

if object visible(t)=0 then t=t+1:if t>obj then t=obj

ox=object position x(t)
oy=object position y(t)
oz=object position z(t)
sx#=object screen x(t)
sy#=object screen y(t)

if object in screen(t)=1
set cursor sx#,sy#
center text sx#,sy#,archivo$(t)
endif

if sx#>300 and sx#<340 and sy#>220 and sy#<260
seleccion=1
objeto=t
target$=archivo$(t)
if tipo$(t)="carpeta" and archivo$(t)<>".."
show sprite 1
sprite 1,sx#,sy#+2,1
endif
if tipo$(t)="archivo"
show sprite 2
sprite 2,sx#,sy#+2,2
endif
if archivo$(t)=".."
show sprite 3
sprite 3,sx#,sy#+2,3
endif

if mouseclick()=1 and tipo$(t)="carpeta" 
refrescar=1
click=1
endif

if returnkey()=1 and tipo$(t)="carpeta" 
refrescar=1
click=1
endif

endif
next t
if seleccion=1
if sound playing(1)=0 then play sound 1
rs#=rs#+5
if rs#>360 then rs#=1
rotate object objeto,0,rs#,0
endif
if click=1 then goto refrescar
inicio4:

motor:

sync
loop



goto refrescar

refrescar:
click=0
seleccion=0
if refrescar=1
refrescar=0
set dir target$
endif


Archivos:
sync on

undim archivo$(1000)
undim tipo$(1000)

dim archivo$(1000)
dim tipo$(1000)

for t=1 to 1000
if object exist(t)=1
delete object t
endif
next t

obj=0
zdeepc=0
find first
rem Crea matriz y variable de índice
narchivos=1
rem comienza a repetir el bucle
repeat
rem añade al la matriz si se encuentra el fichero
if get file type()=0
obj=obj+1
archivo$(obj)=get file name$()
tipo$(obj)="archivo"
zdeepc=zdeepc+10
if skin=1 then load object zfile$,obj
if skin=0 then make object sphere obj,2
texture object obj,5
ghost object on obj
position object obj,5,-5,zdeepc
endif
rem Encuentra siguiente fichero en el directorio en uso
find next
Rem Repite bucle hasta que no haya más ficheros en el directorio en uso
until get file type()=-1

Carpetas:
zdeepc=0
find first
rem Crea matriz y variable de índice
ncarpetas=1
rem comienza a repetir el bucle
repeat
rem añade al la matriz si se encuentra el fichero
if get file type()=1
obj=obj+1
archivo$(obj)=get file name$()
tipo$(obj)="carpeta"
zdeepc=zdeepc+10
if skin=1 then load object zfolder$,obj
if skin=0 then make object cube obj,3
if archivo$(obj)=".." then texture object obj,6
if archivo$(obj)<>".." then texture object obj,4

ghost object on obj
position object obj,-5,0,zdeepc

endif
rem Encuentra siguiente fichero en el directorio en uso
find next
Rem Repite bucle hasta que no haya más ficheros en el directorio en uso
until get file type()=-1

position camera 0,20,0
sync
if ini=1 then ini=0:goto inicio

goto motor

rem Programa creado po Jaime A. Zegpi badilla
rem Jaimezegpi@yahoo.es
rem http.//neodelito.webcindario.com
rem N E O D E L I T O