Esempio n. 1
0
File: turn.c Progetto: ButKamZ/MBLed
//Sending the TURN message to the network.
void turn_send(int8_t rotation){
  uint8_t data;
  xQueueSend(turnQueue, ( void * )&rotation, 0); // put the rotation into the queue
  data = (uint8_t) rotation;
  send_new_packet(TURN, &data, EVERYBODY); // tell to the neighbors that the block turned 
  addDirection(( 4 - rotation));
}
Esempio n. 2
0
void FireProjectile::update(float timeElapsed)
{
	// bullet tracer effect
	m_Duration -= timeElapsed;

	addDirection(m_Dx * timeElapsed, m_Dy * timeElapsed);

	m_CollisionBox.x = getPosition().x;
	m_CollisionBox.y = getPosition().y;

	if (m_Duration <= 0)
	{
		m_Destroy = true;
	}

	m_Light.setSize(glm::vec2(m_Size.x, m_Light.getSize().y));
	m_Light.setLightPosition(getX(), getY(), m_Size.x / 2);
	m_Light.setPosition(getCenterX() - m_Light.getSize().x / 2, getCenterY() - m_Light.getSize().y / 2);
}