<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gbdev.gg8.se/wiki/index.php?action=history&amp;feed=atom&amp;title=GBDK_set_sprite_prop</id>
		<title>GBDK set sprite prop - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gbdev.gg8.se/wiki/index.php?action=history&amp;feed=atom&amp;title=GBDK_set_sprite_prop"/>
		<link rel="alternate" type="text/html" href="https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;action=history"/>
		<updated>2026-04-16T04:28:54Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=666&amp;oldid=prev</id>
		<title>Caseyweederman: fixed another tag</title>
		<link rel="alternate" type="text/html" href="https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=666&amp;oldid=prev"/>
				<updated>2016-06-19T08:59:43Z</updated>
		
		<summary type="html">&lt;p&gt;fixed another tag&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:59, 19 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TL;DR: ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TL;DR: ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The property argument is a byte and can be combined using bitwise operators to pass several properties at once: &amp;lt;code&amp;gt;property1 | property2 | ... | propertyn&amp;lt;/code&amp;gt; to send multiple properties, &amp;lt;code&amp;gt;existingProperties | property&amp;lt;code&amp;gt; to leave everything the same but turn property on, &amp;lt;code&amp;gt;existingProperties &amp;amp; ~property&amp;lt;/code&amp;gt; to leave everything the same but turn property off.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The property argument is a byte and can be combined using bitwise operators &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(ways to combine binary sets) &lt;/ins&gt;to pass several properties at once: &amp;lt;code&amp;gt;property1 | property2 | ... | propertyn&amp;lt;/code&amp;gt; to send multiple properties, &amp;lt;code&amp;gt;existingProperties | property&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;code&amp;gt; to leave everything the same but turn property on, &amp;lt;code&amp;gt;existingProperties &amp;amp; ~property&amp;lt;/code&amp;gt; to leave everything the same but turn property off.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definitions ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definitions ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Caseyweederman</name></author>	</entry>

	<entry>
		<id>https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=665&amp;oldid=prev</id>
		<title>Caseyweederman: fix an unclosed tag</title>
		<link rel="alternate" type="text/html" href="https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=665&amp;oldid=prev"/>
				<updated>2016-06-19T08:56:43Z</updated>
		
		<summary type="html">&lt;p&gt;fix an unclosed tag&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:56, 19 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TL;DR: ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TL;DR: ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The property argument is a byte and can be combined using bitwise operators to pass several properties at once: &amp;lt;code&amp;gt;property1 | property2 | ... | propertyn&amp;lt;/code&amp;gt; to send multiple properties, &amp;lt;code&amp;gt;existingProperties | property&amp;lt;code&amp;gt; to leave everything the same but turn property on, &amp;lt;code&amp;gt;existingProperties &amp;amp; ~property&amp;lt;code&amp;gt; to leave everything the same but turn property off.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The property argument is a byte and can be combined using bitwise operators to pass several properties at once: &amp;lt;code&amp;gt;property1 | property2 | ... | propertyn&amp;lt;/code&amp;gt; to send multiple properties, &amp;lt;code&amp;gt;existingProperties | property&amp;lt;code&amp;gt; to leave everything the same but turn property on, &amp;lt;code&amp;gt;existingProperties &amp;amp; ~property&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;code&amp;gt; to leave everything the same but turn property off.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definitions ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definitions ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Caseyweederman</name></author>	</entry>

	<entry>
		<id>https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=662&amp;oldid=prev</id>
		<title>Caseyweederman: Initial page for setting binary sprite properties</title>
		<link rel="alternate" type="text/html" href="https://gbdev.gg8.se/wiki/index.php?title=GBDK_set_sprite_prop&amp;diff=662&amp;oldid=prev"/>
				<updated>2016-06-19T08:50:20Z</updated>
		
		<summary type="html">&lt;p&gt;Initial page for setting binary sprite properties&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
This tutorial seeks to describe, with examples, how to make precise changes to a sprite's state, without requiring any previous knowledge of binary or bitwise operators.&lt;br /&gt;
The &amp;lt;code&amp;gt;set_sprite_prop&amp;lt;/code&amp;gt; function, found in [[gb.h]], sets properties of a sprite.&lt;br /&gt;
&lt;br /&gt;
== TL;DR: ==&lt;br /&gt;
The property argument is a byte and can be combined using bitwise operators to pass several properties at once: &amp;lt;code&amp;gt;property1 | property2 | ... | propertyn&amp;lt;/code&amp;gt; to send multiple properties, &amp;lt;code&amp;gt;existingProperties | property&amp;lt;code&amp;gt; to leave everything the same but turn property on, &amp;lt;code&amp;gt;existingProperties &amp;amp; ~property&amp;lt;code&amp;gt; to leave everything the same but turn property off.&lt;br /&gt;
&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&amp;lt;code&amp;gt;gb.h&amp;lt;/code&amp;gt; includes some property definitions:&lt;br /&gt;
* #define S_PALETTE    0x10U&lt;br /&gt;
* #define S_FLIPX      0x20U&lt;br /&gt;
* #define S_FLIPY      0x40U&lt;br /&gt;
* #define S_PRIORITY   0x80U&lt;br /&gt;
&lt;br /&gt;
The problem with setting these is that any will obliterate any other properties. &lt;br /&gt;
&lt;br /&gt;
== Sprite property flags ==&lt;br /&gt;
The flags are stored in binary like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Bit&lt;br /&gt;
|0 &lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|Feature&lt;br /&gt;
|Relative to background&lt;br /&gt;
|Flip Y&lt;br /&gt;
|Flip X&lt;br /&gt;
|DMG palette&lt;br /&gt;
|GBC Tile bank&lt;br /&gt;
|Color&lt;br /&gt;
|Color&lt;br /&gt;
|Color&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|In front&lt;br /&gt;
|Don't flip&lt;br /&gt;
|Don't flip&lt;br /&gt;
|Monochrome palette 0&lt;br /&gt;
|Bank 0&lt;br /&gt;
|0+&lt;br /&gt;
|0+&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Behind&lt;br /&gt;
|Flip vertically&lt;br /&gt;
|Flip horizontally&lt;br /&gt;
|Monochrome palette 1&lt;br /&gt;
|Bank 1&lt;br /&gt;
|1+&lt;br /&gt;
|1+&lt;br /&gt;
|1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== set_sprite_prop ==&lt;br /&gt;
Using the defined shorthand, you can call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_sprite_prop(spriteNumber, S_FLIPY);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which sets the properties to &amp;lt;code&amp;gt;01000000&amp;lt;/code&amp;gt; (40 in hexadecimal, 64 in decimal), and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_sprite_prop(spriteNumber, S_FLIPX);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which sets the properties to &amp;lt;code&amp;gt;00100000&amp;lt;/code&amp;gt; (20 in hexadecimal, 32 in decimal)&lt;br /&gt;
&lt;br /&gt;
but if you do both, the entire set is overwritten with the latest set, so the bit that is flipped gets flipped back.&lt;br /&gt;
&lt;br /&gt;
== Bitwise operators ==&lt;br /&gt;
So how do you do both? With bitwise operators! We're specifically interested in &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; (and), &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; (or), and &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; complement. &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; adds two bit sets together but only carries over 1s that existed in both previous sets (1100 &amp;amp; 1011 is 1000). &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; carries over any 1s that existed in either (1000 | 1011 is 1011). &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; gives the complement of a single set, effectively flipping each bit to its opposite, regardless of its position (~1011 is 0100).&lt;br /&gt;
&lt;br /&gt;
So how do we put this into practice?&lt;br /&gt;
&lt;br /&gt;
== OR ==&lt;br /&gt;
Well, we know that &amp;lt;code&amp;gt;S_FLIPY&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;01000000&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;S_FLIPX&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;00100000&amp;lt;/code&amp;gt;. To turn both on in one move, you'd use OR: &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, and get &amp;lt;code&amp;gt;01100000&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_sprite_prop(spriteNumber, S_FLIPY | S_FLIPX);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== get_sprite_prop ===&lt;br /&gt;
That's great! But it ignores the existing states of the other bits, for example a color palette, or priority relative to the background. Perhaps you want to flip the sprite on its axes independently of each other. For that, you can feed &amp;lt;code&amp;gt;get_sprite_prop&amp;lt;/code&amp;gt; directly into &amp;lt;code&amp;gt;set_sprite_prop&amp;lt;/code&amp;gt; (or set it to a variable and feed that in) and use the &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; operator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_sprite_prop(spriteNumber, get_sprite_prop(spriteNumber) | newProp);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A real example: &amp;lt;code&amp;gt;set_sprite_prop(0, get_sprite_prop(0) | S_FLIPX);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== AND and NOT ==&lt;br /&gt;
Now how do you switch a bit off? Here's where the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; operators come into play. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt;, we know that only 1s found in both sets get carried over. Any set &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; a set full of 1s will result in that set. Any 0 in either set will result in a 0 in the resulting set. So we need to &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; combine the existing property set with a set full of 1s and a 0 in the position of the bit we want to switch off. We can get the latter with the complement operator &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; and any single or collective setting we want turned off.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
The existing state of properties on a sprite is &amp;lt;code&amp;gt;00100011&amp;lt;/code&amp;gt; (see [[#get_sprite_prop]])(flipped horizontally, set to color palette 3), and we want to revert the mirrored effect. So:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;00100011&amp;lt;/code&amp;gt; &amp;amp; ~&amp;lt;code&amp;gt;00100000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaking this down completely, let's apply the NOT first and flip the latter set:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;11011111&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let's combine them using AND:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;001000'''11'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;110111'''11'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
making:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;00000011&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've successfully retained all previous bit states except for the one we switched off.&lt;br /&gt;
&lt;br /&gt;
Here's a real-world example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_sprite_prop(0, get_sprite_prop(0) &amp;amp; ~S_FLIPX);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Takeaway ==&lt;br /&gt;
Hopefully you can now apply any changes to a sprite's properties without a lot of hassle or trial and error.&lt;/div&gt;</summary>
		<author><name>Caseyweederman</name></author>	</entry>

	</feed>