I did some research and wrote a wrapper library for Love2D to run Codify scripts on MacOSX/Linux/Windows.
You can get it from my Blog: http://crankgaming.blogspot.com/2011/11/lovecodify-wrapper-library-to-run.html
cheers Florian^SiENcE
This is just amazing. Looking at your source, you seem to have a pretty good mapping from Codea -> Love. You even took care of parameters and mapping mouse clicks to touches.
Some bits just don't seem to map well to Love though, vector graphics styles seem to be troublesome, as are ellipse/rectModes.
You could potentially do ellipseModes as a stored state that offsets the transform in the ellipse() call, then pops the transform.
Excelent! I thought of doing this, but I lazy. Now I'm excited. thnks!
Forked, and working on!
For anyone testing this out on a Mac, here's what I did to get it working:
While messing around with the Space Invader game that was provided with Codea/Codify on the iPad, I noticed that "vec2(0,0)" seems to reference the Top Left of the screen in LoveCodify instead of the Bottom Left like Codea does.
Unless there is a better way to handle coordinates, LUA is all new to me.
with regard to the SpaceCute assets, I just unzipped the entire spritepack.zip into the root of my game folder. This should create 3 folders for Planet Cute, Small World, and SpaceCute. Of course you only need to keep the sprites you area actually using, but while messing around, I kept them all in my project folder.
I did this so I didn't have to change any of my code between what I can in Codify and using loveCodify.
Hopefully something will come up with a patch that will translate the coordinate system between Love2d and Codify. Really looking forward to seeing more of this project, awesome job.
Sadly Love2D does not support relative paths (because of security issues). So you have to copy all gfx into the your project folder.
I would like to keep all graphic assets on one place in only one folder.
If someone has an idea how to solve this problem, please share it.
ps: Screenresolution is now fixed to Codify's 748x748
Fork Love2D, and mount spritepack dir on PHYSFS. :) Look at boot.lua
Observation: loveCodify rocks. I have my stuff on github, and I can test on my desktop, then publish, then load it into Codea and it just works. This is 99% of what I'd want/need from an OS X version of Codea - except it works on ubuntu too!
Weird Quirk: I have some stuff that use math.sin(frame) to do periodic movement; when I try it on the ipad, I get a slow spinner - but when I try it on loveCodify, it's nearly a blur. I'd normally think it's degrees vs. radians - except when I print results, it's not. I'd also think that maybe it's just that the OS X box is insanely faster (and - it is!) - except it's based on a "frame" variable I increment at every draw, and that's not going up insanely faster. Is a puzzlement. Maybe I'll try to take a video of it to show the difference.
Two Suggestions:
First - It would be nice if code could work unchanged between Codea and loveCodify. Presumably this could be as easy as making dofile() be an existing but no-operation subroutine in Codify, so the lines are silently ignored if they're there. At least until dofile() support is added (and it appears unlikely to ever be?) that would be cool.
Second, it would be nice to be able to set a global "LOVEHUD" or such - true, and the HUD shows, and false and it's suppressed. The hud stuff is useful for debugging and such, but if my app doesn't use watch/parameter/gravity - it would be nice if that all went away. I guess I could clone the repo and add this and submit a patch, eh? Figuring out how to do so would probably be a good exercise to go thru...
Just thought I'd record the myriad of libraries that I had to install to compile love2d on Linux (strangely, not everyone uses Ubuntu). Presumably there were more that I already had installed, but these were the extras. There's no list of dependencies at the love2d website, by the way.
libopenal-dev
liblua5.1-0-dev
libdevil-dev
liphysfs-dev
libphysfs-dev
libmodplug-dev
libmpg123-dev
libvorbis-dev
(Ah, good. You use MarkdownExtra. Seems fairly standard on Vanilla forums but you never know until you try.)
Came across this today, it might be useful to get the sound objects working in the wrapper: http://love2d.org/forums/viewtopic.php?f=5&t=2734&p=30431&hilit=lfxr#p28641
it is a port of sfxr to pure love2d.
Thank you so much for that wrapper, I finally could start coding on my mac to use later on on the ipad.
But has any of you a good Tip which IDE to use with lua and love? The feature I mostly want is code completion, is there a good IDE or text programm out there which I can use, which incorporates my own classes and function and creates the autocompletes?
Thank you for any advice
The credits are already in the main.lua Gems file.
If you want to add it also in the conf.lua just do it. I'm to lazy change all samples, sorry. Fork it and send me a pull request.
This is no repository for Codify/Codea Samples. I only need this Samples further develop LoveCodify.
I just like to mention this news. This is an Love2D-API Port to Android. Still only alpha! So don't expect too much yet!
So with LoveCodify your scripts/games should run on Android too ;-).
https://twitter.com/#!/schattenkindnet/status/135839926729191425
On Linux then the filenames are case sensitive. The default Codea name is Main.lua but this system seems to look for main.lua. At least, when I renamed my file main.lua from Main.lua then I got something reasonable.
Here are infos about love-android:
http://ghoulsblade.schattenkind.net/wiki/index.php/Love2d-android
https://github.com/hagish/love-android
You need the LoveCodify wrapper to run your Codify/Codea scripts on Android!
For reference, here is the class() function definition that Codea uses:
I'm also having trouble getting Love and loveCodify to run on my Mac. I can get Love's own demos to run and a 'Hello World' file... but I get the same message as @Magaro above whenever I try to use any of @SiENcE's loveCodified examples,
"cannot open loveCodify.lua: No such file or directory"
Anyone have any suggestions about what I might try?
Hi there,
i don't have a mac so i can't check this. I think you only have to reference the right path in the samples "Main.lua" files.
This part:
if dofile ~= nil then
dofile ("loveCodify.lua")
dofile ("Breakout/Game object classes.lua")
dofile ("Breakout/Levels.lua")
dofile ("Breakout/Numbers.lua")
end
Looking through the Love forums, it seem that dofile may not be fully supported on the mac. So, I tried replacing dofile with require and then it seems to work so long as loveCodify is in the same folder as the main. Hopefully there is a cleaner solution, but that works for now. Thanks!
Sorry guys about the misguided rambling about differences in class implementation. It's a bit hard to explain why, but the different experience I saw was due to that touch.state BEGAN never occurred in LoveCodify. The BEGAN state switches directly to MOVING in the function love.update(dt).
It looks like you're new here. If you want to get involved, click one of these buttons!