XNA 4.0 簡介 靜宜大學資工系 蔡奇偉 副教授 © 2011. 大綱 XNA 簡介 XNA Framework XNA Build XNA Game Studio 建立 XNA 4 的專案 方案的目錄結構 XNA Game Studio 4.0 參考手冊 Hello, XNA XNA Game.

Slides:



Advertisements
Similar presentations
FCU, Department of ECE, IC Design Research Lab. TEL: # 4945 Pre-SIm , Post-Sim.
Advertisements

1 Chemical and Engineering Thermodynamics Chapter 2 Conservation of mass and energy Sandler.
Introduction to Java Programming Lecture 13 Classes I OO Programming.
第 10 章 Java 的執行緒 10-1 執行緒的基礎 10-2 Java 執行緒的使用方法 10-3 Java 執行緒的同步 10-4 管道串流的執行緒.
學習C++的基本語法 認識關鍵字與識別字的不同 學習程式碼偵錯的流程 學習如何提高程式的可讀性
“Rule” By OX. By Check CREATE TABLE 員工薪資 ( 編號 int IDENTITY PRIMARY KEY, 薪資 smallmoney, CHECK ( 薪資 > 0 AND 薪資
PowerPoint2010 李燕秋 版面配置 版面配置指的是每一個頁面的內容配置 方式,不同的版面配置會有對應的母片。
Introduction to Constructor, Overloading, and Accessibility CS340100, NTHU Yoshi.
BY OX. 檢視表與資料表的差異性 查詢 (query) 檢視表 (View) 的紀錄,是經由查詢 (query) 而來,而檢 視表的資料來源可以是單一資料表或是多資料表,甚 至其他檢視表 但檢視表中的紀錄只存在資料表中.
教案課程片頭介紹 教案課程片頭是以圖片透過 Powerpoint 之動畫設 計功能轉變而成的動畫形式所呈現出來的影片, 目的是要讓老師們的課程顯得更加活潑、生動、 有趣,以往傳統的做法大部分都是以文字或投影 片的方式呈現,後來加以改良成為動畫呈現方式, 使得學生在複習課程方面能更加淺顯易懂、激發 出更多學習的興趣與樂趣。
ImageJ Macro Language FileDemo.txt範例
在 Ad-hoc 網路中實現點對 點發送訊息與廣播訊息. 檔案下載  範例程式可在下列網址取得  DEMO 程式可在下列網址取得
Android Class vs. Jar 建國科技大學 資管系 饒瑞佶 2013/4 V1. 從 MyAndroidProject 專案改起 將 BMI_method.java 改寫成 class 方式 步驟 1 :在原 package 內新增一個 class.
Chapter 0 Computer Science (CS) 計算機概論 教學目標 瞭解現代電腦系統之發展歷程 瞭解電腦之元件、功能及組織架構 瞭解電腦如何表示資料及其處理方式 學習運用電腦來解決問題 認知成為一位電子資訊人才所需之基本條 件 認知進階電子資訊之相關領域.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
建立靜態資料成員 關鍵字: static 靜態資料成員不屬於特定物件,而是該類物件 所共同擁有的,可做為類別範圍裡的靜態變數。
Last modified 2004/02 An Introduction to SQL (Structured Query Language )
第 18 章 名稱空間與例外處理 18-1 名稱空間 18-1 名稱空間 18-2 例外處理 18-2 例外處理.
MS-DOS 作業系統 張基昇 (Microsoft-Disk Operating System).
奶酪專賣店系統 組員: B 林家榕 B 莊舜婷.
國立中山大學財產管理系統 線上報廢、盤點系統 總務處保管組 策劃 計算機與網路中心 分析設計 2008/03.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
最新計算機概論 第 5 章 系統程式. 5-1 系統程式的類型 作業系統 (OS) : 介於電腦硬體與 應用軟體之間的 程式,除了提供 執行應用軟體的 環境,還負責分 配系統資源。
Chapter 20 塑模動態觀點:狀態圖 Statechart Diagram. 學習目標  說明狀態圖的目的  定義狀態圖的基本記號  展示狀態圖的建構  定義活動、內部事件及遞延事件的狀態 圖記號.
Hung-Hsiang WuWindows Processing Design1 Chapter 3 基本觀念 變數宣告與型態 特殊運算子符號 字串與數值的轉換 類別與物件的觀念 建立新的專案 WinMain 程式進入點 Include Header File.
第12章 建立多表單與模組的應用程式 12-1 Visual Basic的方案與專案 12-2 模組化Visual Basic應用程式
1 Netlibrary 電子書 Netlibrary 創始於 1998 年,是世界知名的電子書資 料庫,提供 450 多家出版社所出版近 100,962 ( 止)本的電子書,且以每月 2,000 本的 速度增加中。其中 80% 屬於學術性圖書,其餘 20% 一般圖書, 90% 以上為.
各種線上電子資源的特異功能 SwetsWise 的 alert, TOC alert 與 Favorites 2003/4/28 修改.
行政院國家科學委員會工程技術發展處自動化學門 * 試以國立成功大學製造工程研究所 鄭芳田教授 產學合作計畫 : 智慧預測保養系統之設計與實作 成果報告盤點為範例 國科會工程處專題計畫成果典藏 自動化學門成果報告盤點範例.
資料庫程式設計與系統管理 SQL Server 2005 Express 第六章 進階資料庫設計.
第 17 章 架構拍賣網站 17-1 拍賣網站的基礎 17-2 SQL 指令的日期時間處理 17-3 拍賣網站的安裝與架構 17-4 拍賣網站的會員管理 17-5 新增拍賣物 17-6 參與拍賣競標出價 17-7 拍賣網站的系統管理功能.
生物統計學 期中報告 組員 : 醫放一 A 王小明 醫放一 A 王小明 醫放一 A 王大明 醫放一 A 王大明 2009/04/14.
國立聯合大學 資訊管理學系 陳士杰老師 SQL*Plus 與 iSQL*Plus 簡介. 國立聯合大學 資訊管理學系 資料庫系統課程 ( 陳士杰 ) 2 啟動 SQL*Plus 與 iSQL*Plus 方式 Windows 平台.
從此處輸入帳號密碼登入到管理頁面. 點選進到檔案管理 點選「上傳檔案」上傳資料 點選瀏覽選擇電腦裡的檔案 可選擇公開或不公開 為平台上的資料夾 此處為檔案分類,可顯示在展示頁面上,若要參加 MY EG 競賽,做品一律上傳到 “ 98 MY EG Contest ” 點選此處確定上傳檔案.
Chapter 17 Windows API 程式入門 VC++ 與 WindowsVC++ 與 Windows 建構遊戲設計的舞台 建構遊戲設計的舞台.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
Hung-Hsiang WuWindows Processing Design1 Chapter 4 簡單視窗程式 表單與標籤的屬性 按鈕與編輯的屬性 設計簡單的應用程式 表單常用事件 一般鍵盤及滑鼠常見的事件 表單視窗間的呼叫 表單間資料傳送應用 專案選擇設定.
Management Abstracts Retrieval System; MARS 檢索操作.
安全性管理員 Java 學習手冊 p.p SecurityManager 觀念  Java Application 的系統資源存取權限的設 定  可以由 SecurityManager 完全控制 如 : 檔案系統, Thread, 執行外部 process, 網路存取 一旦 Security.
OpenGL in C#.
校園網頁整合平台介紹 電算中心綜合業務組. 大綱 設計理念 功能介紹 實做 FAQ 特殊案例 Q&A.
Chapter 10 m-way 搜尋樹與B-Tree
第12章 多重表單與模組的應用程式 12-1 VB.NET的方案與專案 12-2 模組化VB.NET應用程式 12-3 多重表單的應用程式
PHP+mySQL. 一、何謂 PHP? PHP 的全名為 Hypertext Preprocessor ,它是個被廣泛運 用在網頁程式撰寫的語言,尤其是它能適用於網頁程式的 開發及能夠嵌入 HTML 文件之中,它的語法和 C 、 Java 及 Perl 等語法相似。 PHP 的目的是為了能使網站開發者可以.
概念性產品企劃書 呂學儒 李政翰.
無線通訊網路 Mac 層 TDM 通訊模式的操作與效能研究 專題生 : 林書弘、蔡逸祥、毛建翔、王政 華 指導教授 : 黃依賢.
組合語言與系統程式 軟體使用教學. 軟體下載及安裝 下載 到課程網頁下載 tw/~jiun/ 安裝 解壓縮後將 System Software 資料夾放在 D 槽 (C 槽版本放在 C 之下 )
1 第二十章 大型程式的發展 使用名稱空間 熟悉大型程式的開發方式 條件式編譯指令的撰寫. 2 名稱空間 名稱空間就像是一個管理介面,可以將定義的識別 字放在名稱空間之下,而不會有相互衝突的發生 名稱空間的語法如下 把變數 var 放在名稱空間 name1 內 要存取使用名稱空 間 name1 的變數.
Toward Optimized MPEG-4 Decoder 羅仲耘 吳方荃楊士萱教授 指導. Outline 專題方向簡介 改善項目 改善方法 未來工作.
Knowledge Management System -for Agenda 顏亦笛 陳靖宜 指噵教授 : 劉寶均教授 指噵公司 : 安捷達.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 壹 企業研究導論.
Cambridge Scientific Abstracts 系列資料庫 圖 書 館
-Artificial Neural Network- Matlab操作介紹 -以類神經網路BPN Model為例
Visual C++重點複習.
資料結構實習-六.
Android 遊戲設計模組 1 Android 開發環境建構 郭育政 東吳大學資訊管理系 涂昆源 萬能科技大學資訊工程系 余執彰 萬能科技大學資訊工程系 周建興 淡江大學電機工程系 林旭陽 東吳大學資訊管理系 教育部網路通訊人才培育先導型計畫 ─ 課程發展計畫.
MS office2003 於護理應用 (V) Excel 授課教師:郝德慧 講師. Excel 基本功能 Outline 1 Excel 的巨集錄製 2 Excel 的巨集執行 3 Excel 的繪製圖表 4 Excel 的專題範例操作 5.
Microsoft Excel.
Introduction to Java Programming Lecture 16 Super and Sub Classes.
實體關係模型 (ER Model).
著作權所有 © 旗標出版股份有限公司 第 14 章 製作信封、標籤. 本章提要 製作單一信封 製作單一郵寄標籤.
Mapping - 1 Mapping From ER Model to Relational DB.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
Getting Started. XNA Game Studio 4.0 To download XNA Game Studio 4.0 itself, go to XNA Game.
ASP.NET 應用程式開發與設計 : version control: Git/SVN 講 師: Taoyu Wu ( 吳燾佑 ) 日 期: 2015/3/20 1.
XNA 4.0 基本類別 靜宜大學資工系 蔡奇偉 副教授 © 大綱 Point Structure Rectangle Structure Vector2 Structure Color Structure Matrix GraphicsDeviceManager Game Class.
XNA An Introduction. What XNA is… Microsoft® XNA™ is composed of industry- leading software, services, resources, and communities focused on enabling.
學校本位暨教師自我 專業進修研習規劃服務 教育訓練 指導單位:教育部 執行單位:全國教師在職進修資訊網 講 師:國立高雄師範大學進修學院教師生涯專業發展研究中心 曾子唐 專任研究助理 尤嬿琇 專任研究助理.
XNA Tutorial 1 For CS134 Lecture. Overview Some of the hard work has already been done for you. If you build and run your game now, the GraphicsDeviceManager.
Presentation transcript:

XNA 4.0 簡介 靜宜大學資工系 蔡奇偉 副教授 © 2011

大綱 XNA 簡介 XNA Framework XNA Build XNA Game Studio 建立 XNA 4 的專案 方案的目錄結構 XNA Game Studio 4.0 參考手冊 Hello, XNA XNA Game Loop Add a Sprite 參考資料

XNA 簡介 Provided by Microsoft A set of tools with a managed runtime environment that facilitates computer game development and management. XNA: XNA is Not an Acronymed Xbox New Architecture cross(X)-platform, Next-generation Architecture Available on Windows, Xbox 360, and Windows Phone 7

System Requirement

XNA Framework Based on.NET Compact Framework 2.0 for Xbox 360 development.NET Framework 2.0 Runs on a version of the Common Language Runtime that is optimized for gaming to provide a managed execution environment. Only supports C# programming language Integrates with a number of tools to aid in content creation Supports both 2D and 3D game creation Allows use of the Xbox 360 controllers and vibrations

XNA Build A game asset pipeline describes the process by which game content are modified to a form suitable for use by the gaming engine. XNA Build is a set of game asset pipeline management tools. Helps identify the pipeline dependencies. Provides API access to enable further processing of the dependency data. The dependency data can be analyzed to help reduce the size of a game by finding content that is not actually used.

XNA Game Studio 版本發表日期 VC# & VS 版本 XNA Game Studio Express12/ XNA Game Studio 2.012/ XNA Game Studio 3.010/ XNA Game Studio 3.106/ XNA Game Studio 4.009/ XNA Game Studio is an integrated development environment (IDE) for development of games.

XNA Indie Games Xbox 360 games written in XNA Game Studio can be submitted to the Creators Club community, for which premium membership is required, this costs US$49 for 4 months or US$99/year. All games submitted to the community are subjected to peer review by other creators. If the game passes review then it is listed on Xbox Live Marketplace. Creators can set a price of 80, 240 or 400 points for their game. The creator is paid 70% of the total revenue from their game sales as a baseline. Microsoft originally planned to take an additional percentage of revenue if they provided additional marketing for a game, but this policy was rescinded in March 2009, leaving the flat rate intact regardless of promotion.

新增專案

新增 XNA Windows Game 專案

指定專案名稱 專案名稱,也將是專案目錄、 名稱空間與執行檔的名稱

設定方案目錄之所在 方案目錄所在位置

指定方案名稱 方案名稱,亦為方案目錄 的名稱

為方案建立目錄

確定專案之建立

專案之 IDE 視窗

方案總管 程式專案內容專案

方案的目錄結構

XNA Game Studio 4.0 參考手冊

Hello, XNA // File: Program.cs using System; namespace xnatest { #if WINDOWS || XBOX static class Program { /// /// The main entry point for the application. /// static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } #endif } 定義在 Game1.cs 檔案中的類別

// File: Game1.cs using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace xnatest { /// /// This is the main type for your game /// public class Game1 : Microsoft.Xna.Framework.Game 可能用到的系統類別庫 繼承並依需求改寫後頁所述的方法

錄目此為定設 graphics Handles the configuration and management of the graphics device spriteBatch Enables a group of sprites to be drawn using the same settings.

/// /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// protected override void Initialize () { // TODO: Add your initialization logic here base.Initialize(); } Initialize ()

/// /// LoadContent will be called once per game and is the place to load /// all of your content. /// protected override void LoadContent () { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here } LoadContent ()

UnloadContent () /// /// UnloadContent will be called once per game and is the place to unload /// all content. /// protected override void UnloadContent() { // TODO: Unload any non ContentManager content here }

Update () /// /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// /// Provides a snapshot of timing values. protected override void Update (GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here base.Update(gameTime); }

Draw () /// /// This is called when the game should draw itself. /// /// Provides a snapshot of timing values. protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here base.Draw(gameTime); }

XNA Game Loop Initialize() LoadContent () Game quit? Draw () UnLoadContent () Y Update () N Exit

Add a Sprite 把 sprite 所用的圖片檔放入 Content 目錄 1. 在 Content 目錄中建立 Images 子目錄 2. 在 Images 目錄中加入圖片檔 載入 Sprite 繪製 Sprite

在 Content 目錄中建立 Images 子目錄 - I

在 Content 目錄中建立 Images 子目錄 - II

在 Images 目錄中加入圖片檔 - I

在 Images 目錄中加入圖片檔 - II

圖片的屬性頁

定義一個 Texture2D 型態的資料成員

載入圖片並存入 texture 中

繪製 sprite

程式執行結果

參考資料 Microsoft XNA Wikipedia Microsoft XNA Wikipedia Microsoft DreamSpark List of colors