【Xbox360】 XNA Game Studio その5 【C#】
■ このスレッドは過去ログ倉庫に格納されています
0001名前は開発中のものです。
2008/03/25(火) 13:57:55ID:DksURoh7【Xbox360】 XNA Game Studio その4 【C#】
http://pc11.2ch.net/test/read.cgi/gamedev/1198312422/
XNA Developer Center http://msdn.microsoft.com/directx/XNA/
XNA Game Studio Express http://msdn.microsoft.com/directx/xna/gse/
XNAをはじめよう! http://xna-studio.jp/
■ゲ製wiki
プログラミングガイドなど、基礎技術情報が豊富
http://www23.atwiki.jp/news4xna/
■ゲハwiki
フリーのライブラリ情報などが豊富
http://www16.atwiki.jp/xna360
■マインスイーパ
C#をすでに習得している人向け
http://www.microsoft.com/japan/msdn/vstudio/express/learn/xna/default.aspx
0761名前は開発中のものです。
2008/05/04(日) 03:59:02ID:XCFWlSr+using System;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;public class G : Game{static void Main()
{using (Game g = new G()) g.Run();}GraphicsDeviceManager M;VertexDeclaration D;
BasicEffect E;VertexPositionColor[] P;int t = 0;int s = 0 ;int c = 0;int i;
float W ;float w ;KeyboardState k, K;Keys[] Y = new Keys []{Keys.Up,Keys.Left,
Keys.Down,Keys.Right} ;Random r = new Random();private int[] m = new int[22];
public G(){M = new GraphicsDeviceManager(this);P = new VertexPositionColor[] {
new VertexPositionColor(new Vector3(0.0F, 0.05F, 0.0F), Color.Tan),new
VertexPositionColor(new Vector3(0.02F, -0.05F, 0.0F), Color.Tan),new
VertexPositionColor(new Vector3(-0.02F, -0.05F, 0.0F), Color.Tan),new
VertexPositionColor(new Vector3(0.0F, 0.05F, 0.0F), Color.Tan),new
VertexPositionColor(new Vector3(0.05F, -0.0F, 0.0F), Color.Tan),new
VertexPositionColor(new Vector3(-0.05F,-0.0F, 0.0F), Color.Tan),};}protected
override void LoadContent(){D = new VertexDeclaration(M.GraphicsDevice,
VertexPositionColor.VertexElements);E = new BasicEffect(M.GraphicsDevice, null)
;E.VertexColorEnabled = true;M.GraphicsDevice.VertexDeclaration = D;
0762名前は開発中のものです。
2008/05/04(日) 03:59:48ID:XCFWlSr+E.Dispose();base.UnloadContent();}GamePadState prevState;protected override
void Update(GameTime T){K = k;k = Keyboard.GetState();switch (s){case 0:if
(k.IsKeyDown(Keys.Space) && K.IsKeyUp(Keys.Space)){t = 0;c = 0;W = 60;w = 60;s
= 1;}break;case 1:if ( c > 0 )if (k.IsKeyDown(Y[m[0]]) && K.IsKeyUp(Y[m[0]])){
for (i = 0; i < c - 1; i++) m[i] = m[i + 1];c--;t++;}w--;if (w < 0){if
(c >= 20){c = 0;s = 0;}else{for(i = 0 ; i <3;i++){ m[c] = r.Next(4); c++; }w
+= W;W *= 0.98f;}}break;}base.Update(T);}protected override void Draw(GameTime
T){Window.Title = t.ToString() + "点";M.GraphicsDevice.Clear(Color.Black);
E.Begin();foreach (EffectPass p in E.CurrentTechnique.Passes){p.Begin();{for
(i = 0; i < c; i++){E.World = Matrix.CreateRotationZ(MathHelper.ToRadians(90 *
m[i]))* Matrix.CreateTranslation(-0.95f + i * 0.1f, 0.0f, 0.5f);
E.CommitChanges();M.GraphicsDevice.DrawUserPrimitives(
PrimitiveType.TriangleList, P, 0, 2);}}p.End();}E.End();base.Draw(T);}}
■ このスレッドは過去ログ倉庫に格納されています