奇怪东西研究所
跟著一群小伙伴做一些奇怪的東西
所以就要研究下面的代碼了QAQ
;劇本文件大概就是這樣,";"號后面是注釋,被/**/框住的也是注釋, ;標簽符號是[]或者@,跟krkr一樣,不過@后面只能跟一行命令噢。 ;[p]標簽比較常用,作用是暫停,點擊鼠標執(zhí)行下一行命令 @call file=wide/libs/utils [bg_new name="background" storage="Bg-3"];實例化一個背景,storage后面的是圖片名字 [bg_show name="background"];顯示背景 ;系統(tǒng)表示,這里主要是對話框, [showmessage] [call file=wide/system target="*system_setting_buttons"] [text_new name=_sp_chara_name layer=ui x="-168" y=-108.5 val="" color="DDFF00" fontsize=16 anchor="MiddleLeft"] [text_show name="_sp_chara_name"] ;這塊主要是立繪的實例化,那兩個@命令就是設置所有立繪的標簽,也可以在實例化立繪是添加各自不同的標簽~ @tag_default tag="chara" [chara_new name="mayi" storage="mayi-default" jname="mayi" scale=1 jcolor=FF77FF] [chara_new name="rin" storage="rin-default" jname="Rin" scale=1 jcolor=22FFFF] ;[chara_new name="majic" storage="rin-default" jname="Rin" scale=1 jcolor=22FFFF] @reset_tag_default;mayi表情登録 [chara_face name="mayi" face="angry" storage=mayi-angry] [chara_face name="mayi" face="smile" storage=mayi-smile];rin表情登録 [chara_face name="rin" face="angry" storage=rin-angry] [chara_face name="rin" face="smile" storage=rin-smile];設置立繪的位置 @chara_pos name="mayi" x=0 y=-0.7 @chara_pos name="rin" x=-5 y=-0.7 [playbgm wait=false time=1 storage="music"] [calc exp="global.cgnum={global.cgnum}+1"] #廠長 聽說這個地方許愿很靈的樣子呢![p] 女神喲……我想和大家做游戲……[l]請指引我,該如何下手呢?[p] ;選項卡 [select_new text="許愿什么的還是太唯心啦!回家吧!" target=*select_a1 ];target標記了執(zhí)行該選項后跳到的位置 [select_new text="向女神獻上自己的身體 " target=*select_a2 ] [select_new text="在女神雕像前唱歌" target=*select_a3 ] [select_show sound=click];點擊選項卡后出現(xiàn)的聲音 ;[s]停止場景文件的執(zhí)行 [s]*select_a1 #廠長 算了,還是回去吧,我在學校還是團支書呢,封建迷信可不能搞……[p] #? (尖叫聲)那邊的少女,不能走![p] #廠長 誰……誰呀……這荒郊野嶺的,難道遇上強盜了!不會對我劫些啥吧!![p] @jump target=*a_common*select_a2 #廠長 女神喲,如果您能給我明示,妾身愿出家為牧師,青燈古卷,終身侍奉您……[p] #…… 野生的神獸跳出來了![p] [image_new name="bear" storage="bear" scale=1.7];顯示圖片 [show name="bear" x=0 y=1.5] #神獸 吾乃女神之守護神獸,有數(shù)萬年的修為,少女喲,讓我看看汝之命運。[p] #神獸 ……汝的命運,并不簡單!!!! #神獸 汝的前世,乃天命之滅世者,萬物的終結者。無可阻擋,無可違逆,汝即大災變![p] #廠長 這都啥跟啥呀……[p] #神獸 總之這神殿里多你一個太多,少你一個剛好,為了世界和平你還是去做游戲去吧……[p] #…… (神獸消失了)[p] [hide name="bear"] [remove name="bear"] #? 好像看到不得了的了呢!需要幫忙嗎?[p] #廠長 你……你是那個…[p] @jump target=*a_common*select_a3 #廠長 好像祈禱完之后要唱圣歌來著?[p] #廠長 你是我的小呀小?……不,不對,[l]秋蘭兮麋蕪,羅生兮堂下。綠葉兮素華,芳菲菲兮襲予。夫人自有兮美子,蓀何?兮愁苦……[p] #? 停!停止![p] #廠長 ?怎么啦……[l]咦?原來有人在這兒呀……[p] #坐在椅子上的少女 這是東方的禱文吧!西方的女神怎么可能聽得懂,還有,你太!吵!啦!![p] ;顯示并記錄第一張CG [bg_mod name="background" storage="Bg-12"] [if exp="{global.cg1}==0"] [calc exp="global.cg1=1"] [endif] #…… 眼前出現(xiàn)了一位神職人員打扮的少女[p] #坐在椅子上的少女 總之在這里不可以大聲喧嘩![p] #廠長 抱、抱歉……我馬上就走[p] #…… 【獲得結局】:因為太吵鬧被趕回家[p] @jump scene=new file=wide/title*a_common @show name=mayi #mayi 你好喲,我叫Mayi,想不到這里會碰上游戲制作的同好呢![p] #廠長 你……你就是騷尼公司有名的那個游戲制作人![p] #mayi 沒錯沒錯,碰上你真是緣分吶[p] [chara_mod name="mayi" face="smile"] 少女喲,需要我你引領走向星辰大海嗎[p] #廠長 教練!請指引我把![p] #mayi 不要叫教練[p] [chara_mod name="mayi" face="default"] 要叫姐姐大人喲[p] #mayi 總之,工欲善其事必先利其器,要想做游戲,選好一個好的引擎很重要,構建你我現(xiàn)在所處這個次元的引擎叫Unity……[p] [image_new name="unity_logo" storage="unity_logo" scale=1] [show name="unity_logo" x=4 y=1.5] #廠長 (認真地拿出了小本本)這個引擎有啥特點呢?[p] [hide name="unity_logo"] [remove name="unity_logo"] #mayi 這個……那個……[p] [chara_mod name="mayi" face="angry"] 對、對了,限于篇幅這個問題的話,還是等少女你穿越結束,問下這個demo的制作人好了![p] #廠長 大姐喲,您靠譜不啊……[p] #mayi 肯、肯定靠譜啊……[p] [chara_mod name="mayi" face="default"] 對了,一定是環(huán)境、環(huán)境問題啦!得換個地方,快過來,我要發(fā)動次元傳送陣了![p] #廠長 這……這個世界有如此魔幻的設定沒問題嗎……等等我啊![p] [bg_mod name="background" storage="room"] #mayi 嗯嗯,這里感覺好多啦。[p] #廠長 確實這比較像學習的地方……[p] #mayi 總之我的講解就到這里結束啦[p] #廠長 啥……這就結束了么..[p] [chara_mod name="mayi" face="smile"] #mayi 還有什么問題嗎?沒有我就消耗一個靈魂石,發(fā)動大召喚術叫下一位老師了。[p] #廠長 大召喚術……我已經(jīng)習慣這個世界的設定了……[p] [chara_mod name="mayi" face="default"] #mayi Rin醬,就決定是你了,出來吧![p] [anim name="mayi" x=-3 type="easeInQuad"];爆炸的動畫 [image_new name="explosion" storage="a1" y=2 scale=6] [image_face name="explosion" face=explosion2 storage="a2"] [image_face name="explosion" face=explosion3 storage="a3"] [image_face name="explosion" face=explosion4 storage="a4"] [image_face name="explosion" face=explosion5 storage="a5"] [image_face name="explosion" face=explosion6 storage="a6"] [image_face name="explosion" face=explosion7 storage="a7"] [image_face name="explosion" face=explosion8 storage="a8"] [image_face name="explosion" face=explosion9 storage="a9"] [image_face name="explosion" face=explosion10 storage="a10"] [image_face name="explosion" face=explosion11 storage="a11"] [image_face name="explosion" face=explosion12 storage="a12"] [playse storage="explosion"];播放聲音 [image_show name=explosion time=0.1] [image_mod name=explosion face="explosion2" time=0.1] [image_mod name=explosion face="explosion3" time=0.1] [image_mod name=explosion face="explosion4" time=0.1] [image_mod name=explosion face="explosion5" time=0.1] [image_mod name=explosion face="explosion6" time=0.1] [image_mod name=explosion face="explosion7" time=0.1] [image_mod name=explosion face="explosion8" time=0.1] [image_mod name=explosion face="explosion9" time=0.1] [image_mod name=explosion face="explosion10" time=0.1] [image_mod name=explosion face="explosion11" time=0.1] [image_mod name=explosion face="explosion12" time=0.1] [stopse storage="explosion"] [image_remove name="explosion"] ;爆炸動畫結束 [stopbgm] @playbgm storage="dream" @show name="rin" x=3 #廠長 背景音樂的畫風變了,自帶BGM的妹子么![p] #mayi 這位就是Rin噢,是我的前輩,在游戲制作方面非常厲害哦![p] [chara_mod name="rin" face="smile"] #rin 還好還好,也就比你的水平高一點吧。[p] #廠長 那么,請把做游戲的方法教給我把![p] [chara_mod name="rin" face="angry"] #rin 這個議題太大了啦……我想想,還是從簡單的團隊組建說起吧![p] #廠長 那么一個游戲團隊需要那些人呢?[p] [chara_mod name="rin" face="default"] #rin 嗯……最主要的就是戰(zhàn)士、法師、牧師吧……[p] #廠長 戰(zhàn)法牧……這是要單挑boss,怒刷裝備,皇城PK,勝者為王的節(jié)奏嗎?[p] #rin 不是咯,我一個個解釋吧……[p] #rin 牧師指的當然是策劃……游戲的靈魂就是游戲性了,而策劃就是守護游戲靈魂的人,如何讓游戲更好玩?如何讓劇本更吸引人?都是策劃要思考的問題。[p] #廠長 好像策劃要思考的東西蠻多的……[p] #rin 沒辦法,策劃在團隊里一般都是leader的角色,必須得66666……[p] #廠長 那……戰(zhàn)士呢?[p] #rin 戰(zhàn)士當然指的就是程序啦,要把一個個策劃的想法化為實際,必須要同一行行代碼戰(zhàn)斗,還有讓人頭大的算法……[p] #廠長 那最后的法師呢?[p] #rin 法師即是美術和音樂,游戲的畫面、音樂都是給予玩家第一印象的東西,這東西如果不如魔法般華麗地直擊人心的話可不行喲~[p] #廠長 懂了!還有么!前輩,請告訴我更多的知識吧![p] [chara_mod name="rin" face="angry"] #rin 下次啦,我那邊還掛著游戲呢就被召喚過來了,點卡在燃燒,先走咯![p] [anim name="rin" x=15] [hide name="rin"] [remove name="rin"] @anim name=mayi x=0 #廠長 ……[p] #mayi 啊哈哈……前輩還是那么急性子呀!那么我們也走吧![p] #廠長 門好像是鎖的樣子……[p] [chara_mod name="mayi" face="angry"] #mayi 糟了!我的傳送術還在冷卻中,我們被困在密室了![p] #廠長 教室里面,一般不都會有備用鑰匙的嗎?[p] #mayi 可是,鑰匙會放在哪里呢?一起找找看吧![p] [hide name=mayi] ;定義三個點擊區(qū),要設置新的點擊區(qū)可以通過運行unity,找到生成的clickable實例,通過Scence界面確定精確的位置和大小 ;scale_x,scale_y是以點擊區(qū)為中心原點的坐標 [clickable name="click1" tag=clickable a=0 scale_x=2.37 scale_y =0.55 x=0.1 y=0.8] [clickable name="click2" tag=clickable a=0 scale_x=0.4 scale_y=0.3 x=1.79 y=2.07] [clickable name="click3" tag=clickable a=0 scale_x=0.58 scale_y=1.51 x=-7.21 y=1.43] [clickable name="click4" tag=clickable a=0 scale_x=0.8 scale_y=0.8 x=6.08 y=0.42] [clickable name="click5" tag=clickable a=0 scale_x=0.47 scale_y=0.25 x=-4.52 y=1.33] [clickable name="click6" tag=clickable a=0 scale_x=0.89 scale_y=0.51 x=-4.99 y=0.06] [clickable name="click7" tag=clickable a=0 scale_x=0.64 scale_y=0.51 x=-0.19 y=-0.39] [clickable name="click8" tag=clickable a=0 scale_x=0.34 scale_y=0.24 x=-0.23 y=2.2];定義點擊事件,若發(fā)生點擊事件,跳到該標簽 [evt name="click1" target="*clickable1"] [evt name="click2" target="*clickable2"] [evt name="click3" target="*clickable3"] [evt name="click4" target="*clickable4"] [evt name="click5" target="*clickable5"] [evt name="click6" target="*clickable6"] [evt name="click7" target="*clickable7"] [evt name="click8" target="*clickable8"];[calc exp="f.test=500"],定義一個游戲變量test,值等于500 ;[calc exp="sf.test2=400"]定義一個系統(tǒng)變量test2系統(tǒng)變量等于400 ;[calc exp="f.test2={f.test}*3"]定義一個游戲變量test2等于另外一個變量test乘以3 [calc exp="f.clock=0"] *cli #…… 請點擊畫面,找到鑰匙吧![p] [cm] ;事件恢復 @evt_resume[s] *clickable1 ;!!!!!!!!!!!注意evt_stop會導致存不起檔的事件發(fā)生 @evt_stop 普通的黑板,沒什么好奇怪的[p] @jump target=*cli*clickable2 @evt_stop[if exp="{f.clock}==1"][image_new name="key" storage="key" scale=1][show name="key" x=0 y=1.5]原來鑰匙被卡在了鐘的后面[p]@jump target="clear" [else]這個時鐘似乎有一些奇怪。[p][calc exp="f.clock=1"] [endif] @jump target=*cli*clickable3 @evt_stop 窗外是一片萬里無云的好天氣[p] @jump target=*cli*clickable4 @evt_stop 大門緊緊地關著,必須有鑰匙才行呢……[p] @jump target=*cli*clickable5 @evt_stop 電視機……不過現(xiàn)在可不是看《熊出沒》的時候吧。[p] @jump target=*cli*clickable6 @evt_stop 書架上有一張紙條,上面寫著“奇怪的地方請多檢查幾遍噢!”[p] @jump target=*cli*clickable7 @evt_stop 講臺里面只有一些粉筆黑板擦之類的東西……[p] @jump target=*cli*clickable8 @evt_stop 播音喇叭,鑰匙肯定不會藏在這里。[p] @jump target=*cli [s] *clear @clickable_remove tag=clickable @evt_resume [hide name="key"] [remove name="key"] #廠長 好的,找到鑰匙了,咱們出去啦[p] [chara_mod name="mayi" face="smile"] #mayi 呼~太好了,這次還好有你在[p] [chara_mod name="mayi" face="default"] #mayi 那么,出發(fā)吧!!少女喲,只要你邁出了這一步,你的前方征途必定是星辰大海!再見啦~~[p] [anim name="mayi" x=15] [hide name="mayi [remove name="mayi"] #廠長 出個教室門至于那么夸張么……那下次再見好了……[p] [bg_mod name="background" storage="school"] [if exp="{global.cg2}==0"] [calc exp="global.cg2=1"] [endif] #…… 【獲得結局】未完待續(xù)(點擊鼠標回到起始界面)[p] @jump scene=new file=wide/title轉載于:https://www.cnblogs.com/qscqesze/p/5377732.html
總結
- 上一篇: 怎样邀请家长加入班级优化大师
- 下一篇: Linux链接库二(动态库,静态库,库命