Sorry about the confusion. Pretty much what i need is a way to have enemies moving back and forth within an area. For example:
Here is the AI---> *^*
Now when I say movement
I mean this--------------> *^*-->*^*-->*^*-->*^*-)
*^*<--*^*<--*^*<--*^*<--
It moves back and forth in, say, a three inch area automaticly.
I know how to do this individually, meaning having on sprite move in a loop. But, when I want to have multiple sprites move, or if I want to move my character, it doesn't work.
Here is the code:
sync on
sync rate 40
a=505
REM health
b=100
REM mana
c=100
d=500
e=200
f=800
x=0
y=0
CLS
load sound "world1-1.wav",2
load image "level1w1.bmp",1
load image "valiantwarrior.bmp",2
load image "valiantwarriorrun1.bmp",3
load image "valiantwarriorrun2.bmp",4
load image "healthbar.bmp",5
load image "mana.bmp",6
load image "lives.bmp",7
load image "1.bmp",11
load image "2.bmp",12
load image "3.bmp",8
load image "health.bmp",9
load image "manabar.bmp",10
load image "ravenhelper.bmp",13
load image "sword.bmp",14
load image "raventalk1.bmp",15
load image "ravenhelperfly1.bmp",16
load image "valiantwarrior2.bmp",17
load image "valiantwarrior4.bmp",19
load image "ghoul.bmp",20
load image "hpotion.bmp",21
load image "valiantwarrior3.bmp",22
load image "gameover.bmp",18
REM background
Sprite 1,x,y,1
Size Sprite 1,2500,700
Set Sprite 1,1,1
REM sword
Sprite 14,d,378,14
Size Sprite 14,70,100
Set Sprite 14,1,1
REM ghoul
Sprite 20,f,383,20
Size Sprite 20,80,90
Set Sprite 20,1,1
REM player
Sprite 2,50,337,2
Size Sprite 2,180,150
Set Sprite 2,1,1
REM health bar
Sprite 5,75,27,5
Size Sprite 5,b,30
Set Sprite 5,1,1
REM mana
Sprite 6,230,5,6
Size Sprite 6,70,70
Set Sprite 6,1,1
REM lives
Sprite 7,520,5,7
Size Sprite 7,70,70
Set Sprite 7,1,1
REM health
Sprite 9,7,5,9
Size Sprite 9,70,70
Set Sprite 9,1,1
REM mana bar
Sprite 10,285,27,10
Size Sprite 10,c,30
Set Sprite 10,1,1
REM 3
Sprite 8,570,13,8
Size Sprite 8,80,60
Set Sprite 8,1,1
REM raven
Sprite 13,a,93,13
Size Sprite 13,180,150
Set Sprite 13,1,1
play sound 2
loop sound 2
Do
If x>0:x=0:endif
if sprite hit(2,20)
dec b,2
Sprite 5,75,27,5
Size Sprite 5,b,30
Set Sprite 5,1,1
ENDIF
if sprite hit(2,20)
dec b,2
Sprite 5,75,27,5
Size Sprite 5,b,30
Set Sprite 5,1,1
ENDIF
If b=0
Sprite 18,270,190,18
Size Sprite 18,100,30
Set Sprite 18,1,1
stop sound 2
Sleep 3000
GOTO Label2
ENDIF
if sprite hit(2,14)
pause sound 2
load sound "caw.wav",3
play sound 3
Sprite 15,330,100,15
Size Sprite 15,300,300
Set Sprite 15,1,1
Sleep 1000
hide sprite 15
Sleep 1000
offset sprite 14,0,-700
offset sprite 2,0,-400
Sprite 17,50,337,17
Size Sprite 17,180,150
Set Sprite 17,1,1
Sleep 1000
hide sprite 13
Sprite 16,a,93,16
Size Sprite 16,180,150
Set Sprite 16,1,1
Sleep 500
mirror sprite 16
Sleep 500
offset sprite 16,-700,-300
resume sound 2
GOTO Label3
ENDIF
if rightkey()=1
x=x-3
d=d-3
a=a-3
e=e-3
f=f-3
g=g-3
hide sprite 2
Sprite 3,50,337,3
Size Sprite 3,180,150
Set Sprite 3,1,1
Sleep 20
x=x-3
d=d-3
a=a-3
e=e-3
f=f-3
g=g-3
delete sprite 3
Sprite 4,50,337,4
Size Sprite 4,180,150
Set Sprite 4,1,1
Sleep 20
x=x-3
d=d-3
a=a-3
e=e-3
f=f-3
g=g-3
delete sprite 4
show sprite 2
ENDIF
Sprite 13,a,93,13
Size Sprite 13,180,150
Set Sprite 13,1,1
Sprite 14,d,378,14
Size Sprite 14,70,100
Set Sprite 14,1,1
Sprite 1,x,y,1
Size Sprite 1,2500,500
Set Sprite 1,1,1
Sprite 20,f,383,20
Size Sprite 20,80,90
Set Sprite 20,1,1
Sprite 21,g,420,21
This is my entire game at the moment. If you notice that there are two very similar parts, that is because at the beginning, you move a bit and then when you collide with the sword, it stops, does dialoug, and then continues.
Some how, I want to encorroperate the movement of multiple sprites in this code
EDIT: sorry, it's a really bad diagram.
Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"