Im having some issues with my sprites. Basically when i scale it its hard to explain but it gets REALLY big before scaling to the proper size. and stays that size as long as I hold the directional button. any help would be great.
(code and .exe included)
Rem Project: kattfight
Rem Created: 2/21/2008 11:01:35 PM
Rem ***** Main Source File *****
`setup the screen
sync on
sync rate 60
`initialize variables
kx=120
ky=240
k1=1
k2=4
lp=0
mo=0
attack=0
ha=0
scale=0
`load up and position katt
set image colorkey 0,130,0
load image "katt.bmp",1
load image "kathands.bmp",3
load image "lv1bg.bmp",2
sprite 2,0,0,2
create animated sprite 1,"katt.bmp",12,2,1
sprite 1,kx,ky,11
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`main loop
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
do
if sprite exist(3)=1
sprite 3,kx,ky,3
size sprite 3, sprite width(1),sprite height(1)
endif
gosub character_control
sync
loop
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`subroutines
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
`--------------------------------------------------------
character_control:
sprite 1,kx,ky,1
play sprite 1,k1,k2,100
if attack=0
if rightkey()=1 and leftkey()=0
if mo=0
set sprite frame 1,7
mo=1
endif
k1=7
k2=12
lp=0
kx=kx+3
if sprite mirrored(1)=1
mirror sprite 1
endif
else
if rightkey()=0 and leftkey()=1
if mo=0
set sprite frame 1,7
mo=1
endif
k1=7
k2=12
lp=1
kx=kx-3
if sprite mirrored(1)=0
mirror sprite 1
endif
else
mo=0
k1=1
k2=4
endif
endif
endif
`attack
if spacekey()=1 and ha=0
if sprite exist(3)=0 then create animated sprite 3,"kathands.bmp",12,2,3
if mo=0
set sprite frame 1,15
mo=1
endif
wait 2
k1=15
k2=17
attack=1
endif
if sprite frame(1)=17 and ha=0
if sprite exist(3) then delete sprite 3
mo=0
attack=0
k1=1
k2=4
ha=0
else
if mo=0
set sprite frame 1,18
mo=1
endif
wait 2
endif
if controlkey()=1 and attack=0
if sprite exist(3)=0 then create animated sprite 3,"kathands.bmp",12,2,3
ha=1
k1=18
k2=20
attack=2
endif
if attack=2 and sprite frame(1)=20
if sprite exist(3) then delete sprite 3
attack=0
wait 10
k1=1
k2=4
endif
`scale up and down
if upkey()=1
if scale<10
scale sprite 1,80
endif
endif
if downkey()=1
if scale>-10
scale sprite 1,120
endif
endif
return
[img="http://lovelyd.shukuya.com/enters/e3.gif"]