作者wolfx (Cian)
看板GameDesign
标题[程式] Director 程式练习 问题
时间Sat Jun 19 16:21:38 2010
以下是程式码,还在除错阶段,最近刚碰,找了一些范例来看,但是这页的资讯有点错误,导
致我程式码写得不够完整,以至於造成错误,主要问题是
set p_left=posx+x*113
set p_left=posy+y*87
if the mouseH>p_left and the mouseH<p_left+113 and the mouseV>p_top and the
mouseV<p_top+87
the setat picflag,m-2,1
上面这些部分被印刷盖过程式码,所以我以自己的判断撰写的内容,发生错误,恳请高手帮
忙解惑,感恩.
顺带一提,这个程式码主要功能是建立一个简单的拼图游戏.
-------以下程式码-----------
on mousedown
global m,pickflag,posx,posy
set pos=the castnum of sprite 12
set x=(pos-1) mod 3
set y=(pos-1)/3
set p_left=posx+x*113
set p_top=posy+y*87
if the mouseH>p_left and the mouseH<p_left+113 and the mouseV>p_top and the
mouseV<p_top+87 the
setat picflag,m-2,1
set the locV of sprite m to p_top+43.5
set the locH of sprite m to p_left+56.5
set the visible of sprite m to TRUE
set the visible of sprite 12 to FALSE
updatestage
go to frame 3
end if
end
--------结束--------
错误似乎事发生在 mouseV<p_top+87 the 的後面好像差一些语法,不过书上後面刚好没
印刷出来,好烦恼阿.....
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.136.230.129
※ 编辑: wolfx 来自: 220.136.230.129 (06/19 16:43)
1F:→ xxxholic:...感觉是多印了the... 06/20 15:11
2F:→ wolfx:我去试看看 , 谢谢你的建议 06/20 22:02
3F:→ wolfx:还是不行..... 06/21 17:55