thats odd. it doesent change anything. i must ask you one more favor.
feel free to turn it down but it would help me SO much. could you implement
that into my code so it works, so that collision is off on "enemy"? It would help me SO much bro. please.
thanks in advanced.
here is my code:
Rem Project: RPG
Rem Created: 1/5/2006 8:22:46 PM
Rem ***** Main Source File *****
`--------------------------
`START
`--------------------------
disable escapekey
load music "music1.wav",1
load image "MEDIA/textures/backround.bmp",1
paste image 1,0,0
wait 5000
gosub menu
Menu:
CLS
delete object 1
delete image 1
` MENU LOOP
loop music 1
do
set text font "arial"
ink rgb(150,0,0),0
set text to bold
set text size 32
center text screen width()/2,screen height()/2-150,"-Battles within-"
center text screen width()/2,screen height()/2-120,"-Temples of Shadow-"
set text to normal
set text size 16
center text screen width()/2,screen height()/2-90,"Created by Snowfall Studios"
center text screen width()/2,screen height()/2-75,"-RPG V2.0-"
buttonpressed=0
if makebutton(screen width()/2,screen height()/2,"NEW GAME")>0 then buttonselected=1
if makebutton(screen width()/2,screen height()/2+50,"OPTIONS")>0 then buttonselected=2
if makebutton(screen width()/2,screen height()/2+100,"CREDITS")>0 then buttonselected=3
if makebutton(screen width()/2,screen height()/2+150,"QUIT")>0 then buttonselected=4
if buttonselected=1 then gosub _Get_name
if buttonselected=2 then gosub options
if buttonselected=3 then gosub credits
if buttonselected=4 then end
sync:loop
options:
buttonselected=0
do:cls
buttonpressed=0
if makebutton(100,200,"Video")>0 then buttonselected=7
if makebutton(100,250,"Music")>0 then buttonselected=6
if makebutton(100,350,"Back")>0 then goto menu
if buttonselected=6
if makebutton(300,225,"ON")>0 then buttonselected=8
if makebutton(300,275,"OFF")>0 then buttonselected=9
if buttonselected=9 then music=0
if buttonselected=8 then music=1
line 200,225,220,225:line 200,275,220,275:line 180,250,200,250:line 200,225,200,275
endif
if buttonselected=7
if makebutton(300,150,"640 x 480")>0 then buttonselected=10
if makebutton(300,200,"800 x 600")>0 then buttonselected=11
if makebutton(300,250,"1024 x 768")>0 then buttonselected=12
if buttonselected=10 then set display mode 640,480,16
if buttonselected=11 then set display mode 800,600,16
if buttonselected=12 then set display mode 1024,768,16
line 200,150,220,150:line 180,200,220,200:line 200,250,220,250:line 200,150,200,250
endif
sync:loop
credits:
cls:texty#=screen height()
do:cls
sprite 1,mousex(),mousey(),9
texty#=texty#-0.45
set text to bold
set text size 20
center text screen width()/2,texty#,"3D RPG"
set text to normal
set text size 15
center text screen width()/2,texty#+20,"Created by: Marlin Studios"
set text size 12
center text screen width()/2,texty#+60,"Programmer: Marlin Studios"
center text screen width()/2,texty#+75,"2D Arts: Marlin Studios, TGC, DBpro"
center text screen width()/2,texty#+90,"3D Arts: Marlin Studios, DBpro"
center text screen width()/2,texty#+105,"Programming language: DarkBASIC PRo"
center text screen width()/2,texty#+120,""
set text size 15
set text to bold
center text screen width()/2,texty#+135,"Press the return key to continue"
if returnkey()=1:buttonpressed=0:buttonselected=0:goto menu:endif
if texty#+120<0 then texty#=500
sync
loop
function makebutton(x,y,name$)
buttonpressed=0
ink rgb(255,255,255),0
mx=mousex() : my=mousey()
if mx>x-80 and mx<x+80
if my>y-15 and my<y+15
buttonpressed=1
endif
endif
if buttonpressed=1
ink rgb(120,0,0),0
endif
box x-80,y-15,x+80,y+15
ink rgb(200,0,0),0
box x-78,y-13,x+78,y+13
ink rgb(255,255,255),0
set text size 12 : set text font "courier" : center text x,y-8,name$
if mouseclick()=0 then buttonpressed=0
endfunction buttonpressed
_Get_name:
CLS
set text size 16
set text to normal
input "Please enter a name for your profile: ", name$
gosub _get_stats
return
STATS_:
CLS
set text to normal
print "Hello ",name$,", Welcome."
print "Before you can be brought into the world you must chose your stats."
print "Press any key to re-roll you stats and when you are prepared to enter"
print "the world, hit the [Return] Key."
print "---------------------------------------------------------------------------------------------------"
randomize timer()
totalhealth = RND(9) + 1
totalhealth = totalhealth * 100
totalmana = RND(9) + 1
totalmana = totalmana * 100
intell = RND(9) + 1
intell = intell *10
health = totalhealth
mana = totalmana
set text to normal
Randomize timer()
ink rgb(255,0,0),0
print "HEALTH :",totalhealth,"/1000"
ink rgb(0,0,255),0
print "MANA :",totalmana,"/1000"
ink rgb(0,255,0),0
print "INTELLIGENCE :",intell,"/100"
print ""
set text to bold
set text size 16
ink rgb(255,255,255),0
print "Press the return key to accept your stats"
print "Press any other key to re-roll your stats"
suspend for key
return
_Wait_For_Key:
if returnkey()=1 then gosub _Into
return
_Get_Stats:
do
gosub STATS_
gosub _Wait_For_Key
loop
_Into:
CLS
set text to normal
set text size 12
center text screen width()/2,screen height()/2 -120,"Welcome to -Brotherhood of Death- Temples of shadow!"
center text screen width()/2,screen height()/2 -100,"your town is in need of your help! You must get to"
center text screen width()/2,screen height()/2 -80," the gates of Geometrica (your town) Before it is to late"
center text screen width()/2,screen height()/2 -60,"and all geometery is lost forever! Your must hurry"
center text screen width()/2,screen height()/2 -40,"Use the [Left Mouse Button] to attack and W,A,S,D"
center text screen width()/2,screen height()/2 -20,"to move your character, Good luck! [Press Any Key To Begin]"
suspend for key
cls
set text size 20
center text screen width()/2,screen height()/2 +0,"Loading... Please Wait"
wait 1500
goto _Start
_START:
`Set text size and set up
set text size 12
CLS
`set sync
sync on
rem color backround
color backdrop 0
rem make landscape
make matrix 1,10000,10000,50,50
randomize matrix 1,80
update matrix 1
`----------------------------
`Chapter 2-Load all media |
`----------------------------
rem Load snowy floor bitmap into image
load bitmap "MEDIA\textures\grass09.bmp",1
load image "MEDIA\textures\player.bmp",2
load image "MEDIA\textures\cottag02.bmp",3
load image "MEDIA\textures\sword_handel.bmp",4
load image "MEDIA\textures\blade.bmp",5
load image "MEDIA\textures\hat.bmp",6
load image "MEDIA\textures\HUD.bmp",7
load image "MEDIA\textures\topbar.bmp",8
Load Image "media\textures\cursor.bmp",9
Rem load particles
Load Image "MEDIA\textures\fire.bmp",10
For x = 80 to 90
Make object plain x+10,5,5
Texture object x+10,2
Set object x+10,1,0,0
Ghost object on x+10
Next x
Rem intialize particle counter
Pn=10
get image 1,0,0,128,128
delete bitmap 1
rem Texture landscape
prepare matrix texture 1,1,1,1
rem Activate and distance fogging
fog on
fog color rgb (0,0,0)
fog distance 1000
enemy=15
make object sphere enemy,30
position object enemy,700,60,600
Rem Make player
player=1
make object cube player,30
color object player, rgb(255,0,0)
set object collision on player
Set object collision to boxes player
MAKE OBJECT box 9999,4,60,4
MAKE MESH FROM OBJECT 1,9999
DELETE OBJECT 9999
ADD LIMB 1,1,1
OFFSET LIMB 1,1,18,0,20
rotate limb player,1,60,0,0
color limb player,1,rgb(0,200,0)
bullet=11
Rem Make bullet
Make Object Sphere bullet,25
Hide Object bullet
`MAKE OBJECT sphere 9999,30
`MAKE MESH FROM OBJECT 1,9999
`DELETE OBJECT 9999
`ADD LIMB 1,2,1
`OFFSET LIMB 1,2,0,0,100
`rotate limb player,2,60,0,0
`color limb player,2,rgb(0,200,0)
`hide limb player,2
Rem Make Cubes and place randomly
For boxes = 2 to 10
Make object box boxes,100,200,100
Position object boxes,Rnd(2000),0,Rnd(2000)
set object collision on boxes
texture object boxes,3
Next boxes
`Set up variables
used=0
time_until_ready=100
stuck = 0
health = totalhealth
mana = totalmana
XP = 0
level = 1
light1 = 1
block1 = 101
block2 = 102
block3 = 103
block4 = 104
block5 = 105
block6 = 106
block7 = 107
`Set up obsticles
make light light1
position light light1,445,68,544
make object box block1,70,300,70
make object box block2,70,300,70
make object box block3,70,240,30
make object box block4,70,300,70
make object box block5,70,300,70
position object block1,550,5,550
position object block2,357,68,533
position object block3,453,200,544
position object block4,615,34,553
position object block5,646,49,651
rotate object block3, 320,100,200
texture object block1,3
texture object block2,3
texture object block3,3
texture object block4,3
texture object block5,3
`Position Character at starting POS
position object player, 445,61,356
` SETUP
CLS 0
hide mouse
set text to normal
limb#=0
`Main Loop
do
position light light1,X#,Y#-10,Z#
sprite 1,mousex(),mousey(),9
paste image 7,0,430
paste image 8,0,-14
`Print health
set cursor 0,0
set text size 18
set cursor 10,440
ink rgb(255,0,0),0
print "Current Health: ",health,"/",totalhealth
set cursor 430,438
ink rgb(0,0,255),0
print "Current Mana: ",mana,"/",totalmana
ink rgb(255,255,255),0
ink rgb(180,180,0),0
set cursor 245,texty#+10
print "Level : ",level
ink rgb(0,0,0),0
set cursor 260,texty#+439
print "XP : ",XP
set cursor 0,30
ink rgb(255,255,255),0
`print ""
`print "FPS :",Screen fps()
`print "X-cords: ",X#
`print "Y-cords: ",Y#
`print "Z-cords: ",Z#
rem Store Object angle Y in aY#
aY# = Object angle Y(player)
`player movement and turning
`player movement and turning
if keystate (17) then move object 1, .25
if keystate (31) then move object 1, -.3
if keystate (30) then yrotate object 1, object angle y(1) - .2
if keystate (32) then yrotate object 1, object angle y(1) +.2
`ATTACK
if mouseclick()=1
dec mana,1
position object player,X#,Y#,Z#
limbtime#=timer()
rotate limb player,1,60,0,0
limb#=1
endif
if Mouseclick()=1 and BulletLife=0
Position object bullet,X#,Y#+1,Z#
Set object to camera orientation bullet
BulletLife =25
Show object bullet
Endif
If BulletLife > 0
Dec BulletLife
Move object bullet,10
texture object bullet,10
If BulletLife = 0 then Hide object bullet
Endif
`if Spacekey was pressed
if limb#=1
if timer()=>limbtime#+100 then rotate limb player,1,150,0,0 and limb#=0
endif
`exit menu
if escapekey()=1
set text size 25
ink rgb(255,200,200),0
center text screen width()/2,screen height()/2-90,"Hit 'Q' to Exit"
center text screen width()/2,screen height()/2-65,"-Press any other key to continue-"
suspend for key
if keystate(16)
end
endif
endif
Rem Detect collision
If Object collision(player,0)>0 AND object collision(player,0) <> then position object player,X#,0,Z#
`make it so that the character stays above the matrix
y# = get ground height(1,x#,z#)+16
X# = Object position x(player)
Z# = Object position z(player)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
`render all of above X# Y# and Z#
position object player,x#,y#,z#
Rem position camera
Position Camera cX#,120,cZ#
`set camera back to players angles and move it behind him
`set camera to object orientation 1
rotate camera object angle x(player), object angle y(player), object angle z(player)
move camera -110
`draw changes
sync
`end loop
loop
return