MoonScript & love

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: MoonScript & love

Post by Roland_Yonaba »

Hmm...
Since Im not realky familiar with LuaRocks, how do i make Moonscript work just using Lua standalone interpreter (Lua.exe) ?
User avatar
Frozen City
Prole
Posts: 3
Joined: Thu Sep 01, 2011 3:07 pm
Contact:

Re: MoonScript & love

Post by Frozen City »

Looks very cool. I have never used LOVE or MoonScript before but am really excited to give it a try. Any advice for a newbie on installation/getting started resources for using MoonScript and LOVE (preferably together)? And yes, I vote you make a Windows build.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: MoonScript & love

Post by Roland_Yonaba »

Frozen City wrote:Looks very cool. I have never used LOVE or MoonScript before but am really excited to give it a try. Any advice for a newbie on installation/getting started resources for using MoonScript and LOVE (preferably together)? And yes, I vote you make a Windows build.
+1!
t.w()
Prole
Posts: 4
Joined: Sat Feb 19, 2011 8:58 pm

Re: MoonScript & love

Post by t.w() »

Awesome! I've been trying to get this to work since I saw the announcement for Moonscript on Reddit. I'll post the source of a test-game in Moonscript soon.

Thank you
User avatar
Frozen City
Prole
Posts: 3
Joined: Thu Sep 01, 2011 3:07 pm
Contact:

Re: MoonScript & love

Post by Frozen City »

Cool t.w(). I'd be interested in seeing that.
User avatar
tsturzl
Party member
Posts: 161
Joined: Fri Apr 08, 2011 3:24 am

Re: MoonScript & love

Post by tsturzl »

Perhaps instead of a Love fork, you could just make a wrapper that makes it more fluent with Moonscript. You program a wrapper library in moonscript, and create moonscript class objects for everything, then it compiles to lua code which can then be run on Love2D. I'm not sure if that was already the plan, but it would be a really cool idea.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: MoonScript & love

Post by bartbes »

Personally, I'd like it if moonscript was Class Commons compatible.
leafo
Prole
Posts: 28
Joined: Tue Aug 16, 2011 6:01 am

Re: MoonScript & love

Post by leafo »

Sorry for bringing back an old topic.

I've been creating windows builds of moonscript here:

http://moonscript.org/bin/

Grab the latest one: http://moonscript.org/bin/moonscript-0.2.0-dev-3.zip

moon.exe runs moon files all by themselves, and moonc.exe will compile moon to lua. Run them with the -h flag to see how to use them.

I recently added a watch flag to the windows binary. This makes it really easy to use moonscript with your existing installation of LOVE.

For example, a little mini tutorial:
  • Create a new LOVE project
  • Create some .moon files as you would .lua files. Here's a main.moon to get you started:

    Code: Select all

    love.draw = ->
      love.graphics.print 'Hello World!', 400, 300
  • Enter that directory from the command line
  • Run:

    Code: Select all

    moonc.exe -w .
  • Save your main.moon again, and notice how it will automatically compile.
Your moon files will automatically compile to lua files when you edit them. This means you can write MoonScript, then run LOVE like normal in order to play your game.

If anyone is interested in a better tutorial, I don't mind writing one. Just speak up.


Additionally, I have a more experimental way of running LOVE with moonscript:

In here I have some builds of love with moonscript baked in: http://leafo.net/love/
Once again, grab the latest: http://leafo.net/love/build-2.zip

This time, you can just write .moon files, and run the provided love.exe and it will detect moon files and automatically compile them. It still works with lua files as well, it just uses the file extension to detect what to do.

The only reason I didn't recommend this method over the previous is that I have been running into strange issues with compilation depending on the input. I'll have to look into it. (This binary also has enet, lpeg, and cjson built in, so you don't need any extra dlls, if that is of any use).

I appreciate any feedback, I'll pay closer attention to this topic!

And one extra bonus, I created an online compiler to experiment with moonscript: http://moonscript.org/compiler/
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: MoonScript & love

Post by Roland_Yonaba »

Awesome job...
I'll have a look at the new windows build. Thanks so much!
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: MoonScript & love

Post by qaisjp »

It's probably very inappropriate of me to bump a two year old topic, but what is the scene in integrating Moonscript with Love2d?
Lua is not an acronym.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests