News:

Function Finder  Find all the functions within source code files

Main Menu

Control NPC

Started by ATLUS, October 28, 2008, 09:43:09 AM

Previous topic - Next topic

ATLUS

So me need litle help i do run but me algoritm not work ??? so me need to double click key and NPC run if 1 click NPC walk.
its me code
setfps 10
x#=700
sped#=0.0001

do
cls rgb(0,0,0)
if leftkey()=true
x#=x#-sped#
walk=true
if walk=true
time = Timer()
if leftkey()=false

if timer()-time>=5000 and leftkey()=true
sped#=2
endif
endif
endif
endif
print x#
print timer()
print time
sync
loop

kevin


I don't really understand your question,  but perhaps it's something along the lines of.


setfps 30

Constant Standing =0
Constant Walk =1
Constant Run =2


Mode=Standing
Speed#=0
Xpos#=400



Do

cls 0


Select Mode

case Standing
print "Standing"
if LeftKey()=true
KeyPressed=Timer()+1000
mode=Walk
else
KeyPressed=0
mode=standing
endif

case Walk
print "walking"

xpos#=Xpos#+1
if LeftKey()=false
mode=standing
else
if KeyPressed<Timer()
mode=Run
endif
endif
case Run
print "runnning"
xpos#=Xpos#+5

if LeftKey()=false
Mode=Standing
endif


endselect

if Xpos#>800 then Xpos#=0

circle xpos#,300,50,true

Sync
loop


ATLUS

so me need:
left: npc walk
left left: npc run