在Windows 8上使用XNA开发游戏一:自己的游戏引擎
2012-07-29 13:36
543 查看
cocos2d-x for xna其实稍微改改就能变成一个基于monogame的xna游戏引擎。
这个引擎的名字叫minigame,周五周六两天弄得,所以。。。只是晒晒。
ClickAndMoveTest,纪念一下和春哥,洋洋的基情。
在Game1.cs中添加代码
public class Game1 : Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public Game1() : base() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.IsMouseVisible = true; //这些 MGDirector.SharedDirector().Graphics = this.graphics; MGDirector.SharedDirector().Content = base.Content; MGDirector.SharedDirector().Landscape = true; MGDirector.SharedDirector().DisplayFPS = false; } protected override void Initialize() { base.Initialize(); } public void CompleteLoading() { MGSpriteFrameCache.SharedSpriteFrameCache().AddSpriteFramesWithFile("Content/sunwukong.plist","Images/sunwukong"); MGDirector.SharedDirector().RunWithScene(new TestingScene()); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); //这些 MGDirector.SharedDirector().Initialize(); CompleteLoading(); } protected override void UnloadContent() { } protected override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); //这些 MGDirector.SharedDirector().Update((float)gameTime.ElapsedGameTime.TotalSeconds); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); //这些 MGDirector.SharedDirector().Draw(); base.Draw(gameTime); } }
想试用的朋友下载源代码(网速太慢稍后补上),参考cocos2d-x 废弃了CCApplication精简,MiniGame。
QQ讨论群
142922153(没人)
190784175
相关文章推荐
- 和微软合作的garagegames公司推出基于XNA的游戏引擎TorqueX,支持快速开发(近期引擎免费提供使用)
- SpriteKit游戏开发点滴[6]使用物理引擎(上)
- 【Android游戏开发二十一】Android os设备谎言分辨率的解决方案!以及简单阐述游戏引擎如何使用!
- [入门教程]使用Cocos2d-html5游戏引擎编写一个简单的游戏 第一回合: 搭建开发环境
- libgdx游戏引擎开发笔记(五)粒子编辑器的使用
- 使用C#作为Cocos2dx引擎脚本语言进行游戏开发——脚本运行时基础(二)
- Android游戏引擎libgdx使用教程16:使用TexturePacker工具加快开发速度
- 【Cocos2d-x游戏引擎开发笔记(22)】TexturePacker的使用
- 使用WINDOWS的GDI开发游戏(2)
- 使用WINDOWS的GDI开发游戏(3)
- 自己动手写游戏引擎一(Windows窗口框架)
- 使用WINDOWS的GDI开发游戏(开篇)
- 【Cocos2d-x游戏引擎开发笔记(22)】TexturePacker的使用
- XNA Game Studio是一套有着强大功能和简单界面的游戏制作平台,游戏开发商和游戏玩家都可以使用这套工具开发针对Windows XP以及Xbox360的游戏,XNA Game Studio分为两种版本,一种是面向初学者的EXPRESS版本,还有一种是面向专业用户的专业版。用户使用EXPRESS版本开发游戏完全免费,并且可以随意在PC上发行,不过用该工具开发的游戏若是在360上网络发行,就需要交纳99美元的年费。
- Windows Store apps开发[16]编写和使用自己的Windows Runtime组件
- XNA 如何使用字体绘制文字,Windows Phone 游戏开发
- XNA Game Studio是一套有着强大功能和简单界面的游戏制作平台,游戏开发商和游戏玩家都可以使用这套工具开发针对Windows XP以及Xbox360的游戏,XNA Game Studio分为两种版本,一种是面向初学者的EXPRESS版本,还有一种
- XNA游戏开发之(三)——使用IsRunningSlowly
- 使用WINDOWS的GDI开发游戏(4)
- 使用Microsoft XNA Framework开发一个模拟水果机的游戏