Create Whirled Games

Create Whirled Games with ActionScript (Windows)

Introduction

The following tutorial is for Windows, and has been tested on Windows 11. To see setup details for Linux and MacOS, you can check out the archived Whirled Wiki. This tutorial will show how to create new games, but this setup can also be used to compile existing games if they come with a build.bat file.

Installing and setting up the Java JDK

You will need Java 2 Runtime Environment, Standard Edition 5.0, which you can download directly here, or through Oracle's website.

Run the downloaded file and complete the installation (choose the standard installation option).

Then you will need to add Java to your environment variables. Open your file explorer and find where Java was installed, usually in C:\Program Files\Java\jdk[version]\bin or C:\Program Files (x86)\Java\jre[version]\bin.

Then open your system's environment variables by typing in environment variables in the Windows search bar, then clicking Environment Variables... at the bottom right. If you are unable to use the search feature, then you can find environment variables by right clicking on This PC or My Computer in your file explorer, selecting Properties, then Advanced system settings. System Properties will open, then at the bottom select Environment Variables.



In the user variables section, click on Path, click Edit, click New, click Browse, then select the bin location of the Java installation, such as C:\Program Files (x86)\Java\jre1.5.0\bin. Select Ok on all windows to close them.

Verify your installation by first opening Command Prompt or Windows PowerShell.

Then type java -version and press enter. It should have an output similar to

java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)

Downloading the Flex SDK

Next, you will need Flex 3, which you can download here, or through an archived version online.

Unzip the folder and name the unzipped folder flex_sdk_3. Make sure the standalone Flash Player is inside the folder, flex_sdk_3\runtimes\player\win\FlashPlayer.exe.

Run an example game

Now you can start testing Whirled games. Download and unzip the Whirled SDK (you should already have this if you've made avatars).

Go to where you unzipped the Whirled SDK, then go to whirled\examples\games\reversi. Double click build.bat (a Windows batch file named build) to run the sample game.

When you run this for the first time, it will ask for the location of your Flex 3 SDK. Press OK then find the flex_sdk_3 folder. Select it and click Select.

Then it will ask for the Standalone Flash Player. Select flex_sdk_3\runtimes\player\win\FlashPlayer.exe.

It will then attempt to build the game in a command line window. If it is successful, a couple Flash Player windows will pop up showing a multiplayer game.

When exiting the game windows, the command line will say the build was successful. The compiled .swf file will be in the reversi folder, which you can upload to Whirled.

Debugging

If it doesn't work, check the command line window for any errors. If you are unsure, you can close the window and retry running build.bat.

If you made a mistake somewhere and want to reset the locations of the Flex folder and the standalone Flash Player, you can go to the whirled folder and delete the build.properties file. It will recreate this file when running build.bat and reprompt you for the locations.

If there is an error saying something like 'address is already in use', a previous run of the game may still be open. You may need to restart your computer or close the process manually, by opening Windows PowerShell and typing (or pasting with right click) netstat -ano | findstr :8080. You will get a result like TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 2616, where the number at the end is the process id of the Java program. You can type Get-Process -Id pid to verify that this process is being run by Java, replacing pid with the number you saw in the previous step. Close the process with Stop-Process -Id pid -Force. If this error is reoccuring, you can prevent it from happening by pressing Ctrl + C in the command line window or closing the command line through the task manager instead of closing by clicking the x on the windows.

If the error is something relating to the Java code of the file, then your Java installation and setup may not be complete. If you are running a game other than reversi, such as a game from the Whirled archive, certain imports and functions may need to be edited to use the updated Whirled SDK.