【文章內容簡介】
碼如下:_whellRotation += _carSpeed * 10。//對車輪設置隨X軸的旋轉偏移量(_whellRotation, _carRotation 180, 0)。//對賽車的前左輪進行絕對旋轉(_whellRotation, _carRotation 180, 0)。//對賽車的前右輪進行絕對旋轉(_carSpeed * 8)。(_carSpeed * 8)。//對賽車后輪使用本地旋轉 (_carRotation * _carSpeed / 20)。//使賽車車身沿著Y軸旋轉第六節(jié) 氮氣加速效果的實現(xiàn)要實現(xiàn)賽車氮氣加速的尾氣效果,首先需要做賽車尾氣效果的3d模型,模型做好后導入舞臺,并且讓其尾隨汽車移動,在這里將尾氣的初始值默認為隱身不可見。當玩家觸發(fā)鍵盤上的空格按鍵時,需要將尾氣設置為可見。為了實現(xiàn)加速的過程,程序中使用了AS3語言中的定時器類。定時器類是ActionScript ,通過AS3的事件分發(fā)響應機制實現(xiàn)周期觸發(fā)[9]。在本文代碼中創(chuàng)建了一個總觸發(fā)次數(shù)為5次的定時器timer。當timer啟動后。并且當timer啟動時,設定了 “addEventListener()”函數(shù)來對timer事件進行監(jiān)聽,監(jiān)聽后編寫addspeed ()方法來處理這個事件。當定義了定時器和監(jiān)聽函數(shù)之后,需要使用 “start()”方法啟動定時器。當加速的過程完成之后,還需要再次綁定一個事件監(jiān)聽,這個事件的作用是將賽車尾氣的效果重新設置為不可見。 實現(xiàn)這些功能的代碼及注釋如下文所示:private var i:int=3。//氮氣次數(shù)最多為3次if((){ i。 //剩余氮氣次數(shù)減少 if(i=0) {=true。 //制造尾氣效果,尾氣的初值效果已經(jīng)被設置為false var timer:Timer=new Timer(200,5)。 //,調用5次后結束()。(,addSpeed)。//4次加速完成后,自動調用timer——plete這個方法(,timerComplete)}}Private function addSpeed(e:TimerEvent):void{ _carSpeed+=3。 //汽車速度提升 trace(加速了...)。 }private function timerComplete(e:TimerEvent):void{ =false。//加速過程的時鐘調用完成后,將尾氣復原為不可見}: 尾氣加速效果圖第四章 程序運行測試當游戲程序啟動開始時,首先在屏幕畫面出現(xiàn)的是游戲的加載進度條界面。: 加載進度條界面截圖游戲文件加載完成后,系統(tǒng)會自動進度游戲主界面,游戲主界面如圖42所示,此時是長鏡頭由遠到近,按下相應按鍵即可開動賽車。: 游戲街景的界面截圖結 論本項目研究基本上達到了預期計劃和目標。論文討論了基于flare3d的網(wǎng)頁版3D賽車游戲開發(fā),探討了目前國外3D游戲的發(fā)展現(xiàn)狀和發(fā)展方向,詳細說明了3D賽車游戲的建模方式和使用flare3d技術進行三維圖形編程的方法。并利用flare3d引擎開發(fā)出了一款3D賽車游戲,實現(xiàn)了諸多功能,增加了碰撞檢測、場景特效等游戲理論和技術的研究,達到了預期效果。在功能點上分別實現(xiàn)了邊界碰撞檢測、汽車力學分析、三維建模,氮氣加速,攝像機管理和場景切換。當然,整個項目還存在諸多不足。技術上,比如程序加載資源耗費較多CPU時間,導致玩家進入游戲緩慢;汽車的氮氣加速的尾氣物理效果如較為粗糙,和實際效果有一定差距;游戲特效較少;沒有加入網(wǎng)絡模塊,不能進行聯(lián)機對戰(zhàn);項目規(guī)劃上,前期缺乏細致嚴密的思考,對項目進度考慮欠佳,導致開發(fā)過程沒有很好的條理性和均勻的進度。 這些不足一方面是由于對flare3d新技術研究不深所造成的,另一方面也是由于我前期考慮不周密造成的。在目前的基礎上,今后有如下開發(fā)計劃:(1) 添加更多的特效,比如說汽車碰撞之后的損毀、汽車之間碰撞時的火花、汽車急速剎車時輪胎印等。(2) 增強物理效果,如重力、碰撞、減速、拐彎的真實性。(3) 添加網(wǎng)絡模塊,實現(xiàn)局域網(wǎng)聯(lián)機對戰(zhàn)。(4) 優(yōu)化程序,減少CPU和內存占用。(5) 優(yōu)化機器人的智能性。添加各種特效,例如爆炸、汽車燈光、輪胎痕跡等。“游戲開發(fā)是高度的設計奇思”。游戲設計是一門學問,它涉及的技術和知識太交叉、太綜合。它包含眾多單獨的環(huán)節(jié),最后還得把這些部分有機地結合起來。經(jīng)過此次游戲開發(fā)經(jīng)歷,我感覺自己還有眾多不足,單有良好的技術是不夠的,設計理念和靈感也同等重要。但只要時間允許,這些都可以經(jīng)過后天的努力去彌補。此次開發(fā)經(jīng)歷所積累的經(jīng)驗,必將成為我人生中的一份寶貴的財富!致謝首先非常感謝我的導師劉歆老師在畢業(yè)設計過程中給我的巨大幫助和鼓勵。這次畢業(yè)設計對我影響很大,學到了許多課本上學不到的東西。在這三個月中,通過劉歆老師的指導,我不但從理論上對自己的專業(yè)有了更好的認識,還積累了不少實踐經(jīng)驗,使我在思想深處體會到,學以致用才是最終的目的,實踐是檢驗所學專業(yè)程度的最好途徑。這三個月,對我來說是寶貴的三個月,它讓我懂得了一個軟件人員不但要有良好的編程習慣,還要有不斷學習的精神和不斷挑戰(zhàn)自己的勇氣。這次的畢業(yè)設計的題目對我來說并不是個全新的課題,因為之前我學過圖形學和OpenGL的相關知識,它們和flare3d關系十分密切。關于本次畢業(yè)設計的課題,所完成的只是一個簡單的3D賽車游戲,還有許多的設想由于時間和自身的因素無法得到實現(xiàn),這是本次設計的遺憾之處。但是,至少它能夠啟發(fā)了我的思維,提高動手能力和解決問題的水平,這是我在課本和課堂中學不到的。這次畢業(yè)設計為以后的學習和工作中上發(fā)揮自己、表現(xiàn)自己提供了堅實的基礎。再次感謝劉歆老師和在整個畢業(yè)設計過程中給我提供建議和幫助的所有同學!參考文獻[1] Reeves,. Particle Systems–A Technique for Modelling a Class of Fuzzy Objects. Computer Graphics,1983,17(3):359376.[2] [美]Richard ,Jr. Benjamin Lipchak著,OpenGL超級寶典(第三版),北京,陳冀康,2005[3] Dave Shreiner ,Mason Woo ,Jackie Neider ,Tom Davis著,OpenGL編程指南(第四版),北京,李嵐,2005[4] [美]Christian Gross編著,AS3基礎教程:第2版,北京,人民郵電出版社,2010[5] [美]Andrew Kirmse編著,游戲編程精粹4,北京,李嵐,2005[6] 潘云鶴、董金祥、陳德人著,計算機圖形學原理,方法及應用(修訂版),北京,高等教育出版社,2003[7] 史濟民等編著,軟件工程(第二版),北京,史濟民,2002[8] [美]Frank ,DirectX 3D游戲開發(fā)編程基礎,北京,清華大學出版社,[9] [美]Miller, Tom編著,Managed Directx 9,Macmillan Computer Pub Press,2005[10] [美]Harrison, Lynn Thomas編著,Introduction to 3d Game Engine Design Using DirectX 9 and C,SpringerVerlag New York Inc,[11] 周衛(wèi)榮,朱天相. 碰撞檢測引擎模塊的設計. 南華大學學報[J]. 2005 (19):8588.[12] 李文娟, 閻光偉, 王媛. 三維物體碰撞檢測中的包圍盒算法. 中國電力教育[J].2008(z2).[13] Frank Luna. Introduction to 3D Game Programming with Direct X : A Shader Approach (Wordware Game and Graphics Library)[M]. Jones amp。 Bartlett Publishers,2006, June.[14] Andre LaMothe. Tricks of the 3D Game Programming GurusAdvanced 3D Graphics and Rasterization[M]. Sams,2003, June.附 錄一、英文原文: 3D game engine technology developed by researchersXie Jingming(Guangzhou Panyu Polytechnic College of Software Engineering, Guangzhou Panyu 511483)Abstract: The game engine is the core of the game development technology, development is difficult and costly. In order to better develop the game talent, according to the characteristics of teaching the game, made ??specifically for teaching game development engine platform, the platform was designed with the general framework of the game engine, the game engine has a major functional characteristics, is a mercial game engine shrink abbreviated version of the game engine technology for the accumulation of experience and teaching the game provides a feasible method of operation.Keywords: game engine。 engine framework。 Game Training。 games teaching modeCLC: Document code: A1 .IntroductionAt present, China39。s game industry is in a period of rapid development, according to International Data Corporation (IDC) report shows that in 2008 the financial crisis, China39。s online game market is still actual sales revenue reached billion yuan, an increase of % pared to 2007, on the contribution related industries reached billion yuan, forecast to 2013, China39。s online game actual sales ine will reach billion yuan. In recent years, actively support the development of animation industry, Shanghai, Hangzhou, Chengdu, Guangzhou, Shenzhen and other places have introduced a series of policies to fightMaking the city39。s animation capital. Guangzhou as the national development of online games and cartoon industry base, the animation industry in 2008 exceeded 10 billion yuan output value, accounting for about 1/5.With the increasing demand for the players, the game uses the technology bees more plex, which gives the game industry has brought great challenges. Game development game engine provides the main technical framework that enables developers to be able to focus on the gameplay and content. A good game engine can effectively improve the efficiency and robustness of game development, accelerate time to market. Although the game industry has been rapid development in recent years, but for development time, technical diffi