i also tried this stuff in my homemate's computer which is win7.
thanks for all your help. i hope no one is cursing me

I see your script and decide to do equivalent to shell (because I'm sure to have a sh environnement, not always a ruby one).BlackBulletIV wrote:For a Linux and Mac friendly version, here's a Ruby script.
Make sure you're in the project directory when executing, and that you provide a filename for the .love file (with or without the extension).
EDIT: On Mac OSX, a cool thing to do is add this to your ~/.bash_profile file:Code: Select all
#!/usr/bin/env ruby if ARGV.length == 0 print "Usage: ./make_love_file.rb love_file_location\n" print "Make sure you are in the project folder when using this command..\n" exit 0 end unless File.exists? 'main.lua' print "Directory does not contain a main.lua file.\n" exit 1 end if ARGV[0] file = ARGV[0] file += '.love' unless file.end_with? '.love' `zip -r #{file} *` if $?.exitstatus == 0 print "#{ARGV[0]}.love created successfully.\n" else print "An error occurred file creating the file.\n" end else print "Please give a name for the .love file.\n" exit 1 end
Then you can execute like this from anywhere:Code: Select all
alias lovemake="path/to/where/you/placed/script.rb"
Code: Select all
lovemake LoveFileName
Code: Select all
#!/bin/bash
if test $# -eq 0; then
echo >&2 "Usage: $(basename "$0") <option|love_file_location>"
echo >&2 " dev make a currentdir-YYYYMMDD-HHMMSS.love file"
echo >&2 " release make a currentdir-YYYYMMDD.love file"
echo >&2 " auto see dev"
echo >&2 " clean remove the current *.love files"
echo >&2 "Make sure you are in the project folder when using this command."
exit 1
fi
if test ! -f "main.lua"; then
echo >&2 "Directory does not contain a main.lua file."
exit 2
fi
if test -z "$1"; then
echo >&2 "Please give a name for the .love file."
exit 2
fi
verbose=0
case "$1" in
auto|dev)
file="$(basename "$(pwd)")"-`date +%Y%m%d-%H%M%S`.love
verbose=0
;;
release)
# calculate the current day (before sleeping)
# like the day is changing at 5h!
day=`date -d "-5 hours" +%d`
file="$(basename "$(pwd)")"-`date +%Y%m`${day}.love
verbose=1
;;
clean|dist-clean)
rm -i -- *.love
exit 0
;;
*)
file="$1" ; shift
if echo "$file" | grep -q -v -- '\.love$'; then
file="${file}.love"
fi
esac
QUIET=""
if test $verbose -eq 0; then
QUIET="-q"
fi
IGNORE=""
if test -f .release.ignore; then
IGNORE="-x@.release.ignore"
fi
zip $QUIET -r "$file" * -x "*.love" -x "$file" -x .release.ignore $IGNORE
ret=$?
if test $ret -ne 0; then
echo >&2 "An error occurred file creating the file."
exit $ret
fi
echo "File created successfully : $file"
Code: Select all
lovemake test
Code: Select all
lovemake release
Code: Select all
lovemake dev
Code: Select all
echo My LÖVE precious game! | zip -zr9n .png:.jpeg:.jpg ../${PWD##*/}.love ./*
Code: Select all
require ('colors')
require ('level')
require ('player.player')
require ('player.moveplayer')
require ('collisions')
require ('level.impermeableobjects')
require ('startpoint')
require ('message')
function love.load()
--level.load()
player:load()
note='-'
scale=1.5--1.5
collision=nil
end
function love.update(dt)
startpoint:pulse(dt)
if boxCollision(player,object,dt)
then collision=boxCollision(player,object,dt)
else collision='-' end
player:update(object,dt)
end
function love.draw()
love.graphics.push()
love.graphics.scale(scale)
player:draw()
startpoint:draw()
-- for i=1,#object do
level.drawObject(object)
-- end
color(white)
love.graphics.print("title? Perhaps I'll use these to keep track of progress",60,30)
love.graphics.pop()
color(white)
love.graphics.print(player.x..', '..player.y,10,10)
love.graphics.print(collision, 10,30)
message()
end
function love.mousepressed(x,y,button)
if button=='l' then
player.x=x/scale
player.y=y/scale
end
end
function love.keypressed(key,unicode)
if key==' ' then player.vy=-player.jump_v end
if key=='return' then player.x=startpoint.x player.y=startpoint.y end
end
Users browsing this forum: No registered users and 50 guests