• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision849 (tree)
Time2011-05-11 11:03:11
Authorbiikame

Log Message

バグフィックス

Change Summary

Incremental Difference

--- trunk/Nlgp1/Nlgp1/Players/PlayerStatus.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1/Players/PlayerStatus.cs (revision 849)
@@ -77,14 +77,14 @@
7777 Player.JumpPower = 6;
7878 */
7979
80- #region プレーヤー自身に対するActionイベント
81- Player.Sprite.Shape.Stepped += ( sender , e ) => {
82- // if( Player.Attacking == AttackTypes.DivineBuster ) {
83- // Player.RunAttack( Player.Attacking ).Start();
84- // Player.Attacking = AttackTypes.None;
85- // }
86- };
87- #endregion
80+ //#region プレーヤー自身に対するActionイベント
81+ //Player.Sprite.Shape.Stepped += ( sender , e ) => {
82+ //// if( Player.Attacking == AttackTypes.DivineBuster ) {
83+ //// Player.RunAttack( Player.Attacking ).Start();
84+ //// Player.Attacking = AttackTypes.None;
85+ //// }
86+ //};
87+ //#endregion
8888
8989 /*
9090 //---------
--- trunk/Nlgp1/Nlgp1/Sprites/Sprite.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1/Sprites/Sprite.cs (revision 849)
@@ -75,6 +75,20 @@
7575 CanActDefault = true;
7676 startTick = Stage.TickCount;
7777 steppedEventArgs = new SpriteSteppedEventArgs( this.Owner );
78+ if( layerType != LayerType.Character ) {
79+ this.Body = Stage.World.CreateSpriteBody( false , position );
80+ this.Shape = this.Body.CreatePolygonSpriteShape( new SpriteShapeFilter( 0x5555 , 0xAAAA ) , new Polygon( new Vector[] {
81+ new Vector( -chipSize.X / 2.0f , -chipSize.Y / 2.0f ),
82+ new Vector( +chipSize.X / 2.0f , -chipSize.Y / 2.0f ),
83+ new Vector( +chipSize.X / 2.0f , +chipSize.Y / 2.0f ),
84+ new Vector( -chipSize.X / 2.0f , +chipSize.Y / 2.0f ),
85+ } ) );
86+ }
87+ else {
88+ this.Body = Stage.World.CreateSpriteBody( true , position );
89+ this.Shape = this.Body.CreateCircleSpriteShape( new SpriteShapeFilter( 0xAAAA , 0x5555 ) , new Circle( Vector.Zero , Math.Min( chipSize.X , chipSize.Y ) ) );
90+ }
91+ this.Body.Load();
7892 }
7993 }
8094
@@ -129,7 +143,7 @@
129143 /// <summary>
130144 /// スプライトの位置、サイズを取得または、設定します。
131145 /// </summary>
132- public IPolygonSpriteShape Shape {
146+ public ISpriteShape Shape {
133147 get;
134148 private set;
135149 }
--- trunk/Nlgp1/Nlgp1/Parameters/SpriteBody.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1/Parameters/SpriteBody.cs (revision 849)
@@ -20,6 +20,7 @@
2020 Sprite sprite;
2121 //Unloadで削除する
2222 //
23+ bool isMovable;
2324
2425
2526 float liniervelocity = 0.5f, angulervelocity = 0, friction = 0f, restitution = 0, density = 0.1f;
@@ -42,10 +43,6 @@
4243 {
4344
4445 chara = new DynamicRigid(position, 0, liniervelocity, angulervelocity);
45- chara.Massdata = new MassData
46- {
47- Mass = 1,
48- };
4946 }
5047 else
5148 {
@@ -53,6 +50,7 @@
5350 }
5451
5552
53+ this.isMovable = isMovable;
5654 }
5755
5856
@@ -60,7 +58,8 @@
6058 {
6159
6260 Polygondef2 pd = new Polygondef2(friction, restitution, density, new SpriteUserData(new PolygonSpriteShape(area,this,filter)));
63- pd.Vertices = area.Vertices.Cast<Vec2>().ToArray<Vec2>();
61+ pd.Vertices = area.ToVerticesAsVec2();
62+ pd.VertexCount = pd.Vertices.Length;
6463 chara.Addtolist(pd);
6564 return (IPolygonSpriteShape)((SpriteUserData)pd.User).SpriteShape;
6665 }
@@ -86,6 +85,10 @@
8685 public void Load()
8786 {
8887 chara.MakeBody(Stage.World);
88+ chara.Massdata = new MassData
89+ {
90+ Mass = 1,
91+ };
8992 }
9093
9194 public void Unload()
--- trunk/Nlgp1/Nlgp1/Parameters/Polygon.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1/Parameters/Polygon.cs (revision 849)
@@ -19,7 +19,7 @@
1919
2020 internal Vec2[] ToVerticesAsVec2()
2121 {
22- return this.Vertices.Cast<Vec2>().ToArray();
22+ return this.Vertices.Select(vector => (Vec2)(vector)).ToArray();
2323 }
2424
2525 public Vector[] Vertices;
--- trunk/Nlgp1/Nlgp1/Parameters/SpriteShapeContactListener.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1/Parameters/SpriteShapeContactListener.cs (revision 849)
@@ -47,8 +47,8 @@
4747 if (DoubledCheck(s1, s2)) return;
4848 shape1s.Add(s1); shape2s.Add(s2);
4949 contactPoints.Add(cp);
50- SpriteUserData nud1 = cp.Shape1.GetBody().GetUserData() as SpriteUserData;
51- SpriteUserData nud2 = cp.Shape2.GetBody().GetUserData() as SpriteUserData;
50+ SpriteUserData nud1 = cp.Shape1.UserData as SpriteUserData;
51+ SpriteUserData nud2 = cp.Shape2.UserData as SpriteUserData;
5252
5353 nud1.SpriteShape.PointRaise(cp.Shape1, cp.Position);
5454 nud2.SpriteShape.PointRaise(cp.Shape2, cp.Position);
--- trunk/Nlgp1/Nlgp1.Box2DX/Polygondef2.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1.Box2DX/Polygondef2.cs (revision 849)
@@ -54,16 +54,15 @@
5454 this.Filter = f;
5555 User.filter=f;
5656 }
57- myUserData user;
5857 public myUserData User
5958 {
6059 get
6160 {
62- return user;
61+ return (myUserData)(this.UserData);
6362 }
6463 set
6564 {
66- user = value;
65+ this.UserData = value;
6766 }
6867 }
6968 /// <summary>
--- trunk/Nlgp1/Nlgp1.Box2DX/CircleDef2.cs (revision 848)
+++ trunk/Nlgp1/Nlgp1.Box2DX/CircleDef2.cs (revision 849)
@@ -29,16 +29,15 @@
2929 Filter = u.filter;
3030 }
3131
32- myUserData user;
3332 public myUserData User
3433 {
3534 get
3635 {
37- return user;
36+ return (myUserData)(this.UserData);
3837 }
3938 set
4039 {
41- user = value;
40+ this.UserData = value;
4241 }
4342 }
4443 }
Show on old repository browser