示例#1
0
文件: main.cpp 项目: noelq/EpiHistory
int	main()
{
  std::string	C1 = "Sevan";
  std::string	C2 = "Thor";
  std::string	C3 = "Patator";

  Character	Sevan(C1, 100);
  Warrior	Thor(C2, 100, C3);

  std::cout <<  Thor.getPower() << std::endl;
}
Fighter::Fighter(int x, int y, int c_player_id, int c_id, FighterName f_name, FighterType f_type) 
	: Movement(this), Damage(this) {
	//setup the moves from the inputted fighter
	texture = new Texture();
	switch (f_name) {
		case CAPTAIN_FALCON:
			moves = CaptainFalcon();
			moves.name = CAPTAIN_FALCON;
			texture->create_texture(universe->assets->fighter_sheets[0]->s);
			width = 64; height = 64;
			offset_y = 2;
			break;
		case THOR:
			moves = Thor();
			moves.name = THOR;
			texture->create_texture(universe->assets->fighter_sheets[1]->s);
			width = 75; height = 75;
			offset_x = -16; offset_y = -16;
			break;
	}

	player_id = c_player_id;
	id = c_id;

	pos.x = x; pos.y = y;
	name = f_name; type = f_type;
	respawning = false;
	invincible = false;
	enable_camera_view = true;

	animator = new Animator(texture, &src_rect, 64, 64, 5, true, true);
	update_move(moves.JUMP, 10, false);
	alpha_colour = 0;

	r = 1; g = 1; b = 1;
	if (id == 1) {
		r = 0; g = .5f; b = 1;
	}else if (id == 2) {
		r = 1; g = .5f; b = 0;
	}else if (id == 3) {
		r = 0; g = 1; b = .5f;
	}
	texture->set_colour(r, g, b, 1);

	blood_particles = universe->particles->create_particle_chunk(
		new ParticleEmitter(pos.x + 80, pos.y + 64, 10, 1, 4, false), BLOOD);
	blood_particles->max_particles = 0;
}