<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-1229841548985910616</id><updated>2009-11-09T13:06:17.282-05:00</updated><title type='text'>How To Program Video Games Of Your Own</title><subtitle type='html'>Our blog features daily entries about concepts that will help you program video games of your very own! Our tutorials target aspiring developers whose skills range from absolute beginner to advanced. You may freely copy and distribute these entries to your web site or anywhere else as you wish as long as you credit me for the article. Be sure to check back daily for updates and new tips and tricks.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-4942378703085932445</id><published>2007-04-12T03:03:00.000-05:00</published><updated>2007-04-13T16:36:21.342-05:00</updated><title type='text'>How To Use Loops</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Sometimes it’s necessary to have line(s) of code execute over and over until a  certain condition is met. In the initialization (“setting up”) of your enemies  or tiles, it’s often  needed to cycle through a loop to set everything up. It's also important to loop through a series of objects like enemies to check their data or perform actions to them.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The two important types of loops in programming are the &lt;/span&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;while&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; loop, and the  perhaps somewhat more complicated &lt;/span&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;for&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; loop. The while loop is simply the key  word “while”, followed by a condition in parentheses, then a group of actions  all contained in brackets. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Like so: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;while(Sleeping){ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Play_Soft_Music(); //Gotta have that soft  music. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;However, there is a better type of loop that can be used in place of this: the for loop. Here’s how one works: think of it as a function; you type the  keyword ‘for’, then in parentheses, you initialize your  counting variable, then a semi-colon, then the condition that must be met for the loop to run through each  time, then another semi-colon, and finally, the increment statement. Here’s an  example:   &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;for (itemsPlaced=0; itemsPlaced &lt; totalItems; itemsPlaced++){&lt;br /&gt;//Place items throughout the level.&lt;br /&gt;} &lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This code counts the number of itemsPlaced, starting at 0 when we begin. The code continues as long as the number of items placed is less than the number of total items. Each time we go through the loop, we increase the value of itemsPlaced. Although the use of for loops still may not be immediately apparent to you now,  you’ll see in time how useful they can be, ESPECIALLY in conjunction with arrays  and setting up each value within the array like so: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;for (x=0; x&lt;5; x++){&lt;br /&gt;MyArray [x] = x*5; //Assign the xth element of the  array to x*5&lt;br /&gt;//This produces 0, 5, 10, 15, 20, etc.&lt;br /&gt;}&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;total;&gt;&lt;/total;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-4942378703085932445?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/4942378703085932445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=4942378703085932445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/4942378703085932445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/4942378703085932445'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/how-to-use-loops.html' title='How To Use Loops'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-1711940265908713007</id><published>2007-04-08T15:46:00.000-05:00</published><updated>2007-04-08T15:58:05.157-05:00</updated><title type='text'>More Shortcuts</title><content type='html'>Switch statements are simply a much easier and shorter way of writing multiple if  statements. If you have a series of if statements testing to see if multiple values have been met, usually the code becomes cluttered, long, and less manageable. Multiple if statements of this sort would look like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;if (x==5){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;    //…&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;if (x==6){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;     //…&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;if (x==7){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;     //…&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In situations such as this, it would be advantageous to use a switch statement. A switch  statement is activated with the use of the keyword 'switch' and is contained within a block of braces, just like an if statement. The difference is that instead of having to constantly re-write if statements and have clutters of braces, you need only to write out the word "case" before the value that you're testing for. A switch statement is written like this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;//Switch Statement &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;switch (x) { &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;case 1: //Actions ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;break; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;case 2: //Actions ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;break; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;default: trace(“Try something else.”); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt; } &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;//Versus the same functionality, using if/else statements:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;if (x==1){ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;    //Actions &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;} // break&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;if (x==2){ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;   //Actions &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;} // break&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt; else{ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;    trace(“Try something else.”); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;} // break&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; It is absolutely vital to include the “break” statements within your switch statement. Otherwise,  Flash won’t know when one case ends and another begins, and if one case  (condition) is met, then it will not only execute that code, but all of the other code  below it, until it encounters a “break;” line. This is often referred to as having a leak, as the code execution "leaks" downward until a break statement is met.&lt;br /&gt;&lt;br /&gt;This technique should help to save you substantial writing time, as well as make your code far more readable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-1711940265908713007?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/1711940265908713007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=1711940265908713007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/1711940265908713007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/1711940265908713007'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/more-shortcuts.html' title='More Shortcuts'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-4656252679843911127</id><published>2007-04-06T15:25:00.000-05:00</published><updated>2007-04-06T15:44:01.083-05:00</updated><title type='text'>How To Write Out Much Shorter And Easier If / Else Statements</title><content type='html'>&lt;span style="font-family: verdana;"&gt;&lt;/span&gt;&lt;span style="font-family: verdana;"&gt;Sometimes you might wish to have an easy alternative to the tedious task of writing (often repetitive) if and  else statements. If and else statements can eventually crowd your code with excessive lines. With this shortcut, you can express entire if and else blocks, and even be able to assign a variable a value based on whether  a condition is true or not; all in one line. The solution is the called the ternary or conditional operator. It' called the "ternary" operator because it performs operations of 3 operands (an operand is simply data that's effected by an operator). The syntax for this particular operator is as follows:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;//Variable = ( (condition) ? true actions: false actions)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(153, 153, 153);"&gt;  Speed = (guy._x &gt; 500 ? 0: 5);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Observe the example using the assignment of the “Speed” variable. That one  line means all of this: “If guy._x&gt;500 evaluates to TRUE, assign Speed  to 0. Else, assign it to 5.”&lt;br /&gt;&lt;br /&gt;If this syntax may confuse you a great deal at first, don't fret. Many programmers have difficulty with this particular operator as its syntax is hard to understand to the untrained eye.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-4656252679843911127?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/4656252679843911127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=4656252679843911127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/4656252679843911127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/4656252679843911127'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/how-to-write-out-much-shorter-and.html' title='How To Write Out Much Shorter And Easier If / Else Statements'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-7125662940276913629</id><published>2007-04-05T03:11:00.000-05:00</published><updated>2007-04-05T03:20:22.327-05:00</updated><title type='text'>Conditional Testing: The Most Important Concept Of Interactivity</title><content type='html'>&lt;span style="font-family:verdana;"&gt;This is an absolutely fundamental concept to understand. Without knowing how to test if certain conditions have been met, you have no way of allowing users to interact with your Flash movie. The most important concept in conditional testing is the all-mighty if statement.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;If Statements&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;If statements are very important in programming games. Without them, you  absolutely cannot have a game. An if statement allows your game to branch off  into different sets of actions, depending on if certain conditions are met. The syntax for an if statement is as follows: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;if (condition==true) { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;//Take These Actions &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;So try it out. Let’s say you want an error message printed if your character  moves off the visible screen. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;//If the character’s x position is greater than the stage’s  width, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;if (_root.character._x&gt;Stage.width)  { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;//Trace an error message. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;trace(“Character is off the stage!”); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;}&lt;/span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Now we can use if statements to determine if a condition is true, and act  accordingly based on the evaluation of that condition. This is when your logical  operators like the comparison operator (==), greater than (&gt;),  less than (&lt;), logical AND (&amp;&amp;amp;), logical (OR),  and logical NOT or FALSE  (!=, !) really come into use.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Else Statements &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;An ‘else’ statement is simply the statement that is executed if no if  statements in a particular set of if statements evaluate as true. For  example, if you’re checking to see whether or not the user entered your parents’  names into a text box, you might use an else statement to print messages based  on what they entered: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;if (Name==“John” || Name==“Susan”){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;trace(“Hey,  you’re named after one of my parents!”); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;else{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;trace(“You’re not named after one of my  parents….”);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);font-family:courier new;" &gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Remember what the symbol ( || ) means? That’s logical OR. If either  “John” OR “Susan” is entered, the message is traced “Hey, you’re named after one  of my parents!”. Otherwise, if any other name is entered, a message will say  that you’re not named after one of them. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;While these examples may not seem useful, they can help you to establish a strong foundation with understanding how to test for conditions. If and else statements will eventually become second nature to you, and you'll see many of them throughout the games that you create.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-7125662940276913629?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/7125662940276913629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=7125662940276913629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/7125662940276913629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/7125662940276913629'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/conditional-testing-most-important.html' title='Conditional Testing: The Most Important Concept Of Interactivity'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-9034455271719259026</id><published>2007-04-03T21:07:00.000-05:00</published><updated>2007-04-03T21:23:15.386-05:00</updated><title type='text'>How to Keep Your Code More Organized With Comments</title><content type='html'>&lt;span style="font-family:verdana;"&gt;During the course of your time spent programming video games, there will often be times where you need to go back over your code days, weeks, even months after you've originally wrote the code to update it. (for example in games that have new versions released on a regular basis, like Madden) You'll find that without proper documentation, you can easily forget what your code does and why it's there. This is often referred to as "code rot." The solution? Comments.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Comments are used in code to tell you or someone else(you might be working on a big project in a group) what the code does. Comments are &lt;strong&gt;not&lt;/strong&gt; parsed by Flash; and for that matter, the concept of commenting codes is pretty universal throughout all programming and scripting languages. Comments only exist to aid in the organization and readability of your code. If you think this isn’t important, think again. Just because you understand what you’re typing up now doesn’t mean that 6 months from now you’ll remember what parts of your code did what.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;So that your code is manageable and others can read and understand it (so that perhaps they can help you make your game), it’s important to have comments that describe what does what, and why it does it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;There are two different styles of comments in programming: I call them C-style comments and C++ comments. Or you might wish to call them multi-line and single-line comments, respectively.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;C-style comments begin with ‘/*’ and do not end until you terminate them with the ‘*/’ symbols. If you do not close these comments, ALL code after your opening comment symbol will not be parsed as code, but rather ignored. Sometimes this is actually done intentionally to test what a game would be like without certain lines of code, without having to actually DELETE them. This is called “commenting out” code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Example: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;*/ This will go on and on…&lt;br /&gt;…And on… until I terminate the comment with */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;You’re also able to use C++ (or single-line) comments. These are much easier to type: they’re simply two forward slashes ‘//’. Everything beyond those slashes is “commented out” until it reaches the end of the line. So these comments don’t need to be terminated. They automatically terminate at the end of any line of code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;if (x==5) //If x equals 5,&lt;br /&gt;DoSomething(); //Do something.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-9034455271719259026?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/9034455271719259026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=9034455271719259026' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/9034455271719259026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/9034455271719259026'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/how-to-keep-your-code-more-organized.html' title='How to Keep Your Code More Organized With Comments'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-2988774088084647137</id><published>2007-04-02T15:51:00.000-05:00</published><updated>2007-04-03T21:22:28.119-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Character Movement'/><title type='text'>How To Make Your Characters Come To Life in Flash</title><content type='html'>&lt;span&gt;&lt;span style="font-family:verdana;"&gt;Our first lesson that we'll teach the aspiring video game designer is the very basics of moving a character in Flash. In any game, obviously control over the character's movement is paramount.&lt;br /&gt;&lt;br /&gt;To understand how our character can move, first you must be familiar with how the axes (the horizontal and vertical planes, or x and y) work in Flash. Unlike the coordinate plane that you may be familiar with from your math classes, the origin (0,0) in Flash is not in the dead center of the screen, but rather in the top-left corner. As you increase the x value of the coordinate, the location moves right, and increasing the y value of a coordinate moves an object down.&lt;br /&gt;&lt;br /&gt;In Flash, there are certain parameters that objects like movie clips possess: their position on the x axis, their position on the y axis, their height, width, and their rotation degree; just to name a few. These parameters are known as properties, and can easily be manipulated to change the orientation of the object. Properties are expressed by their name, which is prefixed with an underscore (_). For example, the way to change the position of any movie clip would be expressed as: &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#c0c0c0;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;_root.myMovieClip._x += 5;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;To create a movie clip of your own, draw any object on the stage, highlight your drawn object, and press F8 or select "Convert to Symbol..." under the Modify menu. A dialogue box will appear, allowing you to create a movie clip, button, or graphic symbol. Select "movie clip" and make sure you give your movie clip a relevant name simply for organizational purposes. A movie clip is essentially a drawn object that can be programmed to behave in a certain way with Flash's built-in ActionScript language. Movie clips run completely independent of the main animation timeline. To enter code or "Actions" into your movie clip, you must highlight your desired movie clip and select "Actions" from the Window menu, or simply press F9.&lt;br /&gt;&lt;br /&gt;It's important to note that when entering Actions into a movie clip, all code must be contained within onClipEvent() handlers. Typically, the two handlers you'll use the most is onClipEvent(load), and onClipEvent(enterFrame). onClipEvent(load) script executes once when the movie clip first loads, and onClipEvent(enterFrame) executes all the code contained within every frame. If your movie has a frame rate of 30 frames per second, then onClipEvent(enterFrame) code is executed 30 times per second.&lt;br /&gt;&lt;br /&gt;This script, assuming that your movie clip has the instance name, "myMovieClip" will first find the value of _x in myMovieClip. Let's assume that particular movie clip is located at the origin (0,0) in the top-left corner. After this command is executed, the clip will be located at (5,0), which will locate the clip 5 pixels to the right of where it was originally. This is the foundation for moving characters and objects around on the screen.&lt;br /&gt;&lt;br /&gt;Now all that we must do is allow the user to press and hold down arrow keys to force our character or object to move in any direction. (up, down, left, right, and all four diagonal directions in-between each of them) To do this, we have to use conditional testing (if statements) every frame to test to see if one of the arrow keys have been pressed, and manipulate our character's _x and _y properties accordingly.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;onClipEvent(enterFrame){&lt;br /&gt;&lt;br /&gt;if (Key.isDown(Key.LEFT)){&lt;br /&gt;this._x -= 5;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (Key.isDown(Key.RIGHT)){&lt;br /&gt;this._x += 5;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (Key.isDown(Key.UP)){&lt;br /&gt;this._y -= 5;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if&lt;br /&gt;(Key.isDown(Key.DOWN)){&lt;br /&gt;this._y += 5;&lt;br /&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#999999;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;This code ensures that Flash will check every time a new frame is loaded to see if one of the arrow keys is pressed, and move your movie clip based on which arrow keys are pressed. Your character can even move in diagonal directions with this very simple script. It should be noted that using the default frame rate of 12 frames per second will produce a very slow and 'choppy' effect. Typically, 30 frames per second is a good frame rate for a Flash video game. To alter the your document's frame rate, simply right-click an empty part of the stage in Flash and select "Document Properties."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-2988774088084647137?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/2988774088084647137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=2988774088084647137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/2988774088084647137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/2988774088084647137'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/character-movement.html' title='How To Make Your Characters Come To Life in Flash'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1229841548985910616.post-2834191202577772776</id><published>2007-04-02T13:47:00.000-05:00</published><updated>2007-04-05T03:10:54.127-05:00</updated><title type='text'>Welcome</title><content type='html'>Welcome to &lt;a href="http://www.stellarsoftstudios.com"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Stellarsoft&lt;/span&gt; Studio&lt;/a&gt;'s daily blog about programming video games of your very own. Here we'll feature daily tips, tricks, and tutorials about making your own games, namely in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Macromedia&lt;/span&gt; Flash. We hope that you find our blog entries very useful and take the knowledge that you gain from these tutorials and put it to use in your own creative way. &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;After all&lt;/span&gt;, interactive video games are one of the very best mediums through which to express your creativity and ideas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1229841548985910616-2834191202577772776?l=stellarsoftstudios.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stellarsoftstudios.blogspot.com/feeds/2834191202577772776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1229841548985910616&amp;postID=2834191202577772776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/2834191202577772776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1229841548985910616/posts/default/2834191202577772776'/><link rel='alternate' type='text/html' href='http://stellarsoftstudios.blogspot.com/2007/04/welcome.html' title='Welcome'/><author><name>Witter Webs</name><uri>http://www.blogger.com/profile/03199144334668973309</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02805050231548739203'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>