• R/O
  • SSH
  • HTTPS

nlgp1: Commit


Commit MetaInfo

Revision720 (tree)
Zeit2011-02-17 13:42:05
Autorbiikame

Log Message

Nlgp1.Sprites.Sprite.Moveを追加

Ändern Zusammenfassung

Diff

--- trunk/Nlgp1/Nlgp1/Stages/GameMap.cs (revision 719)
+++ trunk/Nlgp1/Nlgp1/Stages/GameMap.cs (revision 720)
@@ -80,7 +80,7 @@
8080 // キャラクタアクション
8181 foreach( Sprite sprite in Sprite.GetSpriteCollection() ) {
8282 if( StageView.IsVisibleSprite( sprite.X , sprite.Y , sprite.ActionCellCount ) ) {
83- sprite.Update();
83+ sprite.Act();
8484 }
8585 }
8686 GameMap.world.Step( 1 , 8 , 1 );
--- trunk/Nlgp1/Nlgp1/Sprites/Sprite.cs (revision 719)
+++ trunk/Nlgp1/Nlgp1/Sprites/Sprite.cs (revision 720)
@@ -2,6 +2,7 @@
22 using System.Collections.Generic;
33 using System.ComponentModel;
44 using System.Linq;
5+using Box2DX.Common;
56 using Nlgp1.Attacks;
67 using Nlgp1.Common;
78 using Nlgp1.Common.Drawing;
@@ -606,7 +607,7 @@
606607 if( this.IsBlockSprite( hitPos ) || hitSprite != null ) {
607608 if( isRecovery ) {
608609 if( hitSprite != null ){
609- float toX = hitSprite.Bounds.Left - ( Math.Abs( X - PrevX ) );
610+ float toX = hitSprite.Bounds.Left - ( System.Math.Abs( X - PrevX ) );
610611 float toY = Y;
611612 if( hitSprite.TryMove( toX , toY ) == DirectionFlags.None ){
612613 hitSprite.ResetPrev();
@@ -629,7 +630,7 @@
629630 hitPos.Y = ( Bounds.Bottom - i );
630631 if( this.IsBlockSprite( hitPos ) || hitSprite != null ) {
631632 if( isRecovery ) {
632- if( hitSprite != null && hitSprite.TryMove( hitSprite.Bounds.Left + ( Math.Abs( X - PrevX ) ) , hitSprite.Y ) == DirectionFlags.None ) {
633+ if( hitSprite != null && hitSprite.TryMove( hitSprite.Bounds.Left + ( System.Math.Abs( X - PrevX ) ) , hitSprite.Y ) == DirectionFlags.None ) {
633634 hitSprite.ResetPrev();
634635 } else {
635636 X = ( hitPos.X ) - Bounds.Width;
@@ -699,52 +700,10 @@
699700 if( --jumpBoost < 0 )
700701 Speed.Y = 0;
701702
702- SpriteAction.Verlet( this , friction , IsBoosting ? Speed.MaxBoostX : Speed.MaxX , IsBoosting ? Speed.MaxBoostY : Speed.MaxY );
703+ this.Move( new Vec2( IsBoosting ? Speed.MaxBoostX : Speed.MaxX , IsBoosting ? Speed.MaxBoostY : Speed.MaxY ) );
703704 }
704705 #endregion
705706
706- IsNowJumping = true;
707-
708- #region 障害物判定
709- verticalPos.X = 0;
710- verticalPos.Y = 0;
711- horizontalPos.X = 0;
712- horizontalPos.Y = 0;
713- DirectionFlags hitDirV = DirectionFlags.None;
714- DirectionFlags hitDirH = DirectionFlags.None;
715-
716- if( MovingDirection == ( MovingDirection | DirectionFlags.Top ) ) {
717- // 上方向に速度がある
718- if( MoveTest( DirectionType.Top , ref verticalPos , CanActDefault , 1 , false ) )
719- hitDirV = DirectionFlags.Top;
720- } else if( MovingDirection == ( MovingDirection | DirectionFlags.Bottom ) ) {
721- // 下方向に速度がある
722- if( MoveTest( DirectionType.Bottom , ref verticalPos , CanActDefault , 1 , false ) ) {
723- hitDirV = DirectionFlags.Bottom;
724- jumpBoost = JumpPower;
725- IsNowJumping = false;
726- }
727- }
728- if( MovingDirection == ( MovingDirection | DirectionFlags.Left ) ) {
729- // 左方向に速度がある
730- if( MoveTest( DirectionType.Left , ref horizontalPos , CanActDefault , 1 , false ) )
731- hitDirH = DirectionFlags.Left;
732- } else if( MovingDirection == ( MovingDirection | DirectionFlags.Right ) ) {
733- // 右方向に速度がある
734- if( MoveTest( DirectionType.Right , ref horizontalPos , CanActDefault , 1 , false ) )
735- hitDirH = DirectionFlags.Right;
736- }
737-
738- if( hitDirH != DirectionFlags.None && hitDirV != DirectionFlags.None )
739- HitBlockDirection = hitDirH | hitDirV;
740- else if( hitDirH == DirectionFlags.None )
741- HitBlockDirection = hitDirV;
742- else if( hitDirV == DirectionFlags.None )
743- HitBlockDirection = hitDirH;
744- else
745- HitBlockDirection = DirectionFlags.None;
746- #endregion
747-
748707 if( Acted != null )
749708 Acted( this , actedEventParameter );
750709 }
--- trunk/Nlgp1/Nlgp1/Sprites/Sprite.Detail.cs (revision 719)
+++ trunk/Nlgp1/Nlgp1/Sprites/Sprite.Detail.cs (revision 720)
@@ -1,4 +1,5 @@
11 using System;
2+using Box2DX.Common;
23 using Nlgp1.Stages;
34
45 namespace Nlgp1.Sprites {
@@ -8,7 +9,7 @@
89 public void Initialize() {
910 }
1011
11- public void Update() {
12+ public void Move( Vec2 force ) {
1213 }
1314 }
1415 }
Show on old repository browser