Instructions - Mono - Mac - Command Line

This article shows you how to get started creating a SwinGame using the Macintosh Mono version of the SwinGame SDK.

Requirements
You will need the following to use the Macintosh Mono version of the SwinGame.


 * Mono - A free download from Mono. The package will have the compiler and the runtime.
 * Text editor - Smultron or TextMate. Smultron is a freeware and supports Pascal syntax. TextMate is a shareware and supports C# syntax by using the bundle and many other features. The C# bundle can be downloaded in here.
 * The SwinGame SDK - download [[Media:SGSDK-1-1-0-VB-Mac-Mono.dmg|Visual Basic]] or [[Media:SGSDK-1-1-0-CSharp-Mac-Mono.dmg|C#]]

Installing
The file downloaded contains all the files you need to start making the game. You will not need to install this, just copy the SGDDK folder to wherever you like. The following files are included in the SDK.
 * GameLogic- The main game source file. You will be writing your game to this file.
 * GameResources - Resource manager (Explained in here)
 * build.sh - A script to compile the game.
 * pack.sh - A script to pack the game.
 * bin folder - A compiled game will go in here.
 * lib folder - Contains the SwinGame libraries.
 * Resources folder - Contains the resources used in a game.

Starting a Game
In order to run the game you need to do the following:
 * 1) Open the Terminal
 * 2) Move to the SwinGame SDK directory (use cd command)
 * 3) Compile the game using the build.sh script. (execute ./build.sh)
 * 4) Package the game using pack.sh script. (execute ./pack.sh )
 * 5) Run the .app file in the bin folder.

That's all. You have now setup SwinGame and are ready to create your own games.

Upgrading
The following instructions indicate how to upgrade an existing project to a new version of the SDK.
 * To 1.1.5 - from 1.1.4
 * Delete the lib folder in your project
 * Copy lib folder from v1.1.4 into your project
 * To 1.1.4 - from 1.1.3
 * Delete the lib folder in your project
 * Copy lib folder from v1.1.4 into your project
 * To 1.1.3 - from 1.1.2
 * Delete the lib folder in your project
 * Copy lib folder from v1.1.3 into your project
 * To 1.1.2 - from 1.1.1
 * Delete the lib folder in your project
 * Copy lib folder from v1.1.2 into your project
 * Rename GameResources in your project
 * Copy GameResources into your project from v1.1.2
 * Merge in changes to the LoadImage, etc. routines from your old GameResources source file
 * To 1.1.1 - from 1.1.0
 * Delete the lib folder in your project
 * Copy lib folder from v1.1.1 into your project
 * Rename GameResources in your project
 * Copy GameResources into your project from v1.1.1
 * Merge in changes to the LoadImage, etc. routines from your old GameResources
 * Copy new images from v1.1.1 Resources folder

Distributing your Game
When your game is complete you can distribute it by packaging up all of the files in the bin folder. These can then be distributed to anyone running Mac. They run the game by double clicking the executable. They do not need to install anything to run the game.

As you have developed this game in Pascal it is also possible to distribute it to people running Windows or Linux. To do this you will need to compile the game on Windows or Linux. You need to get the SwinGame and copy all of your Pascal source code files (*.pas) to the Linux or Windows version of the SDK. Then run the scripts that accompany these SDKs and you will have a native Windows or Linux application!

Enjoy programming with SwinGame!