Пример #1
0
/**
 * move()
 * Apply speed to the direction faced.
 *
 * @return Returns false if wall collision, otherwise true.
 */
bool Entity::move() {

	move_from_offending_tile();

	if (stats.effects.speed == 0) return false;

	float speed = stats.speed * speedMultiplyer[stats.direction] * stats.effects.speed / 100;
	float dx = speed * directionDeltaX[stats.direction];
	float dy = speed * directionDeltaY[stats.direction];

	bool full_move = mapr->collider.move(stats.pos.x, stats.pos.y, dx, dy, stats.movement_type, stats.hero);

	return full_move;
}
Пример #2
0
/**
 * move()
 * Apply speed to the direction faced.
 *
 * @return Returns false if wall collision, otherwise true.
 */
bool Entity::move() {

	move_from_offending_tile();

	if (stats.effects.knockback_speed != 0)
		return false;

	if (stats.effects.stun || stats.effects.speed == 0) return false;

	if (stats.charge_speed != 0.0f)
		return false;

	float speed = stats.speed * speedMultiplyer[stats.direction] * stats.effects.speed / 100;
	float dx = speed * static_cast<float>(directionDeltaX[stats.direction]);
	float dy = speed * static_cast<float>(directionDeltaY[stats.direction]);

	bool full_move = mapr->collider.move(stats.pos.x, stats.pos.y, dx, dy, stats.movement_type, mapr->collider.getCollideType(stats.hero));

	return full_move;
}