Ok i have 3 proplems...
1. When enemy and player hits they dosent go back their position...
2. How i can select magic/item when i go in magic/itme menu?
3. How i can put statusbox in stacit status box come always when timer is 100 but i wanna stacit it how i do this???
Here is my source code:
----------------------
battle:
#include "***.dba"
delete object 1
delete object 301
load object "models/****_***.x",302
position object 302,70,10,220
rotate object 302,0,180,0
objground#=get ground height(1000,300,200)
rotate object 302,0,180,0
objground#=get ground height(1000,300,200)
load object "models/********.x",303
scale object 303,40,40,40
position object 303,70,objground#+5,260
play object 303
loop object 303
playerlife#=350
enemylife#=1000
pmaxl#=350
position camera 10,33,239
yrotate camera 90
load music "**********.***",1
play music 1
potion#=5
`if potion#=potion#=0 then
` ink colors
white=RGB(255,255,255)
blue=RGB(0,128,255)
black=RGB(0,0,0)
l#=50
fl#=50
e#=80
a#=10
spell1=-60
`your attack
repeat
` timer
tim#=tim#+1
sync
load image "sprites/03.jpg",2
position object 303,70,objground#+5,260
if tim#=100 then gosub mothattack
if tim#<100 then gosub box
position object 303,70,objground#+5,270
until playerlife#>0 OR enemylife#>0
` if you win or die
gosub playing
`now, for everything that goes over the menu, you
`can sprite here
`moth
mothattack:
sync
` makemoth appear to fly - moth attack pattern
position object 303,70,objground#+5,270
wait 0
position object 303,70,objground#+5,270
wait 200
playerlife#=playerlife#-50
position object 303,70,objground#+5,230
wait 200
position object 302,70,10,220
text 220,10,"50"
tim#=tim#-tim#
move#=Move#-1
return
`player attack
playerattack:
sync
sync rate 0
position object 302,70,10,220
wait 0
position object 302,70,10,220
wait 100
enemylife#=enemylife#-25
position object 302,70,10,257
wait 400
position object 303,70,objground#+5,270
text 270,10,"25"
tim#=tim#-tim#
move#=Move#-1
return
box:
` creating the attack box structure
selectedItem=1
do
if move#=1 then gosub mothattack
if move#=2 then gosub playerattack
` Status box
load image "sprites/02.jpg",1
paste image 1,0,499
text 400,520,"HP "+STR$(playerlife#)
text 457,520,"/"+STR$(pmaxl#)
text 330,520,name$
paste image 2,216,408
if enemylife#=0 then end
`print menu items
if selectedItem=1 then ink blue,0 else ink white,0
text 230,420,"Attack"
if selectedItem=2 then ink blue,0 else ink white,0
text 230,470,"Magic"
if selectedItem=3 then ink blue,0 else ink white,0
text 230,520,"Items"
if selectedItem=4 then ink blue,0 else ink white,0
text 230,570,"Escape"
`select menu items
if upkey()=1 and hold=0 then dec selectedItem : hold=1
if downkey()=1 and hold=0 then inc selectedItem : hold=1
if upkey()=0 and downkey()=0 then hold=0
if selectedItem>4 then selectedItem=1
if selectedItem<1 then selectedITem=4
` to select items
if returnkey()=1
`attack opponent
if selectedItem=1 then enemylife#=enemylife#-a# : sync : move#=1
if selectedItem=1 then enemylife#=enemylife#-a# : sync : move#=2
sync : sync
`clear up after myself
sync : sync
`clear up after myself
`quit the game
if selectedItem=4
gosub playing
endif
endif
sync
loop
return
--------------------------------------------------
Thanks For Advance