Tutorial 5 Beginner : Why isn't my code acting like Chili's?

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Circumnavigate
Posts: 5
Joined: October 27th, 2019, 12:04 am
Location: Irvine, California

Tutorial 5 Beginner : Why isn't my code acting like Chili's?

Post by Circumnavigate » November 19th, 2019, 6:42 pm

Hey does anyone know why my code isn't acting like Chili's code? The reticle wont change shape when it goes over the strip.

https://youtu.be/UREKHWvg9ko?t=710

About 11:50 into the video.

Thank you.
Attachments
Chili Framework 2016.zip
11;50 in tut 5 vid
(84.86 KiB) Downloaded 135 times

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

Re: Tutorial 5 Beginner : Why isn't my code acting like Chili's?

Post by albinopapa » November 19th, 2019, 7:43 pm

Code: Select all

	if (x > 200)
	{
		if (x < 300)
		{
			shapeIsChanged = true;
		}
	}
...
	shapeIsChanged = wnd.kbd.KeyIsPressed(VK_SHIFT);
You have 2 conditions that change the behavior of the shape with the latter taking precedence over the former. The ( shapeIsChanged = wnd.kbd.KeyIsPressed(VK_SHIFT); ) line isn't in the original video, or at least not at 11:50.

If you comment out the shapeIsChanged = wnd.kbd.KeyIsPressed(VK_SHIFT); then the reticle does change shape at the expected coordinates.
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

User avatar
Circumnavigate
Posts: 5
Joined: October 27th, 2019, 12:04 am
Location: Irvine, California

Re: Tutorial 5 Beginner : Why isn't my code acting like Chili's?

Post by Circumnavigate » November 19th, 2019, 8:01 pm

Thanks.

Post Reply