dude! you just cuadruple posted. use the EDIT button. and you are getting
WAY ahead of yourself. you JUST bought DBPRO so quit asking everyone
to explain snippets. Read the tutorials. i coded this in one weak:
Rem Project: RPG
Rem Created: 1/5/2006 8:22:46 PM
Rem ***** Main Source File *****
`--------------------------
`Chapter 1-Create world
`--------------------------
Intro_pick:
CLS
load music "music1.wav",1
load image "MEDIA/textures/backround.bmp",10
paste image 10,0,0
suspend for key
disable escapekey
gosub menu
Menu:
` MENU LOOP
loop music 1
do:cls
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-130,"-Battles within-"
center text screen width()/2,screen height()/2-100,"-Geometry has reached the edge of the world...-"
set text to normal
set text size 16
center text screen width()/2,screen height()/2-70,"Created by: Marlin Studios"
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,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
sync:loop
credits:
cls:texty#=screen height()
do:cls
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 you 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(4) + 1
totalhealth = totalhealth * 100
totalmana = RND(4) + 1
totalmana = totalmana * 100
health = totalhealth
mana = totalmana
intell = RND(9) + 1
intell = intell * 10
set text to normal
Randomize timer()
ink rgb(255,0,0),0
print "HEALTH :",totalhealth,"/500"
ink rgb(0,0,255),0
print "MANA :",totalmana,"/500"
ink rgb(0,255,0),0
print "SPIRIT' :",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 _Intro
return
_Get_Stats:
do
gosub STATS_
gosub _Wait_For_Key
loop
_Intro:
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
SkyCycle: `Here's our gosub
DayNight=DayNight+1
if DayNight=SkyChange `Basically, when DayNight= our Skychange variable, it's updated.
if Darken>199 then Add=0 `These two lines tell us whether to darken or lighten the sky.
if Darken<1 then Add=1
If Add=1 then Darken=Darken+1 `If we need more light add it.
If Add=0 then Darken=Darken-1 `If we need less light, take it away
set ambient light Darken `Increase or decrease the scene lighting
`These next two parts are where the sky actually changes color.
`The backdrop won't effect objects, but the ambient lights will.
if Add=1
COLOR BACKDROP rgb(0,0,55+Darken)
color ambient light rgb(55+Darken,55+Darken,55+Darken)
else
COLOR BACKDROP rgb(55,55,55+Darken)
color ambient light rgb(55+Darken,55+Darken,55+Darken)
endif
DayNight=0
endif
Return
`Feel free to tweak this command as you like.
`:)
_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
load image "MEDIA\textures\enemy.bmp",11
load image "MEDIA\textures\shop.bmp",12
load sound "DINGDONG.wav",1
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=12
make object sphere enemy,30
position object enemy,399,58,833
texture object enemy,11
enemy2=19
make object sphere enemy2,30
position object enemy2,702,84,1189
texture object enemy2,11
enemy3=20
make object sphere enemy3,30
position object enemy3,434,20,1579
texture object enemy3,11
enemy4=21
make object sphere enemy4,30
position object enemy4,783,74,1756
texture object enemy4,11
enemy5=22
make object sphere enemy5,30
position object enemy5,1234,60,1901
texture object enemy5,11
enemy6=23
make object sphere enemy6,30
position object enemy6,1264,63,1210
texture object enemy6,11
enemy7=24
make object sphere enemy7,30
position object enemy7,1144,78,892
texture object enemy7,11
enemy8=25
make object sphere enemy8,30
position object enemy8,109,85,1205
texture object enemy8,11
enemy9=26
make object sphere enemy9,30
position object enemy9,328,23,2083
texture object enemy9,11
enemy10=27
make object sphere enemy10,30
position object enemy10,724,64,2439
texture object enemy10,11
alle# = enemy and enemy2 and enemy3 and enemy4 and enemy5 and enemy6 and enemy7 and enemy8 and enemy9 and enemy10
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
rem set extended collision for player using separate object
make object sphere 200,40 `<<<<<< set this to desired range
position object 200,445,61,356
color object 200,rgb(50,50,50)
set object collision on 200
ghost object on 200
hide object 200
load object "MEDIA/Models/sword.x",9999
MAKE MESH FROM OBJECT 1,9999
DELETE OBJECT 9999
ADD LIMB 1,1,1
OFFSET LIMB 1,1,20,0,-10
rotate limb player,1,0,-100,0
color limb player,1,rgb(255,255,0)
scale limb player,1,500,500,500
`Load shield
load object "MEDIA\models\shield.x",9999
MAKE MESH FROM OBJECT 2,9999
DELETE OBJECT 9999
ADD LIMB 1,2,2
OFFSET LIMB 1,2,-22,-10,-10
rotate limb player,2,0,-100,0
color limb player,2,rgb(255,255,100)
scale limb player,2,520,600,520
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
gold = 500
armor=100
used=0
time_until_ready=100
stuck = 0
health = totalhealth
mana = totalmana
XP = 0
level = 1
light1 = 1
block1 = 13
block2 = 14
block3 = 15
block4 = 16
block5 = 17
block6 = 18
totalxp = 500
limb#=0
enemyhp = 100
enemyhp2 = 100
enemyhp3 = 100
enemyhp4 = 100
enemyhp5 = 100
enemyhp6 = 100
enemyhp7 = 100
enemyhp8 = 100
enemyhp9 = 100
enemyhp10 = 100
hpot = 1
mpot = 1
LBS = 2
PBS = 1
HTS = 3
MTS = 3
HPS = 3
MPS = 3
damagetaken = 5
`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,300,70
make object box block4,70,300,70
position object block1,550,5,550
position object block2,357,68,533
position object block3,615,34,553
position object block4,646,49,651
texture object block1,3
texture object block2,3
texture object block3,3
texture object block4,3
`Position Character at starting POS
position object player, 445,61,356
` SETUP
CLS 0
hide mouse
set text to normal
`Main Loop
do
sprite 1,mousex(),mousey(),9
position light light1,X#,Y#-10,Z#
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: "+str$(Health),"/",totalhealth
ink rgb(180,180,0),0
set cursor 460,texty#+10
print "Coins: ",gold
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,"/",totalXP
set cursor 0,30
ink rgb(255,255,255),0
print ""
print "Health potions: (",hpot,"). Hotkey: [1]"
print "Mana potions: (",mpot,"). Hotkey: [2]"
print "(press control to enter the store)"
`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
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
`Set up blocking
if mouseclick()=2
rotate limb 1,2,0,300,0
damagetaken = 0
else
damagetaken = 5
rotate limb 1,2,0,-100,0
endif
`SHOP
if controlkey()=1
buy_mode:
set cursor 0,0
CLS
do
gosub SkyCycle
set text size 12
sprite 1,mousex(),mousey(),9
set cursor 0,0
paste image 12,0,0 : print "Would you like to purchase some of my wares?"
print ""
if gold < 300 then ink rgb(255,0,0),0
if gold >300 then ink rgb(200,200,0),0
print "Current coins: ",gold
ink rgb(255,255,100),0
set text to normal
print "1.Leather breastplate, +50 armor: 300c (Hotkey: 1). (",LBS,"x In stock)"
print "2.Plate breastplate, +100 armor: 1000c (Hotkey: 2). (",PBS,"x In stock)"
print "3.Health Tome,+50 overall health: 150c (Hotkey: 3). (",HTS,"x In stock)"
print "4.Mana Tome,+50 overall mana: 150c (Hotkey: 4). (",MTS,"x In stock)"
print "5.Health Potion: 100 (Hotkey: 5). (",HPS,"x In stock)"
print "6.Mana Potion: 100c (Hotkey: 6). (",MPS,"x In stock)"
print ""
set text size 25
set text to bold
print "Press the spacekey to exit the shop"
print "Press [S] to go to sell mode"
set text size 12
print ""
print ""
print "Purchased:"
set text to normal
ink rgb(200,200,0),0
if leatherbreast = 1 then print "Leather breastplate (+50armor)"
if platebreast = 1 then print "Plate breastplate (+100armor)"
if hptome = 1 then print "Health tome (+50health)"
if mptome = 1 then print "Mana tome (+50mana)"
if hpots = 1 then print "Health Potion: x",hpot
if mpots = 1 then print "Mana Potion: x",mpot
if keystate(2) and gold=>300 and LBS=>1 and timer()>LB+1000
leatherbreast = 1
armor = armor+50
gold = gold-300
LBS = LBS - 1
LB=timer()
endif
if keystate(3) and gold=>1000 and PBS=>1 and timer()>PB+1000
platebreast = 1
armor = armor+100
PB=timer()
gold = gold-1000
PBS = PBS - 1
endif
if keystate(4) and gold=>150 and HTS=>1 and timer()>HT+700
hptome = 1
totalhealth = totalhealth+50
gold = gold-150
HT=timer()
HTS = HTS - 1
endif
if keystate(5) and gold=>150 and MTS=>1 and timer()>MT+700
mptome = 1
totalmana = totalmana+50
gold = gold-150
MT=timer()
MTS = MTS - 1
endif
if keystate(6) and gold=>100 and HPS=>1 and timer()>HPO+700
hpots = 1
hpot = hpot + 1
gold = gold-100
HPO=timer()
HPS = HPS - 1
endif
if keystate(7) and gold=>100 and MPS=>1 and timer()>MPO+700
mpots = 1
mpot = mpot + 1
gold = gold-100
MPO=timer()
MPS = MPS - 1
endif
set text size 25
if keystate(31)
CLS
if items = 0 then print "You have no items to sell"
print "[Press any key] to return to buy mode"
suspend for key
endif
if spacekey()=1 then exit
sync
loop
endif
`Healing potions
if keystate(2) and hpot >=1 and timer()>timh+5000
dec hpot,1
health = health + 100
timh=timer()
if health >= totalhealth then health = totalhealth
endif
if keystate(3) and mpot >=1 and timer()>timm+5000
dec mpot,1
timm=timer()
mana = mana + 100
if mana >= totalmana then mana = totalmana
endif
`Stats menu
if keystate (18)
CLS
ink rgb(200,200,0),0
set text size 25 : print "STATS:"
set text size 18
ink rgb(220,0,0),0
print "Health: ",health,"/",totalhealth
print "Mana: ",mana,"/",mana
print "Spirit: ",intell
print "Coins: ",gold
print "Armor: ",armor
print "EXP: ",XP,"/",totalxp
print ""
print ""
print "Current Armor in Inventory:"
if leatherbreast = 1 then print "Leather breastplate (+50 armor)"
if platebreast = 1 then print "Plate breastplate (+100 armor)"
print ""
set text size 25 : print "Press Any Key to Continue Your Game"
suspend for key
endif
`Controls menu
if keystate(46)
CLS
set text size 20
print "Controls:"
set text size 12
print "W: UP"
print "A: LEFT"
print "S: DOWN"
print "D: RIGHT"
print "C: Controls"
print "Control: Enter the shop"
print "E: Stats"
print "ESC: Exit Menu"
print ""
set text size 25 : print "Press Any Key to Continue Your Game"
suspend for key
endif
`ATTACK
if mouseclick()=1
limbtime#=timer()
rotate limb player,1,50,0,0
limb#=1
endif
if Mouseclick()=1 and BulletLife=0
Position object bullet,X#,Y#,Z#
Set object to camera orientation bullet
BulletLife = 2
Show object bullet
Endif
If BulletLife > 0
Dec BulletLife
Move object bullet,10
hide object 11
If BulletLife = 0 then position object bullet,22023020320,3934390238493,329040923809380
Endif
`Rotate sword when you click
if limb#=1
if timer()=>limbtime#+100 then rotate limb player,1,0,-100,0 and limb#=0
endif
`set up object collision for enemys
if timer()>tima+500 and object collision (1,enemy)
dec Health,damagetaken
tima=timer()
endif
`set up object collision for enemys
if timer()>timb+500 and object collision (1,enemy2)
dec Health,damagetaken
timb=timer()
endif
`set up object collision for enemys
if timer()>timc+500 and object collision (1,enemy3)
dec Health,damagetaken
timc=timer()
endif
`set up object collision for enemys
if timer()>timd+500 and object collision (1,enemy4)
dec Health,damagetaken
timd=timer()
endif
`set up object collision for enemys
if timer()>time+500 and object collision (1,enemy5)
dec Health,damagetaken
time=timer()
endif
`set up object collision for enemys
if timer()>timf+500 and object collision (1,enemy6)
dec Health,damagetaken
timf=timer()
endif
`set up object collision for enemys
if timer()>timg+500 and object collision (1,enemy7)
dec Health,damagetaken
timg=timer()
endif
`set up object collision for enemys
if timer()>timh+500 and object collision (1,enemy8)
dec Health,damagetaken
timh=timer()
endif
`set up object collision for enemys
if timer()>timi+500 and object collision (1,enemy9)
dec Health,damagetaken
timi=timer()
endif
`set up object collision for enemys
if timer()>timj+500 and object collision (1,enemy10)
dec Health,damagetaken
timj=timer()
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,12)
dec enemyhp,1
tim2=timer()
if enemyhp = 0
objectmove1 = 1
position object 12,3914783,3142134,123432
inc hpot,rnd(1)
inc XP,125
inc gold,rnd(80)
inc enemyhp, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,19)
dec enemyhp2,1
tim2=timer()
if enemyhp2 = 0
objectmove2 = 1
position object 19,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp2, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,20)
dec enemyhp3,1
tim2=timer()
if enemyhp3 = 0
objectmove3 = 1
position object 20,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp3, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,21)
dec enemyhp4,1
tim2=timer()
if enemyhp4 = 0
objectmove4 = 1
position object 21,3914783,3142134,123432
inc hpot,rnd(1)
inc XP,125
inc gold,rnd(80)
inc enemyhp4, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,22)
dec enemyhp5,1
tim2=timer()
if enemyhp5 = 0
objectmove5 = 1
position object 22,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp5, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,23)
dec enemyhp6,1
tim2=timer()
if enemyhp6 = 0
objectmove6 = 1
position object 23,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp6, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,24)
dec enemyhp7,1
tim2=timer()
if enemyhp7 = 0
objectmove7 = 1
position object 24,3914783,3142134,123432
inc hpot,rnd(1)
inc XP,125
inc gold,rnd(80)
inc enemyhp7, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,25)
dec enemyhp8,1
tim2=timer()
if enemyhp8 = 0
objectmove8 = 1
position object 25,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp8, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,26)
dec enemyhp9,1
tim2=timer()
if enemyhp9 = 0
objectmove9 = 1
position object 26,3914783,3142134,123432
inc XP,125
inc gold,rnd(80)
inc enemyhp9, 100
endif
endif
`Set up enemy death collision
if timer()>tim2+70 and object collision(11,27)
dec enemyhp10,1
tim2=timer()
if enemyhp10 = 0
objectmove10 = 1
position object 27,3914783,3142134,123432
inc hpot,rnd(1)
inc XP,125
inc gold,rnd(80)
inc enemyhp10, 100
endif
endif
`Print Enemy health of enemy (12)
cex=object screen x(12)
cey=object screen y(12)-60
if object collision (200,12)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp,"%"
endif
cex=object screen x(19)
cey=object screen y(19)-60
if object collision (200,19)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp2,"%"
endif
cex=object screen x(20)
cey=object screen y(20)-60
if object collision (200,20)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp3,"%"
endif
cex=object screen x(21)
cey=object screen y(21)-60
if object collision (200,21)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp4,"%"
endif
cex=object screen x(22)
cey=object screen y(22)-60
if object collision (200,22)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp5,"%"
endif
cex=object screen x(23)
cey=object screen y(23)-60
if object collision (200,23)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp6,"%"
endif
cex=object screen x(24)
cey=object screen y(24)-60
if object collision (200,24)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp7,"%"
endif
cex=object screen x(25)
cey=object screen y(25)-60
if object collision (200,25)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp8,"%"
endif
cex=object screen x(26)
cey=object screen y(26)-60
if object collision (200,26)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp9,"%"
endif
cex=object screen x(27)
cey=object screen y(27)-60
if object collision (200,27)
ink rgb(255,0,0),0
set cursor cex,cey
print "Enemy health = ",enemyhp10,"%"
endif
`------------------------------------`
`---------leveling up----------------`
`------------------------------------`
if XP=totalxp
play sound 1
color object player,rgb (rnd(255),rnd(255),rnd(255))
inc totalhealth,100
inc totalmana,100
inc health,10000
inc mana,10000
inc level,1
inc totalxp,500
if health < totalhealth then health = totalhealth
if mana < totalmana then mana = mana
if health < totalhealth then health = 100
if mana < totalmana then mana = 100
XP=0
endif
`Win
if objectmove1 = 1 and objectmove2 = 1 and objectmove3 = 1 and objectmove4 = 1 and objectmove5 = 1 and objectmove6 = 1 and objectmove7 = 1 and objectmove8 = 1 and objectmove9 = 1 and objectmove10 = 1
cls
set text size 60
center text 320,240,"You win!"
set text size 25
center text 320,200,"Press [Spacekey] to quit"
if spacekey()=1 then end
endif
`exit menu
if escapekey()=1
cls
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-"
set text size 15
center text screen width()/2,screen height()/2-40,"Press E for STATS (in game). Press C for controls (in game) "
suspend for key
if keystate(16)
end
endif
endif
`Set up player death
if health = 0
CLS
do
set text size 60
center text 320,240,"Game Over!"
set text size 18
center text 320,200,"Press [Spacekey] to quit"
if spacekey()=1 then end
sync
loop
endif
`set up health regen
if timer()>hpreg+1500
inc Health
hpreg=timer()
if health > totalhealth then health = totalhealth
endif
`set up mana regen
if timer()>mpreg+1500
inc mana
mpreg=timer()
if mana > totalmana then mana = totalmana
endif
Rem Detect collision
If Object collision(player,0)>0 AND object collision(player,0) <> 200 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)
`Position special collision item to go around player
position object 200,X#,Y#,Z#
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
and the only reason i could was becuase of the tutorials out there.
[href]http://snowfall.homestead.com [/href]