Ejemplo n.º 1
0
gsGGJFractalis::gsGGJFractalis(gsGGJGame *game) : gsGGJEnemy(game){

	tag = gsGGJTag::Enemy;

	setupSpritesheet();

	hp = ENEMY_FRACTALIS_HEALTH;
	maxHp = hp;
	burstWaitCooldown = ENEMY_FRACTALIS_BURSTWAITCOOLDOWN;
	burstWaitTime = ENEMY_FRACTALIS_BURSTWAITTIME;
	cooldown = ENEMY_FRACTALIS_COOLDOWN;
	cooldownTime = ENEMY_FRACTALIS_COOLDOWNTIME;
	waiting = ENEMY_FRACTALIS_WAITING;
	multishot = 0;
	multishotState = 0;
	//Alterar valores do transform
	gsVector3 size = gsVector3(61, 56, 0);
	gsVector3 speed = gsVector3(gsRandom::nextInt(-50, 50), gsRandom::nextInt(30, 50), 0);
	gsColor color = gsColor::white(1.f);

	transform = gsTransform(transform.position, size, gsVector3::zero(), speed, color);

	collisionMask = 0x01;

	setUpPhase();

	solid = false;
	this->bulletType = gsGGJBulletType::Spiral;

	transform.size *= gsGGJGlobal_SizeFactor;
	transform.speed *= gsGGJGlobal_SizeFactor;

	healthBar = new gsGGJHealth(game, this);
	game->addObjetToObjectsList(healthBar);
}
void gsDebugGame_Graphics::start() {
	GS_LOG("Teste Inicializado\n");
	triangle =  gsTriangle(
		gsVector3(200, 300, 0), 
		gsVector3(600, 300, 0), 
		gsVector3(400,  50 , 0));
	frameCounter = 0;
}
void gsGGJPlayerExplosion::update() {
	time -= gsClock::getDeltaTime();

	if (time < 0) {
		game->removeObjectFromObjectsList(this);
		return;
	} else {
		gsGGJBullet *bullet;
		for (int i = 0; i < gsGGJGlobal_Cannons; i++)
		{
			bullet = new gsGGJBullet(true, gsGGJBulletType::Spread, &transform, game, phase);
			bullet->transform.position = transform.position + transform.size / 2;
			bullet->transform.position += gsVector3(gsRandom::nextDouble() - 0.5f, gsRandom::nextDouble() - 0.5f, 0) * 16;
			bullet->transform.speed = gsVector3(gsRandom::nextDouble() - 0.5f, gsRandom::nextDouble() - 0.5f, 0) * 1200;
			game->addObjetToObjectsList(bullet);
		}
	}
}
Ejemplo n.º 4
0
 gsVector3 lerp(const gsVector3& vec1,const gsVector3& vec2, float t)
 {
	 return gsVector3(gkMathUtils::interp(gkVector3(vec1),gkVector3(vec2),t));
 }