Learning Petit Bonus Lesson: Coding Tips and Strategies

''This page will be a bit of a departure from my introductory tutorial series. Here I will present some general coding strategies for more advanced users. If you're looking for ways to work faster, or write better/more powerful code, give this a look and leave your comments below!''

This tutorial covers advanced topics for improving your code and accomplishing more within Petit. Power users may already be familiar with many of these strategies.

Editing strategies

 * Memorize your @Label names and use the search tool to navigate through your code more quickly
 * Holding L and pressing Y will delete an entire line of code at once, much faster than deleting the line by holding Y
 * Use comments, line-breaks, and indentation to sculpt your code so you can recognize features faster when scrolling
 * If you always change editor properties like the text on the function keys or the

Code architecture strategies

 * Store values that never change but get used a lot to variables:
 * This makes it easier to change them later


 * You can store @label names in variables and use those variables with GOTO and GOSUB. This is one of the most powerful features in Petit, because it allows you to do things like this:
 * e.g. you can essentially attach labels to sprites and go to those labels when something happens to the sprite

This page will likely be expanded and reformatted over time
 * Store indexes into named variables so you don't have to remember the indexes and your code is more readable
 * Use goto as an alternative to putting multiple instructions on one IF line: