Getting Started With Plasmacorev0.23 / 2008.10.17 / Abe Pralle

Contents

1. Setup
1.1. Windows
1.1.1. Command Line Builds
1.1.2. Eclipse Plug-In

2. Starting a Project
2.1. On the Command Line
2.2. Through Eclipse

3. Updating a Project

1. Setup

1.1. Windows

1.1.1. Command Line Builds

Download the latest Slag Plasmacore distribution from:

http://plasmaworks.com/plasmacore
and unzip it to the desktop or the Program Files folder.

Install the ANT build system from:

http://ant.apache.org/
and add it to the system path so you can compile from the command line. To do this, right-click "My Computer" (Windows XP) or "Computer" (Windows Vista) and pick Properties. Then select Advanced->Environment Variables and add a system variable called "ANT_HOME" which is set to "C:\Program Files\apache-ant-1.7.0" (or similar). Then modify the "Path" environment variable and add this to the front of what's there: "%ANT_HOME%\bin;". Finally, ensure that there is an environment variable called "JAVA_HOME" that is set to a Java SDK install such as "c:\Program Files\Java\jdk1.6.4".

To build the demos (which ship without necessary binaries), open a command line prompt in the Plasmacore folder. Type "ant" and press ENTER. The build file will assemble the necessary pieces for each demo project. Then CD into each "demos" subfolder and type "ant" again to build and run that particular demo.

Use your favorite text editor to edit Slag code. Vim and TextPad syntax highlighting files are available from the Plasmacore website.


1.1.2. Eclipse Plug-In

To use the SlagEdit Eclipse plug-in developed by Jacob Stevens, follow the instructions here:

http://www.rivermanmedia.com/slagedit/info.html

2. Starting a Project

2.1. On the Command Line

  • Copy the entire "starter_project" folder to wherever you would like your project to permanently reside (you can rename it).

  • Rename "data/sample_settings.txt" to "data/settings.txt" and edit it as desired.

  • Rename "sample_build.xml" to "build.xml". Change the project name at the top from "game" to whatever you would like.

  • Add the following main file to the src/ directory - it should have the same name as your project. If your project is named "game", you would call the main file "game.slag". The class name within the file does not have to match anything else.

    # game.slag / yyyy.mm.dd by Your Name
    [include "plasmacore.slag"]
    [mainClass MyRadGame]

    class MyRadGame : Application
      METHODS
        method init:
          # one-time setup

        method update:
          # called 60 times per second

        method draw:
          # called up to 60 times per second
    endClass

  • Refer to the Plasmacore Reference, the Slag Primer, the demo files, and online How-To resources for programming guidance.
  • Add PNG and JPG images, OGG and WAV sounds, and other files to the data/ subdirectory.
  • Run "ant" from the command line to build and test your game.
  • The dist/ folder now contains the publishable executable game and data files.


    2.2. Through Eclipse

    Follow the instructions on the SlagEdit plug-in site:

    http://www.rivermanmedia.com/slagedit/info.html

3. Updating a Project
Take the "starter_project" folder from the most recent release of Plasmacore and copy it on top of your existing project. You can "replace all" - there are no files in "starter_project" that would overwrite any of the files you created for your game.