Try Love in your Browser

Showcase your libraries, tools and other projects that help your fellow love users.
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Try Love in your Browser

Post by snake »

I always taught that making flash games with Love would be awesome.
Then i saw this:
http://code.google.com/p/lua-alchemy/
And i knew what to do. 8-)

This is just an proof of concept!
It might be too slow for real games.
Lua Alchemy is still alpha software and they mean alpha!

Can i make standalone swf games from this?
Yes you could but would be a bit work and you would have to recompile it.

Functions currently (more or less) available:

Code: Select all

love.graphics.setFont(size)
love.graphics.setColor(red,green,blue)
love.graphics.setBackgroundColor(red, green, blue)
love.graphics.newImage(source)
love.graphics.draw(source,x,y,rotation,sx,sy)
love.graphics.print(text,x,y)
love.graphics.printf(text,x,y,limit,align)
love.graphics.rectangle(mode,x,y,width,height)
love.graphics.getColor()
love.graphics.getWidth()
love.graphics.getHeight()
love.mouse.getPosition() 
love.mouse.getX()
love.mouse.getY()
love.mouse.setVisible(visible)
love.keyboard.isDown(key)
love.timer.getMicroTime()
love.timer.getTime()
love.timer.sleep(time)
love.physics.newWorld(xg,yg,sleep)
love.physics.newBody(world,x,y,type)
love.physics.newCircleShape(body,radius) 
love.physics.newRectangleShape(body,w,h)
love.physics.newPolygonShape(body)
love.physics.newFixture(body,shape,density)
love.physics.newMouseJoint()
love.physics.newDistanceJoint(body1,body2,x1,y1,x2,y2)
love.physics.newGearJoint(body1,body2,ratio)
love.physics.newPulleyJoint(body1,body2,gx1,gy1,gx2,gy2,x1,y1,x2,y2,ratio)
love.physics.newRevoluteJoint(body1, body2, x, y )


Known Bugs:
- love.graphics.print:
rotation takes no effect
- love.graphics.draw:
scaling works with absolute pixel (this might be a future)
- love.graphics.newImages behave like audio sources since 0.6.1 so you have to load a file multiple time to display it more than once
- it sometimes fails without giving any error message
( thats mostly a bug of Alchemy itself)


Image
Play!


How to compile:
Download Flex SDK:
http://opensource.adobe.com/wiki/displa ... k/Flex+SDK
Download lua-alchemy.swc
http://lua-alchemy.googlecode.com/files ... -v0_2a.swc
put lua-alchemy.swc in /frameworks/libs/ of your Flex folder
change to the trylove src folder
do:

Code: Select all

mxmlc LuaAlchemyDemo.mxml  -target-player=10.0.0
Last edited by snake on Sun Apr 18, 2010 4:57 pm, edited 10 times in total.
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

The project is now stored on github:
http://github.com/Snaker1/Love-Alchemy

Please vote and suggest names for my project!
Last edited by snake on Sun Mar 14, 2010 3:35 am, edited 1 time in total.
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: Try Love in your Browser

Post by farvardin »

it looks promising!
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

Love Alchemy wins as the Name!

Some Updates:
Keyboard input works now quite well.
"Stop" button.
Check it out!

Oh and if someone wants to help:
Just say it, no special skills required.

:neko:
Devhochi
Prole
Posts: 10
Joined: Sun Jul 19, 2009 9:46 pm

Re: Try Love in your Browser

Post by Devhochi »

good project. very promising indeed.
keep it up :)
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

Update!

Features:
- delta time
- print() output
- love.timer.sleep
- ~2 times faster

I also uploaded a small Snake game on github to demonstrate how a stand-alone game in Love Alchemy could be made.

If you see a Bug or have a Feature request you can write it here http://github.com/Snaker1/Love-Alchemy/issues or post it in this Thread.
I will be off from Internet for one week so dont worry.

I have two Ideas you can discuss for the Time being:

1. haxe.org
If we could get the Lua interpreter ported to haxe we could target flash, js and native c at the same time.
I can not do the port.
Other use could be to get independent from Flex SDK so that love Alchemy can be compiled using Haxe instead of Flex SDK.

2. epic replace java script with Lua plan
I will definitely put some research in this one.
The Idea is simple: Everywhere where java script is used on web development replace it with Lua and so make web development fun and faster.
So Lua + HTML 5 CANVAS -> Adobe can gtfo!

Discuss!
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Try Love in your Browser

Post by pygy »

This looks very promising. I'm thinking of porting Pölygamy to your environment (with AS3 callbacks for better performance).
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

pygy wrote:This looks very promising. I'm thinking of porting Pölygamy to your environment (with AS3 callbacks for better performance).
I am not sure if you should not wait with porting Pölygamy till Love Alchemy is more mature.
(I just wanted to have i warned you. :joker: )

If you consider this really seriously you should definitely talk to me about it so i can help you and explain how Love Alchemy works.
Just PM me every question you have.
I might come to IRC for some time too but dont count on it or just wait one week to get full time support.
(The plan was no Internet for this week but there is always a WLAN ;) )
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

Love-Alchemy now with Box2d!

Features:
You dont have to set the size of the world, it is unlimited.
You can freely access and edit all Box2d actionscript functions giving you more freedom.

There are differences between Box2dFlash and the Box2d Version Love uses but i dont think this is a Problem.
Look here for an overview: http://www.box2dflash.org/docs/2.1a/updating
Also check the sample and the love.physics module source.
I wrapped all function that Love has but some functions require different parameter.
If you have problems just ask me over irc.
Also i did not a lot of testing so i am looking forward to some bug-reports from you.

The sample is not really impressive but i wanted to keep it simple and I am never used Box2d before.
So if you feel bored and want to make a nicer one feel free to do so, I will include it.

Have fun!
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: Try Love in your Browser

Post by snake »

Hey just wanted to ask if there i an interest in better documentation or somebody wants a certain feature or bug fixed.
I need some input to get motivation to keep working on this.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests