3D Game Programming All in One- P12
Số trang: 30
Loại file: pdf
Dung lượng: 414.41 KB
Lượt xem: 19
Lượt tải: 0
Xem trước 3 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
3D Game Programming All in One- P12: During the past several years while working on the Tubettiland “Online Campaign” softwareand more recently while working on the Tubettiworld game, I figure I’ve receivedmore than a hundred queries from people of all ages about how to get started makinggames. There were queries from 40-year-olds and 13-year-olds and every age in between.Most e-mails were from guys I would estimate to be in their late teens or early 20s.
Nội dung trích xuất từ tài liệu:
3D Game Programming All in One- P12 Game Initialization 237 Exec(./server/missionDownload.cs); Exec(./server/clientConnection.cs); Exec(./server/kickban.cs); Exec(./server/game.cs);}//-----------------------------------------------------------------------------package Common {function DisplayHelp() { Parent::DisplayHelp(); Error( Common Mod options: @ -fullscreen Starts game in full screen mode @ -windowed Starts game in windowed mode @ -autoVideo Auto detect video, but prefers OpenGL @ -openGL Force OpenGL acceleration @ -directX Force DirectX acceleration @ -voodoo2 Force Voodoo2 acceleration @ -noSound Starts game without sound @ -prefs Exec the config file );}function ParseArgs(){ Parent::ParseArgs(); // Arguments override defaults... for (%i = 1; %i < $Game::argc ; %i++) { %arg = $Game::argv[%i]; %nextArg = $Game::argv[%i+1]; %hasNextArg = $Game::argc - %i > 1; switch$ (%arg) { //-------------------- case -fullscreen: $pref::Video::fullScreen = 1; $argUsed[%i]++; Team LRN238 Chapter 7 ■ Common Scripts //-------------------- case -windowed: $pref::Video::fullScreen = 0; $argUsed[%i]++; //-------------------- case -noSound: error(no support yet); $argUsed[%i]++; //-------------------- case -openGL: $pref::Video::displayDevice = OpenGL; $argUsed[%i]++; //-------------------- case -directX: $pref::Video::displayDevice = D3D; $argUsed[%i]++; //-------------------- case -voodoo2: $pref::Video::displayDevice = Voodoo2; $argUsed[%i]++; //-------------------- case -autoVideo: $pref::Video::displayDevice = ; $argUsed[%i]++; //-------------------- case -prefs: $argUsed[%i]++; if (%hasNextArg) { Exec(%nextArg, true, true); $argUsed[%i+1]++; %i++; } else Error(Error: Missing Command Line argument. Usage: -prefs ); } Team LRN Game Initialization 239 }}function OnStart(){ Parent::OnStart(); Echo( --------- Initializing MOD: Common ---------); InitCommon();}function OnExit(){ Echo(Exporting client prefs); Export($pref::*, ./client/prefs.cs, False); Echo(Exporting server prefs); Export($Pref::Server::*, ./server/prefs.cs, False); BanList::Export(./server/banlist.cs); OpenALShutdown(); Parent::OnExit();}}; // Common packageactivatePackage(Common);Two key things that happen during game initialization are calls to InitBaseServer andInitBaseClient, both of which are defined in common/main.cs. These are critical func-tions, and yet their actual activities are not that exciting to behold.function InitBaseServer(){ Exec(./server/audio.cs); Exec(./server/server.cs); Exec(./server/message.cs); Exec(./server/commands.cs); Exec(./server/missionInfo.cs); Exec(./server/missionLoad.cs); Exec(./server/missionDownload.cs); Exec(./server/clientConnection.cs); Exec(./server/kickban.cs); Exec(./server/game.cs);} Team LRN240 Chapter 7 ■ Common Scripts function InitBaseClient() { Exec(./client/message.cs); Exec(./client/mission.cs); Exec(./client/missionDownload.cs); Exec(./client/actionMap.cs); Exec(./editor/editor.cs); Exec(./client/scriptDoc.cs); } As you can see, both are nothing more than a set of script loading calls. All of the scripts loaded are part of the common code base. We will look at selected key modules from these calls in the rest of this section. Selected Common Server Modules Next, we will take a close look at some of the common code server modules. The modules selected are the ones that will best help illuminate how Torque operates. The Server Module InitBaseServer loads the common server module, server.cs. When we examine this mod- ...
Nội dung trích xuất từ tài liệu:
3D Game Programming All in One- P12 Game Initialization 237 Exec(./server/missionDownload.cs); Exec(./server/clientConnection.cs); Exec(./server/kickban.cs); Exec(./server/game.cs);}//-----------------------------------------------------------------------------package Common {function DisplayHelp() { Parent::DisplayHelp(); Error( Common Mod options: @ -fullscreen Starts game in full screen mode @ -windowed Starts game in windowed mode @ -autoVideo Auto detect video, but prefers OpenGL @ -openGL Force OpenGL acceleration @ -directX Force DirectX acceleration @ -voodoo2 Force Voodoo2 acceleration @ -noSound Starts game without sound @ -prefs Exec the config file );}function ParseArgs(){ Parent::ParseArgs(); // Arguments override defaults... for (%i = 1; %i < $Game::argc ; %i++) { %arg = $Game::argv[%i]; %nextArg = $Game::argv[%i+1]; %hasNextArg = $Game::argc - %i > 1; switch$ (%arg) { //-------------------- case -fullscreen: $pref::Video::fullScreen = 1; $argUsed[%i]++; Team LRN238 Chapter 7 ■ Common Scripts //-------------------- case -windowed: $pref::Video::fullScreen = 0; $argUsed[%i]++; //-------------------- case -noSound: error(no support yet); $argUsed[%i]++; //-------------------- case -openGL: $pref::Video::displayDevice = OpenGL; $argUsed[%i]++; //-------------------- case -directX: $pref::Video::displayDevice = D3D; $argUsed[%i]++; //-------------------- case -voodoo2: $pref::Video::displayDevice = Voodoo2; $argUsed[%i]++; //-------------------- case -autoVideo: $pref::Video::displayDevice = ; $argUsed[%i]++; //-------------------- case -prefs: $argUsed[%i]++; if (%hasNextArg) { Exec(%nextArg, true, true); $argUsed[%i+1]++; %i++; } else Error(Error: Missing Command Line argument. Usage: -prefs ); } Team LRN Game Initialization 239 }}function OnStart(){ Parent::OnStart(); Echo( --------- Initializing MOD: Common ---------); InitCommon();}function OnExit(){ Echo(Exporting client prefs); Export($pref::*, ./client/prefs.cs, False); Echo(Exporting server prefs); Export($Pref::Server::*, ./server/prefs.cs, False); BanList::Export(./server/banlist.cs); OpenALShutdown(); Parent::OnExit();}}; // Common packageactivatePackage(Common);Two key things that happen during game initialization are calls to InitBaseServer andInitBaseClient, both of which are defined in common/main.cs. These are critical func-tions, and yet their actual activities are not that exciting to behold.function InitBaseServer(){ Exec(./server/audio.cs); Exec(./server/server.cs); Exec(./server/message.cs); Exec(./server/commands.cs); Exec(./server/missionInfo.cs); Exec(./server/missionLoad.cs); Exec(./server/missionDownload.cs); Exec(./server/clientConnection.cs); Exec(./server/kickban.cs); Exec(./server/game.cs);} Team LRN240 Chapter 7 ■ Common Scripts function InitBaseClient() { Exec(./client/message.cs); Exec(./client/mission.cs); Exec(./client/missionDownload.cs); Exec(./client/actionMap.cs); Exec(./editor/editor.cs); Exec(./client/scriptDoc.cs); } As you can see, both are nothing more than a set of script loading calls. All of the scripts loaded are part of the common code base. We will look at selected key modules from these calls in the rest of this section. Selected Common Server Modules Next, we will take a close look at some of the common code server modules. The modules selected are the ones that will best help illuminate how Torque operates. The Server Module InitBaseServer loads the common server module, server.cs. When we examine this mod- ...
Tìm kiếm theo từ khóa liên quan:
thiết kế web giáo trình thiết kế flash CSS cơ bản giáo trình photoshop kỹ thuật cắt htmlGợi ý tài liệu liên quan:
-
Báo cáo thực tập: Đề tài thiết kế Web
77 trang 567 2 0 -
Đề thi thực hành môn Thiết kế Web - Trường Cao đẳng nghề Vĩnh Phúc
3 trang 267 2 0 -
182 trang 173 0 0
-
MỘT SỐ ĐIỂM CẦN CHÚ Ý KHI THIẾT KẾ WEB
5 trang 112 0 0 -
GIÁO TRÌNH LẬP TRÌNH WEB_PHẦN 2_BÀI 3
3 trang 103 0 0 -
Giáo trình Nhập môn thiết kế website
58 trang 82 0 0 -
Tài liệu giảng dạy Thiết kế giao diện Web - Trường CĐ Kinh tế - Kỹ thuật Vinatex TP. HCM
88 trang 72 0 0 -
81 trang 68 0 0
-
112 trang 64 0 0
-
Hướng dân sử dụng Navicat để Create , Backup , Restore Database
7 trang 63 0 0