<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Conditions and branching demo: Bouncing shapes</title>
	<atom:link href="https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/feed/" rel="self" type="application/rss+xml" />
	<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/</link>
	<description>Game Coding for Beginners</description>
	<lastBuildDate>Fri, 06 Jun 2025 18:08:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/#comment-6912</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Fri, 08 Sep 2017 12:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=12650#comment-6912</guid>
		<description><![CDATA[Thanks for your comment. Yes, it is really satisfying to solve a problem. The longer it takes the bigger the high when you succeed.

Good luck with your programming,

John]]></description>
		<content:encoded><![CDATA[<p>Thanks for your comment. Yes, it is really satisfying to solve a problem. The longer it takes the bigger the high when you succeed.</p>
<p>Good luck with your programming,</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lunartiglio</title>
		<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/#comment-6888</link>
		<dc:creator><![CDATA[Lunartiglio]]></dc:creator>
		<pubDate>Wed, 06 Sep 2017 15:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=12650#comment-6888</guid>
		<description><![CDATA[Thak you a lot John, i&#039;m on my day one C++ learning and i&#039;m loving your tutorials. One thing which bothered me a lot while the balls where bouncing around was that they went outside of the window while going down and right (well X+ and Y+) so after a bit of head scratching, a couple more variables and some adjustments i was able to fix it and they now stay inside every side of window and i&#039;m very proud of myself all thanks to your tutorials!
Cheers from Italy!]]></description>
		<content:encoded><![CDATA[<p>Thak you a lot John, i&#8217;m on my day one C++ learning and i&#8217;m loving your tutorials. One thing which bothered me a lot while the balls where bouncing around was that they went outside of the window while going down and right (well X+ and Y+) so after a bit of head scratching, a couple more variables and some adjustments i was able to fix it and they now stay inside every side of window and i&#8217;m very proud of myself all thanks to your tutorials!<br />
Cheers from Italy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/#comment-3699</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Fri, 30 Dec 2016 13:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=12650#comment-3699</guid>
		<description><![CDATA[There are two possible things going on. Firstly, the resolution the window is set to at the start of the code might be different to your monitor. Also, all SFML shapes and other graphical objects as well have an &lt;strong&gt;origin&lt;/strong&gt;. This is the point at which the shape is drawn. The shapes are obviously bigger than one pixel so the position of the origin has an effect. The default origin is the top left pixel which is why they bounce nicely on the top and left but dissappear on the bottom and right. SFML provides a way to choose the origin so you can give each shape the origin that you prefer.

You could try writing something like this just after you declare &lt;code&gt;tri&lt;/code&gt;.
&lt;code&gt;tri.setOrigin(50, 50);&lt;/code&gt;

I hope this helps a bit.]]></description>
		<content:encoded><![CDATA[<p>There are two possible things going on. Firstly, the resolution the window is set to at the start of the code might be different to your monitor. Also, all SFML shapes and other graphical objects as well have an <strong>origin</strong>. This is the point at which the shape is drawn. The shapes are obviously bigger than one pixel so the position of the origin has an effect. The default origin is the top left pixel which is why they bounce nicely on the top and left but dissappear on the bottom and right. SFML provides a way to choose the origin so you can give each shape the origin that you prefer.</p>
<p>You could try writing something like this just after you declare 
			<span id="crayon-69e35e68b44c2798263087" class="crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-droid-sans-mono" style="font-size: 12px !important; line-height: 16px !important;font-size: 12px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 16px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><span class="crayon-v">tri</span></span></span>.<br />

			<span id="crayon-69e35e68b44c9304410878" class="crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-droid-sans-mono" style="font-size: 12px !important; line-height: 16px !important;font-size: 12px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 16px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><span class="crayon-v">tri</span><span class="crayon-sy">.</span><span class="crayon-e">setOrigin</span><span class="crayon-sy">(</span><span class="crayon-cn">50</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-cn">50</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></span></span></p>
<p>I hope this helps a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Świniomiś</title>
		<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/#comment-3688</link>
		<dc:creator><![CDATA[Świniomiś]]></dc:creator>
		<pubDate>Thu, 29 Dec 2016 22:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=12650#comment-3688</guid>
		<description><![CDATA[Hi John - Thanks for excellent website. I really appreciate and enjoy it. These are my first steps with C++.

I did this project and it works well - but one thing is not clear for me. Both shapes, while bouncing the top and left wall- they bounce once they just touch the wall, while when going towards right and bottom wall - they go beyond it (i.e. hide) and reverse the direction only when the last pixel disappears.
I work on OSX and Xcode. I corss checked it by copying your code and this is exactly the same so no typing error on my end.

Do you have any idea why is that?

Cheers,

Swnms]]></description>
		<content:encoded><![CDATA[<p>Hi John &#8211; Thanks for excellent website. I really appreciate and enjoy it. These are my first steps with C++.</p>
<p>I did this project and it works well &#8211; but one thing is not clear for me. Both shapes, while bouncing the top and left wall- they bounce once they just touch the wall, while when going towards right and bottom wall &#8211; they go beyond it (i.e. hide) and reverse the direction only when the last pixel disappears.<br />
I work on OSX and Xcode. I corss checked it by copying your code and this is exactly the same so no typing error on my end.</p>
<p>Do you have any idea why is that?</p>
<p>Cheers,</p>
<p>Swnms</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/sfml/conditions-and-branching-demo-bouncing-shapes/#comment-2106</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Fri, 17 Jun 2016 08:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=12650#comment-2106</guid>
		<description><![CDATA[Hi Zoltan, What is the error. I will try and help.]]></description>
		<content:encoded><![CDATA[<p>Hi Zoltan, What is the error. I will try and help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
