Re: Distributing your games (making a .love file)
Posted: Tue Jul 10, 2012 7:11 am
Well that's just so obvious...why didn't I think of it!Kaze wrote:I just drag my game folders onto my batch script, "Make LOVE.bat".
Well that's just so obvious...why didn't I think of it!Kaze wrote:I just drag my game folders onto my batch script, "Make LOVE.bat".
Code: Select all
#!/bin/bash
cd $NAUTILUS_SCRIPT_CURRENT_URI
zip -r game.love *
Code: Select all
<project>
<target name="package">
<zip destfile="mygame.love"
basedir="game"
excludes="**/.DS_Store, **/.dropbox"
/>
<!-- Windows x86 -->
<mkdir dir="mygame-win-x86" />
<mkdir dir="mygame-win-x86/love2d" />
<copy todir="mygame-win-x86">
<fileset dir="love2d/love-0.8.0-win-x86">
<include name="**/*.dll" />
<include name="love.exe" />
</fileset>
</copy>
<copy todir="mygame-win-x86/love2d">
<fileset dir="love2d/love-0.8.0-win-x86">
<include name="**/*.txt" />
</fileset>
</copy>
<exec executable="cat" output="mygame-win-x86/mygame.exe">
<arg value="mygame-win-x86/love.exe" />
<arg value="mygame.love" />
</exec>
<delete file="mygame-win-x86/love.exe" />
<zip destfile="mygame-win-x86.zip"
basedir="mygame-win-x86"
excludes="**/.DS_Store, **/.dropbox"
/>
<delete dir="mygame-win-x86" />
<!-- Windows x64 -->
<mkdir dir="mygame-win-x64" />
<mkdir dir="mygame-win-x64/love2d" />
<copy todir="mygame-win-x64">
<fileset dir="love2d/love-0.8.0-win-x64">
<include name="**/*.dll" />
<include name="love.exe" />
</fileset>
</copy>
<copy todir="mygame-win-x64/love2d">
<fileset dir="love2d/love-0.8.0-win-x64">
<include name="**/*.txt" />
</fileset>
</copy>
<exec executable="cat" output="mygame-win-x64/mygame.exe">
<arg value="mygame-win-x64/love.exe" />
<arg value="mygame.love" />
</exec>
<delete file="mygame-win-x64/love.exe" />
<zip destfile="mygame-win-x64.zip"
basedir="mygame-win-x64"
excludes="**/.DS_Store, **/.dropbox"
/>
<delete dir="mygame-win-x64" />
<!-- OS X -->
<mkdir dir="mygame-osx-universal" />
<exec executable="cp" output="/dev/null">
<arg value="-r" />
<arg value="love2d/love.app" />
<arg value="mygame-osx-universal/mygame.app" />
</exec>
<copy file="mygame.love" todir="mygame-osx-universal/mygame.app/Contents/Resources" />
<copy file="package/Info.plist" todir="mygame-osx-universal/mygame.app/Contents" overwrite="true" />
<copy file="package/mygame-icon.icns" todir="mygame-osx-universal/mygame.app/Contents/Resources" overwrite="true" />
<exec executable="hdiutil">
<arg value="create" />
<arg value="./mygame-osx.dmg" />
<arg value="-srcfolder" />
<arg value="mygame-osx-universal" />
<arg value="-ov" />
<arg value="-nospotlight" />
<arg value="-format" />
<arg value="UDZO" />
<arg value="-imagekey" />
<arg value="zlib-level=9" />
<arg value="-volname" />
<arg value="My Game" />
</exec>
<delete dir="mygame-osx-universal" />
</target>
</project>
Code: Select all
@echo off
SET "CDIR=%~dp0"
:: for loop requires removing trailing backslash from %~dp0 output
SET "CDIR=%CDIR:~0,-1%"
FOR %%i IN ("%CDIR%") DO SET "PARENTFOLDERNAME=%%~nxi"
SET "CURDIR=%~dp0"
echo %CURDIR%
IF %1 EQU build GOTO buildlove
IF %1 EQU run GOTO run
IF %1 EQU clean GOTO clean
GOTO end
:run
ECHO Running %PARENTFOLDERNAME%
cd %CURDIR%
cd ..\
tools\love32\love.exe %PARENTFOLDERNAME%
goto end
:clean
ECHO Cleaning %PARENTFOLDERNAME% Distributables
cd %CURDIR%
cd ..\distributables
if exist %PARENTFOLDERNAME% rmdir /S /Q %PARENTFOLDERNAME%
cd %CURDIR%
goto end
:buildlove
ECHO Cleaning %PARENTFOLDERNAME% Distributables
cd %CURDIR%
cd ..\distributables
if exist %PARENTFOLDERNAME% rmdir /S /Q %PARENTFOLDERNAME%
ECHO Building Distribution Folders for: %PARENTFOLDERNAME%
cd %CURDIR%
cd ..\tools
XCOPY love32 ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32 /E /C /R /I /K /Y
XCOPY love64 ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64 /E /C /R /I /K /Y
ECHO Building Love File: %PARENTFOLDERNAME%
cd %CURDIR%
..\tools\7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.love *.* -x!build.bat -x!darkroast.wkp
..\tools\7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\%PARENTFOLDERNAME%.love *.* -x!build.bat -x!darkroast.wkp
copy ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.love ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%.love
ECHO Compiling x32 Executable
cd %CURDIR%
cd ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\
copy /b love.exe+%PARENTFOLDERNAME%.love %PARENTFOLDERNAME%.exe
del love.exe
del %PARENTFOLDERNAME%.love
ECHO Compiling x64 Executable
cd %CURDIR%
cd ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\
copy /b love.exe+%PARENTFOLDERNAME%.love %PARENTFOLDERNAME%.exe
del love.exe
del %PARENTFOLDERNAME%.love
ECHO Compiling Zips to Distribute
cd %CURDIR%
cd ..\tools
7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32.zip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\*.*
7za a -r -tzip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64.zip ..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%64\*.*
ECHO Testing Compiled Executable
cd %CURDIR%
..\distributables\%PARENTFOLDERNAME%\%PARENTFOLDERNAME%32\%PARENTFOLDERNAME%.exe
goto end
:end
That image is too small, it barely takes up my whole screen.Eamonn wrote:I just love doing this: