Page 6 of 7

Re: C++ Progress ish

Posted: July 19th, 2017, 3:01 pm
by chili
Glad you posted this, it was something I was meaning to look at after things settled down fromthe move. Hotline looks tight. Implementing the line-of-sight stuff is impressive. What the heck are those images you posted? Look cool as fuck.

You're watching all the spoiler from the old series. Bad Ceo! Bad! XD

Good on you again for taking the initiative and coming up with your own sprite rasterization effects. If you like that shit, you're gonna live pixel shaders.

Nice job on the I6 homework as well. How did you like this style of homework challenge?

Re: C++ Progress ish

Posted: July 20th, 2017, 3:18 pm
by ceofil
To see if the tracking works properly I put this in the drawing function for enemies:
Spoiler:

Code: Select all

for (int i = 0; i < indexTrackingPoints; i++)
{
	gfx.DrawCircle(trackingPoints[i], 5.0f, Colors::Magenta);
	if (i < indexTrackingPoints - 1)
	{
		gfx.DrawLine(trackingPoints[i], trackingPoints[i+1], Colors::White);
	}
}
And if the enemies have the right amount of delay between them the tracking points spawn very nicely one after another and it forms some dna-looking stuff.

I really enjoy every homework so I don't know what to say. This time was nice that it had tests already implemented and that memory leak detection thing so you know if you fucked something up.

Re: C++ Progress ish

Posted: August 2nd, 2017, 2:14 pm
by ceofil
original game

github link

exe
Spoiler:
zigzag.rar
(8.94 MiB) Downloaded 139 times
extract this into the zigzag folder ( because of the 10MiB per attachment thing )
menuMusic.rar
(3.66 MiB) Downloaded 147 times
screenshots
Spoiler:
Image
Image

Re: C++ Progress ish

Posted: August 2nd, 2017, 4:23 pm
by albinopapa
Code looks super slick. My son loves the dancing lines game ( just like zig-zag ). Are you going to be adding more levels and music?

Re: C++ Progress ish

Posted: August 4th, 2017, 6:56 pm
by goldengamesTM
How Did You Get The Tank Rotation?

Re: C++ Progress ish

Posted: August 5th, 2017, 10:53 am
by ceofil
albinopapa wrote:Code looks super slick. My son loves the dancing lines game ( just like zig-zag ). Are you going to be adding more levels and music?
Just watched 20 minutes of Dancing Line gameplay...such a lovely game.
I think I'm gonna leave zigzag as it is for now. Maybe, in the future, I'll make it so the path fits any song automatically, so you can play with any song you want.

goldengamesTM wrote:How Did You Get The Tank Rotation?
Converting Vec2 to a float angle, doing things to that float, and converting back.
You can find the functions here at line 132 and 177.
or here
Spoiler:

Code: Select all

void Enemy::RotateToward(float wantedAngle, float dt)
{
	if (int((wantedAngle - angle) + 360) % 360 > 180)
	{
		angle -= rotationSpeed * dt;
	}
	else
	{
		angle += rotationSpeed * dt;
	}
	NormalizeAngle(angle);
	enemy.SetDir(AngleToVec2(angle));
}

Code: Select all

Vec2 Enemy::AngleToVec2(float angle)
{
	const float cos = std::cos(angle * pi / 180.0f);
	const float sin = std::sin(angle * pi / 180.0f);
	return Vec2(cos, -sin); 
}

Code: Select all

float Enemy::Vec2ToAngle(Vec2 vec)
{
	vec.Normalize();
	float angle = -asin(vec.y) * 180.0f / pi;

	if (vec.x > 0) return angle;
	else return 180.0f - angle;
}

for the tanks game is simpler because there is no AI

Code: Select all


	if (kbd.KeyIsPressed(left))
	{
		angle += rotationSpeed * dt;
		dir = AngleToVec2(angle);
	}
	else if (kbd.KeyIsPressed(right))
	{
		angle -= rotationSpeed * dt;
		dir = AngleToVec2(angle);
	}

Re: C++ Progress ish

Posted: September 1st, 2017, 6:58 pm
by ceofil
Image

Re: C++ Progress ish

Posted: September 1st, 2017, 8:38 pm
by albinopapa
Hmm, and then?

Re: C++ Progress ish

Posted: September 2nd, 2017, 8:17 am
by chili
And then the GPU melted.

Re: C++ Progress ish

Posted: September 2nd, 2017, 6:23 pm
by albinopapa
NNNNNNNNNOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!