<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Question about al_clear_to_color</title>
		<link>http://www.allegro.cc/forums/view/617801</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 07 Apr 2019 17:15:20 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am trying to write a game based on battleship. The plan is to draw one grid, get user input to place the ships, make a network connection then draw the second grid. I need to clear part of the screen between each step and during gameplay. Is it possible to use al_clear_to_color to erase only a specific part of the screen?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob Keane)</author>
		<pubDate>Thu, 04 Apr 2019 03:42:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s possible, but it&#39;s a lot easier to just use <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_filled_rectangle"><span class="a">al_draw_filled_rectangle</span></a></span>. Stepping a bit back, it&#39;s likely better all around to re-draw everything each frame, and only draw what you need.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 04 Apr 2019 11:09:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I considered redrawing each frame, but am having problems conceptualizing it. My biggest worry is the program will keep prompting the players to input the coordinates for the ships and pegs each loop. Is it possible to save the screen, write the updates then flip the updated screen to the display?</p><p>edit: I believe I am looking ahead of myself. I should be looking at routines to get the input first, but if there is a way to save the display and printing it when updated, I would appreciate knowing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob Keane)</author>
		<pubDate>Thu, 04 Apr 2019 16:53:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can use a bitmap buffer you can redraw the screen every time or you can use dirty rectangles.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 04 Apr 2019 21:10:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for the advise. I think I&#39;ll worry about getting a keyboard routine working before I do the redrawing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob Keane)</author>
		<pubDate>Fri, 05 Apr 2019 17:05:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Consider this: A 3D game has to draw everything every single frame, and the computer doesn’t struggle at all doing it. It’s the job it was built for. </p><p>What I am seen here actually is that you might be having a logical problem with the internal states of your game.</p><p>Focus on your game logic first, and then look into graphics. Be aware that you need a Game Loop, which is different than a normal, sequential text-mode loop. Use events, single step iterations, flags, or whatever you need to know the game state. Draw in between updates.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rodolfo Lam)</author>
		<pubDate>Sun, 07 Apr 2019 05:15:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://">Rodolfo Lam</a> said:</div><div class="quote"><p>Focus on your game logic first, and then look into graphics. Be aware that you need a Game Loop, which is different than a normal, sequential text-mode loop. Use events, single step iterations, flags, or whatever you need to know the game state. Draw in between updates.</p></div></div><p>

I think that is the issue. Thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob Keane)</author>
		<pubDate>Sun, 07 Apr 2019 17:15:20 +0000</pubDate>
	</item>
</rss>
