void MyBigPush2018(Knowledge &_current_mind);

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by albinopapa » January 24th, 2018, 5:22 am

I really just want to press on, so I think I am done with it!
I can completely understand those feelings. My advice, something I wish I had figured out a while back, is don't rush things. You'll understand them when your brain is ready to understand them. I tried pushing myself to learn to use Direct3D a few years ago, and man, my brain wasn't ready for it. I would read through the documentation and follow tutorials almost every day. Each day, I'd spend about an hour and a half like that, then need a 2 hr power nap. Turns out, I needed to learn a few more things to be able to comprehend what the hell I was reading and doing. One day it just clicked and I started comprehending more and more.

When you reach a certain point in the tutorials and you don't know what is going on, you may need to stop watching for a bit and practice the concepts that were taught up until that point. Watch the video(s) that gave you trouble. If you still have troubles, ask here on the forum or google the concept being covered. Perhaps someone out there can put it in words that you might understand. That's something I've noticed, is sometimes it takes hearing it put differently to make it click.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

willkillson
Posts: 18
Joined: September 3rd, 2017, 7:38 am

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by willkillson » January 25th, 2018, 2:21 am

Is there a reason my compiler isn't complaining about passing in floats into the putpixel call?
https://www.twitch.tv/willkillson

Come help me program!

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by LuisR14 » January 25th, 2018, 3:00 am

it's not supposed to error on that, it would basically cast the value on passing it
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

willkillson
Posts: 18
Joined: September 3rd, 2017, 7:38 am

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by willkillson » January 25th, 2018, 4:10 am

Code: Select all

float GetDistance(int x1, int y1, int x2, int y2)
{
	int dx = x2 - x1;
	int dy = y2 - y1;

	int dxsquared = dx*dx;
	int dysquared = dy*dy;


	float distance = sqrt(dxsquared + dysquared);

	return distance;

}

void Graphics::DrawCircle(int originx, int originy, int radius, Color c)
{
	struct point
	{
		int x;
		int y;
	};

	int s0x = originx - radius;
	int s0y = originy - radius;
	
	point tl;//top left
	tl.x = s0x;
	tl.y = s0y;
	point bl;//bottum left
	bl.x = tl.x;
	bl.y = tl.y + 2 * radius;
	point tr;//top right
	tr.x = tl.x + 2 * radius;
	tr.y = tl.y;
	point br;//bottum right
	br.x = tr.x;
	br.y = tr.y+2* radius;

	//PutPixel(tl.x, tl.y, _c);
	//PutPixel(bl.x, bl.y, _c);
	//PutPixel(tr.x, tr.y, _c);
	//PutPixel(br.x, br.y, _c);


	for (int i = tl.x; i < br.x; i++)
	{
		for (int j = tl.y; j < br.y; j++)
		{
			if (GetDistance(originx, originy, i, j) <= radius)
			{
				PutPixel(i, j, Colors::Gray);
			}

		}
	}

	//for (int i = 0; i < 360; i++)
	//{
	//	x = cos(i);
	//	y = sin(i);

	//	PutPixel(x*r + _x, y*r + _y, _c);
	//}
}
Nailed this homework, thanks physics!
Last edited by willkillson on January 25th, 2018, 4:18 am, edited 1 time in total.
https://www.twitch.tv/willkillson

Come help me program!

willkillson
Posts: 18
Joined: September 3rd, 2017, 7:38 am

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by willkillson » January 25th, 2018, 4:12 am

LuisR14 wrote:it's not supposed to error on that, it would basically cast the value on passing it
During the tutorial videos, he is fixing all these compiler issues casting floats where need be. Either I have my visual studios set up differently, or I dunno ?
https://www.twitch.tv/willkillson

Come help me program!

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by LuisR14 » January 25th, 2018, 5:25 am

well it would only cause compiler warnings (unless your visual studio were set up to treat those warnings as errors), but fixing them would probably prevent bugs :p
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

willkillson
Posts: 18
Joined: September 3rd, 2017, 7:38 am

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by willkillson » January 25th, 2018, 9:05 pm

LuisR14 wrote:well it would only cause compiler warnings (unless your visual studio were set up to treat those warnings as errors), but fixing them would probably prevent bugs :p
Do you know where to look for messing with these settings?
https://www.twitch.tv/willkillson

Come help me program!

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by albinopapa » January 26th, 2018, 4:01 am

Project / Properties / C/C++ / General / Warning Level
Project / Properties / C/C++ / General / Treat Warnings As Errors
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

willkillson
Posts: 18
Joined: September 3rd, 2017, 7:38 am

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by willkillson » January 26th, 2018, 7:18 am

So here is Tetris 0.1

I kinda just skipped over the oo for this, since this code was written in C. I want to convert it to an oo practice, but I am not sure if I should scrap the entire project.

Image

https://github.com/willkillson/Tetris

Keys are WASD for movement, and JK for rotate left / rotate right. W doesn't work for instant drop at the moment, but I will probably work on that tomorrow.

I integrated lesson 17 into the project for introducing floating point dt, and chrono lib stuff. I would love to get the fine point delays in lockstep, and SRS for a real TGM based game.

http://tetris.wikia.com/wiki/TGM_Guide



W works now!
https://www.twitch.tv/willkillson

Come help me program!

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: void MyBigPush2018(Knowledge &_current_mind);

Post by chili » January 30th, 2018, 3:25 am

Better than OOP, add more colors!
Chili

Post Reply