<?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: Help Me Structure Some Code Better In Heat Signature	</title>
	<atom:link href="https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/</link>
	<description>We&#039;re back on a default theme because comments broke on my custom one and I don&#039;t have the energy to figure out why</description>
	<lastBuildDate>Tue, 08 Dec 2015 02:14:44 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>
		By: Thomas H		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611102</link>

		<dc:creator><![CDATA[Thomas H]]></dc:creator>
		<pubDate>Tue, 08 Dec 2015 02:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611102</guid>

					<description><![CDATA[However, the implemented solution only solves the problem if the execution order doee not change between frames.

Example:
initially OnSignal=OnState=false
# Frame 1
Listener A checks OnState: false
Something sets OnSignal = true
OnState = OnSignal = true
OnSignal = false
# Frame 2
OnState = OnSignal = false
OnSignal = false
Listener A checks OnState: false

If Game Maker does not guarantee that an order is kept you might want to think about implementing something more robust.]]></description>
			<content:encoded><![CDATA[<p>However, the implemented solution only solves the problem if the execution order doee not change between frames.</p>
<p>Example:<br />
initially OnSignal=OnState=false<br />
# Frame 1<br />
Listener A checks OnState: false<br />
Something sets OnSignal = true<br />
OnState = OnSignal = true<br />
OnSignal = false<br />
# Frame 2<br />
OnState = OnSignal = false<br />
OnSignal = false<br />
Listener A checks OnState: false</p>
<p>If Game Maker does not guarantee that an order is kept you might want to think about implementing something more robust.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: TomF		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611017</link>

		<dc:creator><![CDATA[TomF]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 18:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611017</guid>

					<description><![CDATA[Oh - what Csirke said :-)]]></description>
			<content:encoded><![CDATA[<p>Oh &#8211; what Csirke said :-)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: TomF		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611016</link>

		<dc:creator><![CDATA[TomF]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 18:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611016</guid>

					<description><![CDATA[When all you have is OOP, everything looks like an object. But it isn&#039;t. Time to go back to imperative. Let me try to explain (I hate writing English about Code, it&#039;s even harder than writing Code about English).

So you have all this functionality distributed around these &quot;objects&quot;. But they aren&#039;t actual independent entities - you&#039;re actually just doing a single action (aim a gun) and a single blob of logic. So splitting things around the objects is hurting you, and you&#039;re having to add a bunch of book-keeping - stuff that doesn&#039;t make decisions, it just tried to keep all the objects in sync.

I would move all the actual thinking logic into a single place. Doesn&#039;t matter where, but probably PlayerMovementControls(). It will do:

1. Find enemy to point at.
2. Point player at enemy.
3. Tell gun to aim itself that way.
4. Tell reticule to draw itself there.

All the other objects just do what this logic tells them. The information flows one way - from the decision-maker to the children. There&#039;s no back-and-forth or multiple chunks of state. In this case the player object makes the choice, and then the gun and reticle do what they&#039;re told. This will keep things so much simpler, modifiable and debuggable.]]></description>
			<content:encoded><![CDATA[<p>When all you have is OOP, everything looks like an object. But it isn&#8217;t. Time to go back to imperative. Let me try to explain (I hate writing English about Code, it&#8217;s even harder than writing Code about English).</p>
<p>So you have all this functionality distributed around these &#8220;objects&#8221;. But they aren&#8217;t actual independent entities &#8211; you&#8217;re actually just doing a single action (aim a gun) and a single blob of logic. So splitting things around the objects is hurting you, and you&#8217;re having to add a bunch of book-keeping &#8211; stuff that doesn&#8217;t make decisions, it just tried to keep all the objects in sync.</p>
<p>I would move all the actual thinking logic into a single place. Doesn&#8217;t matter where, but probably PlayerMovementControls(). It will do:</p>
<p>1. Find enemy to point at.<br />
2. Point player at enemy.<br />
3. Tell gun to aim itself that way.<br />
4. Tell reticule to draw itself there.</p>
<p>All the other objects just do what this logic tells them. The information flows one way &#8211; from the decision-maker to the children. There&#8217;s no back-and-forth or multiple chunks of state. In this case the player object makes the choice, and then the gun and reticle do what they&#8217;re told. This will keep things so much simpler, modifiable and debuggable.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matthew Smith		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611014</link>

		<dc:creator><![CDATA[Matthew Smith]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 12:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611014</guid>

					<description><![CDATA[In terms of how you achieve this you need amIOn and stayOn. When you turn the reticle on both amIOn and stayOn need to be true. Then at this designated point if (stayOn)
{
	stayOn = false;
} 
else 
{
	amIOn = false;
}]]></description>
			<content:encoded><![CDATA[<p>In terms of how you achieve this you need amIOn and stayOn. When you turn the reticle on both amIOn and stayOn need to be true. Then at this designated point if (stayOn)<br />
{<br />
	stayOn = false;<br />
}<br />
else<br />
{<br />
	amIOn = false;<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matthew Smith		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611012</link>

		<dc:creator><![CDATA[Matthew Smith]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 12:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611012</guid>

					<description><![CDATA[I think the problem is you want it to appear whenever but only stick around for one frame from when it appears. However you now have a problem that the time it should disappear is arbitrary.

I think the cleanest solution is to let it stick around for one frame on from a designated point. Ideally this point occurs just after when it gets turned on, but at least this solution will never fail if it happens to be some time before this point. Then both the draw and the auto aim can happen if the reticle is on, and while they may last for one frame more than is ideal, they will never last for longer than that, and they will always be on for at least one frame.]]></description>
			<content:encoded><![CDATA[<p>I think the problem is you want it to appear whenever but only stick around for one frame from when it appears. However you now have a problem that the time it should disappear is arbitrary.</p>
<p>I think the cleanest solution is to let it stick around for one frame on from a designated point. Ideally this point occurs just after when it gets turned on, but at least this solution will never fail if it happens to be some time before this point. Then both the draw and the auto aim can happen if the reticle is on, and while they may last for one frame more than is ideal, they will never last for longer than that, and they will always be on for at least one frame.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Csirke		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611011</link>

		<dc:creator><![CDATA[Csirke]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:54:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611011</guid>

					<description><![CDATA[Wow, you got a lot of responses very fast! There might be some bikeshedding going on here :)

Anyway, I think what Duncan Wintle and Frans Kasper are saying is the simple solution you can easily use. But I don&#039;t like it.

I think your problem is that you have both the &quot;Several bits of code that can each turn the reticule on&quot;, and the &quot;None of these bits of code know what order they will execute in, on a given step&quot; requirements. I&#039;m guessing this means that if several bits of code want to turn the reticule on in the same step, it will be set to the place where the last bit of code wanted it to go. So even if you solve this problem now, you might run into a problem later, where every step those code paths run in different order, and your reticule will jump around between two places. And you make it a bit hard to set up any priority between the targeting.

So I think long term what would be best would be to have one function which can decide whether to turn the reticle on and where to target it, and this function would run once each step. Of course this probably requires a larger rewrite of your code, so I understand if you don&#039;t do it. But maybe later, when you are introducing some new &quot;state&quot; into the game, you could try doing it in a way where setting the state only happens in one place, generally that makes working with it less complicated.]]></description>
			<content:encoded><![CDATA[<p>Wow, you got a lot of responses very fast! There might be some bikeshedding going on here :)</p>
<p>Anyway, I think what Duncan Wintle and Frans Kasper are saying is the simple solution you can easily use. But I don&#8217;t like it.</p>
<p>I think your problem is that you have both the &#8220;Several bits of code that can each turn the reticule on&#8221;, and the &#8220;None of these bits of code know what order they will execute in, on a given step&#8221; requirements. I&#8217;m guessing this means that if several bits of code want to turn the reticule on in the same step, it will be set to the place where the last bit of code wanted it to go. So even if you solve this problem now, you might run into a problem later, where every step those code paths run in different order, and your reticule will jump around between two places. And you make it a bit hard to set up any priority between the targeting.</p>
<p>So I think long term what would be best would be to have one function which can decide whether to turn the reticle on and where to target it, and this function would run once each step. Of course this probably requires a larger rewrite of your code, so I understand if you don&#8217;t do it. But maybe later, when you are introducing some new &#8220;state&#8221; into the game, you could try doing it in a way where setting the state only happens in one place, generally that makes working with it less complicated.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mike		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611010</link>

		<dc:creator><![CDATA[Mike]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611010</guid>

					<description><![CDATA[If you&#039;re happy with your current architecture and just want to fix the ordering problem - then perhaps you could store the frame number that the reticule was turned on, and change the code that turns it off to only do that if the current frame is greater than the stored frame.  That way it will prevent the reticule from turning itself off immediately on the same frame, and your other code will get a chance to see that it&#039;s on and update accordingly before it does turn itself off the frame after.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re happy with your current architecture and just want to fix the ordering problem &#8211; then perhaps you could store the frame number that the reticule was turned on, and change the code that turns it off to only do that if the current frame is greater than the stored frame.  That way it will prevent the reticule from turning itself off immediately on the same frame, and your other code will get a chance to see that it&#8217;s on and update accordingly before it does turn itself off the frame after.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Frans Kasper		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611009</link>

		<dc:creator><![CDATA[Frans Kasper]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611009</guid>

					<description><![CDATA[Maybe just treat the visible state as an integer, e.g. set myVisible=2 whenever you want the reticule to appear. Then, where you currently set visible=false, instead subtract 1 from myVisible and set visible=false when it hits zero. That way your visibiliry state will carry over 2 frames, technically leaving the player auto-aiming for one frame too long but that might not be a big problem.]]></description>
			<content:encoded><![CDATA[<p>Maybe just treat the visible state as an integer, e.g. set myVisible=2 whenever you want the reticule to appear. Then, where you currently set visible=false, instead subtract 1 from myVisible and set visible=false when it hits zero. That way your visibiliry state will carry over 2 frames, technically leaving the player auto-aiming for one frame too long but that might not be a big problem.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Duncan Wintle		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611007</link>

		<dc:creator><![CDATA[Duncan Wintle]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611007</guid>

					<description><![CDATA[someone compressed my white spacing :(

setVisble(value)
{
if value
{
oReticule.visible = true
oReticule.willDeactivate = false
}
else:
{
if oReticule.willDeactivate:
{
oReticule.visble = false
}
else:
{
oReticule.willDeactivate = true
}
}
}]]></description>
			<content:encoded><![CDATA[<p>someone compressed my white spacing :(</p>
<p>setVisble(value)<br />
{<br />
if value<br />
{<br />
oReticule.visible = true<br />
oReticule.willDeactivate = false<br />
}<br />
else:<br />
{<br />
if oReticule.willDeactivate:<br />
{<br />
oReticule.visble = false<br />
}<br />
else:<br />
{<br />
oReticule.willDeactivate = true<br />
}<br />
}<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nerd		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611006</link>

		<dc:creator><![CDATA[Nerd]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611006</guid>

					<description><![CDATA[Now I&#039;m not anywhere near as experienced as you are.

But could you potentially make a separate script that turns the reticle on, and while it&#039;s on, everytime you call &quot;IsReticleOn()&quot; it checks for a certain condition, in your case: &quot;Mouse no longer on enemy&quot;, before returning the value?

Kinda similar to James Vokes&#039; suggestion, actually

Or alternatively, make the reticule ALWAYS drawn, but when it&#039;s not autoaimed, make it&#039;s position off-screen, yet still in the same direction as the mouse. Pretty easy vector math, no?]]></description>
			<content:encoded><![CDATA[<p>Now I&#8217;m not anywhere near as experienced as you are.</p>
<p>But could you potentially make a separate script that turns the reticle on, and while it&#8217;s on, everytime you call &#8220;IsReticleOn()&#8221; it checks for a certain condition, in your case: &#8220;Mouse no longer on enemy&#8221;, before returning the value?</p>
<p>Kinda similar to James Vokes&#8217; suggestion, actually</p>
<p>Or alternatively, make the reticule ALWAYS drawn, but when it&#8217;s not autoaimed, make it&#8217;s position off-screen, yet still in the same direction as the mouse. Pretty easy vector math, no?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Duncan Wintle		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611005</link>

		<dc:creator><![CDATA[Duncan Wintle]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611005</guid>

					<description><![CDATA[Add a flag to your oReticule object called willDeactivate.

When oReticule.visble is set to true. set oReticule.willDeactivate to false.

When oReticule.visble would be set to true instead check oReticule.willDeactivate.
If oReticule.willDeactivate is false set oReticule.willDeactivate to true
else set oReticule.visble to false.

some sudo code:
setVisble(value)
    if value:
        oReticule.visible = true
        oReticule.willDeactivate = false
    else:
        if oReticule.willDeactivate:
            oReticule.visble = false
        else:
            oReticule.willDeactivate = true

This will make visible false after one loop in which nothing has called it but will stay visible until that happens]]></description>
			<content:encoded><![CDATA[<p>Add a flag to your oReticule object called willDeactivate.</p>
<p>When oReticule.visble is set to true. set oReticule.willDeactivate to false.</p>
<p>When oReticule.visble would be set to true instead check oReticule.willDeactivate.<br />
If oReticule.willDeactivate is false set oReticule.willDeactivate to true<br />
else set oReticule.visble to false.</p>
<p>some sudo code:<br />
setVisble(value)<br />
    if value:<br />
        oReticule.visible = true<br />
        oReticule.willDeactivate = false<br />
    else:<br />
        if oReticule.willDeactivate:<br />
            oReticule.visble = false<br />
        else:<br />
            oReticule.willDeactivate = true</p>
<p>This will make visible false after one loop in which nothing has called it but will stay visible until that happens</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dwm		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611004</link>

		<dc:creator><![CDATA[dwm]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611004</guid>

					<description><![CDATA[So, I think the problem you&#039;re running into is that you&#039;re commingling the reticule rendering and logic states.  You&#039;re using the same boolean value — oReticule.visible — to determine both whether:

 * The reticule should be shown (i.e. you&#039;ve locked onto a target)
 * The reticule needs to (re-)paint itself to the screen.

Instead, if you separated these values to something like:

 * oReticule.visible
 * oReticule.painted

… then you can use .visible as you currently are for the player aiming logic, and use .painted to keep track of whether the object needs to repaint itself.

Does that make sense, or have I misunderstood?]]></description>
			<content:encoded><![CDATA[<p>So, I think the problem you&#8217;re running into is that you&#8217;re commingling the reticule rendering and logic states.  You&#8217;re using the same boolean value — oReticule.visible — to determine both whether:</p>
<p> * The reticule should be shown (i.e. you&#8217;ve locked onto a target)<br />
 * The reticule needs to (re-)paint itself to the screen.</p>
<p>Instead, if you separated these values to something like:</p>
<p> * oReticule.visible<br />
 * oReticule.painted</p>
<p>… then you can use .visible as you currently are for the player aiming logic, and use .painted to keep track of whether the object needs to repaint itself.</p>
<p>Does that make sense, or have I misunderstood?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nounverber		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611003</link>

		<dc:creator><![CDATA[Nounverber]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611003</guid>

					<description><![CDATA[It&#039;s unlikely that I&#039;m a more experienced programmer but what I would do is probably let character always aim at the abstract target which may be on the mouse cursor but may also be somewhere else. Basically you always aim at the small reticle, whether its visible or not. No &quot;aim at the mouse cursor except when xyz&quot;.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s unlikely that I&#8217;m a more experienced programmer but what I would do is probably let character always aim at the abstract target which may be on the mouse cursor but may also be somewhere else. Basically you always aim at the small reticle, whether its visible or not. No &#8220;aim at the mouse cursor except when xyz&#8221;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jason Wroe		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611001</link>

		<dc:creator><![CDATA[Jason Wroe]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611001</guid>

					<description><![CDATA[In Unity and C# what I would use would be callbacks. In C# u could create a call back handler on your reticle object and in your other bits of code the call back functions would be called once reticle is visible. I know you use game maker maybe this will help. @jayone74 http://gmc.yoyogames.com/index.php?showtopic=589410]]></description>
			<content:encoded><![CDATA[<p>In Unity and C# what I would use would be callbacks. In C# u could create a call back handler on your reticle object and in your other bits of code the call back functions would be called once reticle is visible. I know you use game maker maybe this will help. @jayone74 <a href="http://gmc.yoyogames.com/index.php?showtopic=589410" rel="nofollow ugc">http://gmc.yoyogames.com/index.php?showtopic=589410</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tom Armitage		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-611000</link>

		<dc:creator><![CDATA[Tom Armitage]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-611000</guid>

					<description><![CDATA[Loose thoughts - but they might be more useful than specific approaches:

- it feels like separating out the visibility of the reticule object, and whether auto-aim should be engaged, might help you here. Ie: you need to work out what object the player is auto-aiming at, and separately, you need to work out whether to show the thing.

- given that, feels like you need a separate ReticuleManager unattached to a visible object. Basically: anything that can turn the reticule on sends a message to this, such as &quot;I am enemy #248 and I should be auto-aimed at&quot;. That probably gets stored on something like a list, if you want to have many reticules, or just a single field if you want one. (Or: might be worth having a list, so you can re-prioritise later, though I think priority order might just be last on first  off). Anyhow, then, when it comes to aiming, you ask the ReticuleManager &quot;which object should I point at&quot; - and separately, when it comes to rendering, you ask the reticule manager &quot;entirely separately, which object do I draw the reticule on?&quot;

And then, at the end of your loop, you need something to tidy up - ie, rather than setting reticuleVisible=false immediately, you clear up after yourself at the end of a game loop.

Is this making sense? It might not be what other people do, but what it feels like is you need something abstract to handle all the possible auto-aims and reticules, that you can message and later ask for canonical answers. That&#039;d also help separate out render and logic.]]></description>
			<content:encoded><![CDATA[<p>Loose thoughts &#8211; but they might be more useful than specific approaches:</p>
<p>&#8211; it feels like separating out the visibility of the reticule object, and whether auto-aim should be engaged, might help you here. Ie: you need to work out what object the player is auto-aiming at, and separately, you need to work out whether to show the thing.</p>
<p>&#8211; given that, feels like you need a separate ReticuleManager unattached to a visible object. Basically: anything that can turn the reticule on sends a message to this, such as &#8220;I am enemy #248 and I should be auto-aimed at&#8221;. That probably gets stored on something like a list, if you want to have many reticules, or just a single field if you want one. (Or: might be worth having a list, so you can re-prioritise later, though I think priority order might just be last on first  off). Anyhow, then, when it comes to aiming, you ask the ReticuleManager &#8220;which object should I point at&#8221; &#8211; and separately, when it comes to rendering, you ask the reticule manager &#8220;entirely separately, which object do I draw the reticule on?&#8221;</p>
<p>And then, at the end of your loop, you need something to tidy up &#8211; ie, rather than setting reticuleVisible=false immediately, you clear up after yourself at the end of a game loop.</p>
<p>Is this making sense? It might not be what other people do, but what it feels like is you need something abstract to handle all the possible auto-aims and reticules, that you can message and later ask for canonical answers. That&#8217;d also help separate out render and logic.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James Vokes		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-610999</link>

		<dc:creator><![CDATA[James Vokes]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-610999</guid>

					<description><![CDATA[As I&#039;m understanding it you&#039;re using the &lt;i&gt;oReticule.visible&lt;/i&gt; variable to decide whether &quot;auto aim&quot; is active. Why do you turn it off each step always? Why not do something like once &quot;auto aim&quot; is active a &quot;dead zone&quot; is created around the object being aimed at. While the cursor is in the dead zone the &quot;auto aiming&quot; remains active. You might have to dynamically adjust the size of the dead zone so it&#039;s not too sticky when there are multiple objects near each other.]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m understanding it you&#8217;re using the <i>oReticule.visible</i> variable to decide whether &#8220;auto aim&#8221; is active. Why do you turn it off each step always? Why not do something like once &#8220;auto aim&#8221; is active a &#8220;dead zone&#8221; is created around the object being aimed at. While the cursor is in the dead zone the &#8220;auto aiming&#8221; remains active. You might have to dynamically adjust the size of the dead zone so it&#8217;s not too sticky when there are multiple objects near each other.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Francis Joseph Serina		</title>
		<link>https://www.pentadact.com/2015-12-05-help-me-structure-some-code-better-in-heat-signature/#comment-610998</link>

		<dc:creator><![CDATA[Francis Joseph Serina]]></dc:creator>
		<pubDate>Sat, 05 Dec 2015 11:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.pentadact.com/?p=8374#comment-610998</guid>

					<description><![CDATA[What Engine are you using? If this were Unity, I&#039;d such the reticule to be a child of the gun (or aiming mechanism). Is there only 1 gun? Or can you control multiple guns like when you hijack a ship and have the turrets follow the mouse/reticule?]]></description>
			<content:encoded><![CDATA[<p>What Engine are you using? If this were Unity, I&#8217;d such the reticule to be a child of the gun (or aiming mechanism). Is there only 1 gun? Or can you control multiple guns like when you hijack a ship and have the turrets follow the mouse/reticule?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
