error و دستور moveto

سلام . در مالتی مدیا بیلدر یه دستوری بود به اسم moveto . که وقتی ازش استفاده میکردیم میتونستیم آبجکت رو با سرعت تعین شده ای به مقصدش برسونیم . من در آپادانا هرچی گشتم نتونستم این دستور رو پیدا کنم و اومدم یه اسکریپت نوشتم که این کار رو برام انجام بده . ولی هنگام اجرا ارور میده :shock:. میخوام بدونم :
1.دلیل این ارور چیه . و چگونه میتونم رفعش کنم؟
2.دستوری هست در آپادانا که کار moveto رو انجام بده؟ . اگه هست ممنون میشم معرفی کنیدش .
اینم کدی هست که نوشتم براش :
کد:
#object.tox = 300.00
$object.name = ""Button1""
#object.speedx = 10.0
#move.fromx = objectx($object.name)
#object.tox = (#object.tox + 1.0)
While (!endloop = 0)
  #move.unit = ((#object.tox - #move.fromx) / (#object.speedx))
  #move.fromx = (#move.fromx + #move.unit)
  #object.y = objecty($object.name)
  obj($object.name).Move(#move.fromx,#object.y)
  #object.x = objectx($object.name)
  If (#object.x = 300) then
    !endloop = 1
  End  
End
 
آخرین ویرایش:

JavidX

Apadana Developer
کدتون رو امشب بررسی میکنم. فقط پاسخ اون سوالی که تو پروفایل پرسیده بودید رو میگم.
کامنت توی آپادانا با باز و بسته کردن {} هست حتما هم باید توی یه خط فقط کامنت بذارید.
 

JavidX

Apadana Developer
این هم دستورات MoveTo برای آپادانا:

اول یه دکمه ایجاد کنید و این کد رو بذارید:
کد:
$o_name = "Button1"
$o_form = "Form1"
$timer_name = "Timer1"
#to_x = 300
#to_y = 500
#speed = 10

#cur_x = ObjectX($o_name)
#cur_y = ObjectY($o_name)
#speed_x = ABS(#to_x-#cur_x)/#speed
#speed_y = ABS(#to_y-#cur_y)/#speed
If (#to_x<#cur_x) then
  #speed_x = -#speed_x
End
If (#to_y<#cur_y) then
  #speed_y = -#speed_y
End
Obj($timer_name,$o_form).Enable(1)
بعد یه تایمر ایجاد کنید و این کد رو بذارید:
کد:
#cur_x = #cur_x+#speed_x
#cur_y = #cur_y+#speed_y
#dx = ABS(#cur_x-#to_x)
#dy = ABS(#cur_y-#to_y)
If (#dx<#speed_x) then
  #cur_x = #to_x
  #speed_x = 0
End
If (#dy<#speed_y) then
  #cur_y = #to_y
  #speed_y = 0
End
Obj($o_name,$o_form).Move(#cur_x,#cur_y)
If (#speed_x=0) & (#speed_y=0) then
  Obj($timer_name,$o_form).Enable(0)
End
 

جدیدترین ارسال ها

بالا