|
Setting Up A Platformer Starter Kit Environment
Overview
Below we will detail the process of setting up your IDE to use the PushButton Engine(PBE) with the Platformer Starter Kit(PSK).
Plenty of documentation exists on the PushButton site that explains in more detail how to get an IDE setup to use PBE. We'll briefly go through those steps here for completion sake. If you have further questions about getting your workspace setup to use PBE, click here.
Requirements:
- Flash/Flex Builder (registered or trial version, other IDEs can be used as well, these tutorials will assume Flash Builder. Please be aware of any necessary differences.)
- PushButton Engine (Download here)
- Tiled (Download here. Windows, Mac, or platform independent Java version. Please note the Java version will require you install the Java Runtime Environment)
- Platformer Starter Kit (Purchase here, if you haven't already)
Step 1: Creating A Working Project
Go ahead and open Flash Builder. When open, click the File Menu item and select New -> ActionScript Project.
Now lets give the project a name, set its file location and SDK version.
In the Project name field type PSKTest. In the Folder field, either browse to the path where you wish to keep your source code or just check Use default location (personal choice). Lastly select the Flex SDK version you would like to use (preferably 4.x).
Click the Finish button when you are done.
Next we need to add some compiler arguments for PBE.
Right click the project name (PSKTest) in the Flex Navigator and select Properties. Click ActionScript Compiler in the left sidenav. In the Additional compiler arguments field, input the following;
--keep-as3-metadata+=TypeHint,EditorData,Embed
Click the OK button.
Step 2: Adding The Libraries
Now we need to add our libraries. First we'll add the PBE library.
Right click the project name (PSKTest) in the Flex Navigator and select Properties. Click ActionScript Build Path in the left sidenav. Click the Library path tab. Click the Add SWC button. Browse to location where you unzipped the PushButton Engine and open the bin folder. Select the PBEngine.swc file and click the Open button.
Next we'll add the PSK source.
Right click the project name (PSKTest) in the Flex Navigator and select Properties. Click ActionScript Build Path in the left sidenav. Click the Source path tab. Click the Add Folder button. Browse to location where you unzipped the Platformer Starter Kit zip file. Select the src folder and click the OK button.
Step 3: Hello World!
Whats a programming tutorial series without Hello World!
Your main actionscript file should have the following;
package { // Flash Imports import flash.display.Sprite; public class PSKTest extends Sprite { public function PSKTest() {
} } }
First we need to add the required PBE imports, startup statement, and our Hello World print statement. The screenshot below shows our needed additions.
Now click the Debug button. If everything was done correctly you should see the following in the IDE output window.
Tada! We have successfully added text to the output window! Exciting stuff right? right? Ok, maybe not, so lets move on to the fun stuff!
|