Programming Practices

From MySLife DAS Wiki

Jump to: navigation, search

Contents

Topic Summary: In this topic you will learn some good programming practices for writing 'clean' game code. Use of such practices reduces the number of bugs (errors) you make, and makes it easier to debug (fix) your code. It also makes it easier to share your code with team members and others who can help you.


Topic Assignments

Always use an "Actions" layer for your code

In order to save time and make their code easier to update and 'debug', professional ActionScript programmers write code in one layer on the main timeline. This layer may be called "Actions", "Script" to let themselves know that this layer is for ActionScript alone.

  • We STRONGLY suggest that when you write ActionScript, you create a layer called "Actions" and place your script in there.


Good Practice: Notice the Actions Layer and the Actions window:



Bad Practice: Notice how the code is placed within a movie clip:

You can read more about coding practices at Adobe's "LiveDocs"


Watch this clip on Flash Script Assist that pops up programming suggestions while you code in ActionScript.


Read
the MyGLife.org custom tutorial on Comments in ActionScript. Use Comments to better explain your work for future reference and to let others learn from it.


Update the Blog:

  • Write a Blog post about this topic, share your learning experience!


Related Links and Tutorials


Search the Web for more information

Here are some search results on Flash ActionScript programming:


Image:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gif Students Contributions

Personal tools