Beispiel #1
0
void Actor::Reset()
{
  m_PreviousTime = 0.0f;
  m_Position = m_StartPosition;
  m_NextPosition = m_Position;
  m_Direction = DIRECTION_NORTH;
  m_AnimationStage = 1;
  m_CurrentSpritesArray = &m_Sprites;
  SetCurrentSprite();
}
Beispiel #2
0
Actor::Actor(Game& game, const sf::Vector2i& startPosition, int spritesIndex)
  : m_Game(game)
  , m_CurrentSpritesArray(&m_Sprites)
  , m_StartPosition(startPosition)
  , m_Position(m_StartPosition)
  , m_NextPosition(m_Position)
  , m_Direction(DIRECTION_NORTH)
  , m_AnimationStage(1)
{
  SpriteFactory::Get().CreateActorSprites(spritesIndex, m_Sprites);
  SetCurrentSprite();
}
Beispiel #3
0
void SharedStateData::Clear()
{
	SetCurrentTile( 0 );
	SetCurrentSprite( 0 );

	delete widget;
	widget = new EdWidget( engine->Tree(), widgetNode, 0 );

	delete canvasResource;
	canvasResource = 0;

	defFileName = "";
	surfaceFileName = "";
}
Beispiel #4
0
void Actor::Update(float elapsedTime)
{
  float deltaTime = elapsedTime - m_PreviousTime;

  if (deltaTime < GetMoveTimeInterval())
  {
    UpdateAnimation(deltaTime);
  }
  else
  {
    m_PreviousTime = elapsedTime;
    UpdatePosition(elapsedTime);
    SetCurrentSprite();
  }
}
void GameSprite::SetCurrentAnimation( string currentAnimation )
{
	currentAnimation_ = currentAnimation;
	changeAnimationTime_ = 0.0f;
	SetCurrentSprite( 0 );
}