[程式] Director 程式練習 問題
以下是程式碼,還在除錯階段,最近剛碰,找了一些範例來看,但是這頁的資訊有點錯誤,導
致我程式碼寫得不夠完整,以至於造成錯誤,主要問題是
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)
→
06/20 15:11, , 1F
06/20 15:11, 1F
→
06/20 22:02, , 2F
06/20 22:02, 2F
→
06/21 17:55, , 3F
06/21 17:55, 3F
GameDesign 近期熱門文章
PTT遊戲區 即時熱門文章