<?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: Building a Simple Android 2D Scrolling Shooter</title>
	<atom:link href="https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/feed/" rel="self" type="application/rss+xml" />
	<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/</link>
	<description>Game Coding for Beginners</description>
	<lastBuildDate>Mon, 20 Apr 2026 12:04:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>By: Rhy</title>
		<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/#comment-17408</link>
		<dc:creator><![CDATA[Rhy]]></dc:creator>
		<pubDate>Fri, 10 Jun 2022 00:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=14063#comment-17408</guid>
		<description><![CDATA[Hello I tried to create custom buttons and 

   if (right.contains(x, y)) {
                        player.setMovementState(player.RIGHT);

}
No longer worked for me so I had to change it to this.Also hope this helps with creating your own game buttons

public class Gui{

ArrayList inputbuttons = new ArrayList();
  Rect btnup,btndown,btnleft,btnright,shoot;
  
  Gui(int x,int y){
        
 
    
    //my custom buttons
    
    btnleft = new Rect(0,y-50,50,y-100);
    btnright = new Rect(100,y-50,150,y-100);
    btnup = new Rect(50,y-100,100,y-150);
    btndown = new Rect(50,y-1,100,y-50);
    
    inputbuttons.add(shoot);
    inputbuttons.add(btnleft);
    inputbuttons.add(btnright);
    inputbuttons.add(btnup);
    inputbuttons.add(btndown);
    
    
  }
  

public void onTouchEvent(MotionEvent event){
int tx = (int)event.getX(0);
int ty = (int)event.getY(0);

switch(event.getAction() &amp; MotionEvent.ACTION_MASK){

 case MotionEvent.ACTION_DOWN:
 //this part works with any of my custom buttons 
                    if(tx=btnright.left &amp;&amp; ty&gt;=btnright.bottom &amp; ty&lt;=btnright.top){     
                    //what button does                                                         
                        player.setmoving(player.right);                                               
                        }
                                                
                        if(tx=btnleft.left &amp;&amp; ty&gt;=btnleft.bottom &amp; ty&lt;=btnleft.top){
                                                 //what button does             
                        player.setmoving(player.left);                                               
                        }
                        
                        if(tx=btnup.left &amp;&amp; ty&gt;=btnup.bottom &amp; ty&lt;=btnup.top){
                        //what button does
                                                              
                        player.setmoving(player.up);                                               
                        }
                   
                    if(tx=btndown.left &amp;&amp; ty&gt;=btndown.bottom &amp; ty&lt;=btndown.top){
                                      //whay button does                        
                        player.setmoving(player.down);                                               
                        }
                    
  break;
  case MotionEvent.ACTION_UP:
  player.setmoving(player.stopped);
  break;
}

}}}]]></description>
		<content:encoded><![CDATA[<p>Hello I tried to create custom buttons and </p>
<p>   if (right.contains(x, y)) {<br />
                        player.setMovementState(player.RIGHT);</p>
<p>}<br />
No longer worked for me so I had to change it to this.Also hope this helps with creating your own game buttons</p>
<p>public class Gui{</p>
<p>ArrayList inputbuttons = new ArrayList();<br />
  Rect btnup,btndown,btnleft,btnright,shoot;</p>
<p>  Gui(int x,int y){</p>
<p>    //my custom buttons</p>
<p>    btnleft = new Rect(0,y-50,50,y-100);<br />
    btnright = new Rect(100,y-50,150,y-100);<br />
    btnup = new Rect(50,y-100,100,y-150);<br />
    btndown = new Rect(50,y-1,100,y-50);</p>
<p>    inputbuttons.add(shoot);<br />
    inputbuttons.add(btnleft);<br />
    inputbuttons.add(btnright);<br />
    inputbuttons.add(btnup);<br />
    inputbuttons.add(btndown);</p>
<p>  }</p>
<p>public void onTouchEvent(MotionEvent event){<br />
int tx = (int)event.getX(0);<br />
int ty = (int)event.getY(0);</p>
<p>switch(event.getAction() &amp; MotionEvent.ACTION_MASK){</p>
<p> case MotionEvent.ACTION_DOWN:<br />
 //this part works with any of my custom buttons<br />
                    if(tx=btnright.left &amp;&amp; ty&gt;=btnright.bottom &amp; ty&lt;=btnright.top){<br />
                    //what button does<br />
                        player.setmoving(player.right);<br />
                        }</p>
<p>                        if(tx=btnleft.left &amp;&amp; ty&gt;=btnleft.bottom &amp; ty&lt;=btnleft.top){<br />
                                                 //what button does<br />
                        player.setmoving(player.left);<br />
                        }</p>
<p>                        if(tx=btnup.left &amp;&amp; ty&gt;=btnup.bottom &amp; ty&lt;=btnup.top){<br />
                        //what button does</p>
<p>                        player.setmoving(player.up);<br />
                        }</p>
<p>                    if(tx=btndown.left &amp;&amp; ty&gt;=btndown.bottom &amp; ty&lt;=btndown.top){<br />
                                      //whay button does<br />
                        player.setmoving(player.down);<br />
                        }</p>
<p>  break;<br />
  case MotionEvent.ACTION_UP:<br />
  player.setmoving(player.stopped);<br />
  break;<br />
}</p>
<p>}}}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/#comment-4974</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Mon, 06 Mar 2017 11:38:47 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=14063#comment-4974</guid>
		<description><![CDATA[Hi Istiaque,

Sorry to take so long to reply. Things are busy at the moment. I am going to have to defer this to another time. I have added as the next thing to write an update with more detail to this article along the lines of your request.]]></description>
		<content:encoded><![CDATA[<p>Hi Istiaque,</p>
<p>Sorry to take so long to reply. Things are busy at the moment. I am going to have to defer this to another time. I have added as the next thing to write an update with more detail to this article along the lines of your request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Istiaque Ahmed</title>
		<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/#comment-4764</link>
		<dc:creator><![CDATA[Istiaque Ahmed]]></dc:creator>
		<pubDate>Mon, 27 Feb 2017 10:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=14063#comment-4764</guid>
		<description><![CDATA[Thanks for the reply. The ‘clipObjects&#039; method uses only game world co-ordinates and not the screen ones - very useful info. But the method  still puts me in the same darkness as it did  before.  Let me put the very first &#039;if&#039; condition of the method here again :

 if (objectX – objectWidth &lt; currentViewportWorldCentre.x + (metresToShowX / 2)) { …. }

From the picture, it just became 

if(  (300-10) &lt;(50+92/2) )

Can you just tell - 

 Q1)  what the left and right hand expressions want to mean individually ?

Q2) How they can produce the logic as to whether the object is far enough from the game center (50,50) i.e the Ship to be clipped off or not , be it along x axis or y ?]]></description>
		<content:encoded><![CDATA[<p>Thanks for the reply. The ‘clipObjects&#8217; method uses only game world co-ordinates and not the screen ones &#8211; very useful info. But the method  still puts me in the same darkness as it did  before.  Let me put the very first &#8216;if&#8217; condition of the method here again :</p>
<p> if (objectX – objectWidth &lt; currentViewportWorldCentre.x + (metresToShowX / 2)) { …. }</p>
<p>From the picture, it just became </p>
<p>if(  (300-10) &lt;(50+92/2) )</p>
<p>Can you just tell &#8211; </p>
<p> Q1)  what the left and right hand expressions want to mean individually ?</p>
<p>Q2) How they can produce the logic as to whether the object is far enough from the game center (50,50) i.e the Ship to be clipped off or not , be it along x axis or y ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/#comment-4760</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Mon, 27 Feb 2017 08:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=14063#comment-4760</guid>
		<description><![CDATA[It&#039;s a long time since I wrote this code but I have just had a look at it to familiarize myself and try to help.

Q) &quot;I think this co-ordinate i.e. (50,50) is with respect to the actual screen co-ordinate and not any imaginary game world. Qa) Am I right ?&quot;

A) This is relative to the &lt;strong&gt;world&lt;/strong&gt; coordinates of the ship. The center of the ship. It is used to rotate a, b and c around in order to rotate the ship and to move the ship in &lt;strong&gt;world&lt;/strong&gt; space. The The &lt;code&gt;ship&lt;/code&gt; class(and the other game objects) doesn&#039;t deal with pixels. All movement and collisions etc are done with world coordinates. The &lt;code&gt;ViewPort&lt;/code&gt; class uses the screen resolution and how many world units we want to display in order to translate world locations to pixel positions appropriate for the screen. When objects are outside of the visible area of the world that is currently being shown they are clipped.

Q) &quot;&lt;code&gt;vp.setWorldCentre(player.getCentre().x, player.getCentre().y);&lt;/code&gt;&quot;
&quot;So the world center is now (50,50)&quot;

A) Yes.

Q) ... what could it really mean? Pulling off my hair…

A) The values sent into the &lt;code&gt;ViewPort&lt;/code&gt; methods are always &lt;strong&gt;world&lt;/strong&gt; coordinates. &lt;code&gt;WorldToScreen&lt;/code&gt; translates them to pixel positions and &lt;code&gt;ClipObjects&lt;/code&gt; decides whether an object is far enough away from the center of the world (the ship) to be safely ignored. To be clear, &lt;code&gt;ClipObjects&lt;/code&gt; works in world coordinates, no translation is necessary for it to do its job.

I hope this helps. The &lt;code&gt;ViewPort&lt;/code&gt; class was initially going to be a black box class when the book was planned. The book went way over the page count and I guess could have done with more detailed explanations. When I write the second edition, hopefully, next year I will put a lot of focus into this part. The reason that it was going to be a black box is because once you move on to game engines/LibGDX/OpenGLES(the next project in the book) etc, the &lt;code&gt;ViewPort&lt;/code&gt; class is defunct as game engines/LibGDX/OpenGLES etc handle the whole world/pixel conundrum for us.

All the best,

John]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s a long time since I wrote this code but I have just had a look at it to familiarize myself and try to help.</p>
<p>Q) &#8220;I think this co-ordinate i.e. (50,50) is with respect to the actual screen co-ordinate and not any imaginary game world. Qa) Am I right ?&#8221;</p>
<p>A) This is relative to the <strong>world</strong> coordinates of the ship. The center of the ship. It is used to rotate a, b and c around in order to rotate the ship and to move the ship in <strong>world</strong> space. The The 
			<span id="crayon-69e843b52b962812225988" 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">ship</span></span></span> class(and the other game objects) doesn&#8217;t deal with pixels. All movement and collisions etc are done with world coordinates. The 
			<span id="crayon-69e843b52b968065474486" 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">ViewPort</span></span></span> class uses the screen resolution and how many world units we want to display in order to translate world locations to pixel positions appropriate for the screen. When objects are outside of the visible area of the world that is currently being shown they are clipped.</p>
<p>Q) &#8220;
			<span id="crayon-69e843b52b96c791491280" 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">vp</span><span class="crayon-sy">.</span><span class="crayon-e">setWorldCentre</span><span class="crayon-sy">(</span><span class="crayon-v">player</span><span class="crayon-sy">.</span><span class="crayon-e">getCentre</span><span class="crayon-sy">(</span><span class="crayon-sy">)</span><span class="crayon-sy">.</span><span class="crayon-v">x</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-v">player</span><span class="crayon-sy">.</span><span class="crayon-e">getCentre</span><span class="crayon-sy">(</span><span class="crayon-sy">)</span><span class="crayon-sy">.</span><span class="crayon-v">y</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></span></span>&#8221;<br />
&#8220;So the world center is now (50,50)&#8221;</p>
<p>A) Yes.</p>
<p>Q) &#8230; what could it really mean? Pulling off my hair…</p>
<p>A) The values sent into the 
			<span id="crayon-69e843b52b96e192709348" 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">ViewPort</span></span></span> methods are always <strong>world</strong> coordinates. 
			<span id="crayon-69e843b52b971708134777" 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">WorldToScreen</span></span></span> translates them to pixel positions and 
			<span id="crayon-69e843b52b973409244728" 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">ClipObjects</span></span></span> decides whether an object is far enough away from the center of the world (the ship) to be safely ignored. To be clear, 
			<span id="crayon-69e843b52b975500809097" 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">ClipObjects</span></span></span> works in world coordinates, no translation is necessary for it to do its job.</p>
<p>I hope this helps. The 
			<span id="crayon-69e843b52b978414882396" 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">ViewPort</span></span></span> class was initially going to be a black box class when the book was planned. The book went way over the page count and I guess could have done with more detailed explanations. When I write the second edition, hopefully, next year I will put a lot of focus into this part. The reason that it was going to be a black box is because once you move on to game engines/LibGDX/OpenGLES(the next project in the book) etc, the 
			<span id="crayon-69e843b52b97a979125940" 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">ViewPort</span></span></span> class is defunct as game engines/LibGDX/OpenGLES etc handle the whole world/pixel conundrum for us.</p>
<p>All the best,</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Istiaque Ahmed</title>
		<link>https://gamecodeschool.com/android/building-a-simple-android-2d-scrolling-shooter/#comment-4710</link>
		<dc:creator><![CDATA[Istiaque Ahmed]]></dc:creator>
		<pubDate>Thu, 23 Feb 2017 11:11:04 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=14063#comment-4710</guid>
		<description><![CDATA[As to Q4, here is a &lt;a href=&quot;http://imgur.com/a/QuJR2&quot; rel=&quot;nofollow&quot;&gt;picture&lt;/a&gt; made by me to describe the situation below. This editor has no image attaching option though !

The ViewPort constructor has :

 
Viewport(int screenXResolution, int screenYResolution){
 
    screenCentreX = screenXResolution / 2;
    screenCentreY = screenYResolution / 2;
 
    pixelsPerMetreX = screenXResolution / 90;
    pixelsPerMetreY = screenYResolution / 55;
 
    metresToShowX = 92;
    metresToShowY = 57;
 
    .......
    ......
 
   }

Let me say, the smartphone device has a width of 500px and a height of 400px for instance. So screenXResolution = 500 and screenYResolution=400. And its origin i.e. co-ordinate (0,0) is at the top left corner. 

Now,
screenCentreX  =500/2 = 250 and  screenCentreY = 400/2 = 200. This is C2 in the picture.

pixelsPerMetreX =500/90 =5.56   and  pixelsPerMetreY = 400/55 =  7.23.




The &#039;Ship&#039; i.e. player constructor has :

public Ship(){
........
........

 float length = 2.5f;
 float width = 1.25f;

 centre = new PointF();
       centre.x = 50;
        centre.y = 50;
.........
........
}

I think this co-ordinate i.e.  (50,50) is with respect to the actual screen co-ordinate and not any imaginary game world. Qa) Am I right ?

Now we want to make the Ship as the game center.

So  the player object we want to make the center of the world has the co-ordinate (50,50) which is C1 in the picture . 

&#039;prepareLevel()&#039; method has :

vp.setWorldCentre(player.getCentre().x, player.getCentre().y);

So the world center is now (50,50)


the &#039;clipObjects(float objectX, float objectY,  float objectWidth, float objectHeight) &#039; method has as its first &#039;if&#039; condition :

&quot;    if (objectX - objectWidth &lt; currentViewportWorldCentre.x + (metresToShowX / 2)) {  .... }&quot;

We want to test another object  (not the &#039;Ship&#039; player one) against the &#039;ClipObjects&#039; method :

The test object has :
objectX to  be 300 ,objectY to be 260 which is point D in the picture and objectWidth to be 10. These are also real screen co-ordinates and not  the imaginary game world ones, Qb) Am I right ?

And here ,the currentViewportWorldCentre.x  is 50 and metresToShowX is 92.

So the &#039;if&#039; condition becomes :
(300-10) &lt;(50+92/2)


what could it really mean ? Pulling off my hair...

Instead of plotting the co-ordinates in a picture, i think a verbal explanation regarding the &#039;if&#039; condition would be more helpful or perhaps I am not even getting closer to  the way of understanding the scenario .

The tutorial did not intend to explain it leaving it on the readers instead.  Qc)Actually what does the first &#039;if&#039; condition want to test ?

Help is what we need.
Regards]]></description>
		<content:encoded><![CDATA[<p>As to Q4, here is a <a href="http://imgur.com/a/QuJR2" rel="nofollow">picture</a> made by me to describe the situation below. This editor has no image attaching option though !</p>
<p>The ViewPort constructor has :</p>
<p>Viewport(int screenXResolution, int screenYResolution){</p>
<p>    screenCentreX = screenXResolution / 2;<br />
    screenCentreY = screenYResolution / 2;</p>
<p>    pixelsPerMetreX = screenXResolution / 90;<br />
    pixelsPerMetreY = screenYResolution / 55;</p>
<p>    metresToShowX = 92;<br />
    metresToShowY = 57;</p>
<p>    &#8230;&#8230;.<br />
    &#8230;&#8230;</p>
<p>   }</p>
<p>Let me say, the smartphone device has a width of 500px and a height of 400px for instance. So screenXResolution = 500 and screenYResolution=400. And its origin i.e. co-ordinate (0,0) is at the top left corner. </p>
<p>Now,<br />
screenCentreX  =500/2 = 250 and  screenCentreY = 400/2 = 200. This is C2 in the picture.</p>
<p>pixelsPerMetreX =500/90 =5.56   and  pixelsPerMetreY = 400/55 =  7.23.</p>
<p>The &#8216;Ship&#8217; i.e. player constructor has :</p>
<p>public Ship(){<br />
&#8230;&#8230;..<br />
&#8230;&#8230;..</p>
<p> float length = 2.5f;<br />
 float width = 1.25f;</p>
<p> centre = new PointF();<br />
       centre.x = 50;<br />
        centre.y = 50;<br />
&#8230;&#8230;&#8230;<br />
&#8230;&#8230;..<br />
}</p>
<p>I think this co-ordinate i.e.  (50,50) is with respect to the actual screen co-ordinate and not any imaginary game world. Qa) Am I right ?</p>
<p>Now we want to make the Ship as the game center.</p>
<p>So  the player object we want to make the center of the world has the co-ordinate (50,50) which is C1 in the picture . </p>
<p>&#8216;prepareLevel()&#8217; method has :</p>
<p>vp.setWorldCentre(player.getCentre().x, player.getCentre().y);</p>
<p>So the world center is now (50,50)</p>
<p>the &#8216;clipObjects(float objectX, float objectY,  float objectWidth, float objectHeight) &#8216; method has as its first &#8216;if&#8217; condition :</p>
<p>&#8221;    if (objectX &#8211; objectWidth &lt; currentViewportWorldCentre.x + (metresToShowX / 2)) {  &#8230;. }&quot;</p>
<p>We want to test another object  (not the &#039;Ship&#039; player one) against the &#039;ClipObjects&#039; method :</p>
<p>The test object has :<br />
objectX to  be 300 ,objectY to be 260 which is point D in the picture and objectWidth to be 10. These are also real screen co-ordinates and not  the imaginary game world ones, Qb) Am I right ?</p>
<p>And here ,the currentViewportWorldCentre.x  is 50 and metresToShowX is 92.</p>
<p>So the &#039;if&#039; condition becomes :<br />
(300-10) &lt;(50+92/2)</p>
<p>what could it really mean ? Pulling off my hair&#8230;</p>
<p>Instead of plotting the co-ordinates in a picture, i think a verbal explanation regarding the &#039;if&#039; condition would be more helpful or perhaps I am not even getting closer to  the way of understanding the scenario .</p>
<p>The tutorial did not intend to explain it leaving it on the readers instead.  Qc)Actually what does the first &#039;if&#039; condition want to test ?</p>
<p>Help is what we need.<br />
Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
