Lua 2d game engine.

Lua 2d game engine.

Post just about everything that isn't directly related to Spring here!

Moderator: Moderators

Post Reply
User avatar
smoke_th
Posts: 140
Joined: 25 May 2010, 13:15

Lua 2d game engine.

Post by smoke_th »

Just learned how to program widgets in spring? 8) Wanna make something interesting with spring-lua simmiliar syntax? :P Or just tired making gadgets/widgets only for spring :? and wanna make something different relayed to game making? :-) Introducing LÖVE. :mrgreen:
http://love2d.org/

Well guys, i'm sorry for so Shop-on-the-couch starting of topic but seriously :D this engine can give you some advantage in lua, and can help you make some games.
Only minor problem i seen comparing with spring....*sigh* Again in game maker style there is Y axis going from top to bottom.

Code: Select all

        |
        |
--------|-------->x
        |          
        |
        V
        Y
This feature dissapoints your brain again just after you re-learned it from using spring widget work-around stuff.
Anyway its great engine that's running smoothly - graphic's moving doesn't looks like stiffy, there is very adequate fps (210~ or so even with loads of particle systems), good, simple system of programing and speed debugging of your code.

Uh, there is small example of program that loads image of cookie and when lmb pressed cookie follows mousecursor

main.lua

Code: Select all

function love.load()
   image = love.graphics.newImage("cake.png")
   love.graphics.setBackgroundColor(255,255,255)
   cakex=15
   cakey=15
   correctx=50
   moving=false
end
function love.update(dt)
	if moving==true then
		cakex=love.mouse.getX( )-correctx
		cakey=love.mouse.getY()-50
		end
end
function love.mousepressed(x, y, button)
   if button == 'l' then
	moving=true
   end
end
function love.mousereleased(x, y, button)
   if button == 'l' then
	moving=false
   end
end

function love.keypressed(key, unicode)
if key == 'a' then
    correctx=correctx+1
end
if key == 's' then
	correctx=correctx-1
end
end
function love.draw()
	love.graphics.draw(image, cakex, cakey)
end
Nothing difficult at all. LÖVE also haves this type of license
http://www.opensource.org/licenses/zlib-license.php
which grants permission to makin' money from it.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Lua 2d game engine.

Post by Regret »

Excellent engine is excellent. :regret:
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Lua 2d game engine.

Post by Google_Frog »

Looks very nice.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Lua 2d game engine.

Post by KDR_11k »

Is it a better choice than PyGame? After all Python is a lot more verbose with errors.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua 2d game engine.

Post by knorke »

larf oh larf.
are you tthe one who mentioned this in the springlobby last week?
i think i didnt really get it at the time.
Now i tried and so i see.

such a beutiful song.
for anybody who wants to try:
basically you have this love.exe and write your program code in a main.lua. then you zip it will all your used .bmp and .wav files or whatever and rename it to mycoolgame.love
to run them you just make a shortcut like love.exe mycoolgame.love or a .bat file use drag&drop or whatever.

things that are cool:
*easy to make games
*none of these "omg my 2d graphics flicker with 5 fps", "how can i make it possible to press more than one button at once" problems
*rigid body physic. didnt use really use but i think that might be fun to play around with...
*if there is an error in a function it also shows where the function was called from

things that suck: :x
*(using notepad++) no code completion thing like when you type graphics.circle ( you can not see possible parameters
*mistype a variable name, get annoying nil value errors
*couldnt get sound to work

ok now for the intere-
I AM ANCOCNUNIG MAH GAME!
so i made an Asteroids clone.
I AM ANCOCNUNIG MAH GAME!
Like every good asteroids game you can reach infinite speed by going through the screen sides again and again going faster and faaaaaaaaaaaster.
I AM ANCOCNUNIG MAH GAME!
Instead of the usual zero you start with 100 points because I larf you.

still dont know know synthax the of a "for loop." or this table stuff. So yeah. Not much knowledge required, the only limit is your imagination! :shock: :shock: :shock: derp derp

:arrow: :arrow: :arrow: :!: this is what making lovelooks like: http://www.youtube.com/watch?v=aTF9eZmlgJM :?: :?: :oops:
evil forum wrote:The extension .love is not allowed.
WHAAAAAAAAAAAAAAAAAAAAAAAT?
oh, never mind it works with .zip too. if not rename to dfgsdfg.love
Attachments
TOLL.zip
i just love this game.
(14.48 KiB) Downloaded 44 times
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Lua 2d game engine.

Post by KaiserJ »

cool; looks like flash code. i understand all of it; which is surprising
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua 2d game engine.

Post by knorke »

hm flash would be cool too.
because online people actually play these kind of 2d games. nobody downloads such games anymore. But there is no free flash editor/action script (thats what it is called?) compiler or is there?
Again in game maker style there is Y axis going from top to bottom.
I think I saw something that lets you rotate the coordinate system :)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lua 2d game engine.

Post by aegis »

knorke wrote:free flash editor/action script (thats what it is called?) compiler or is there?
flex.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Lua 2d game engine.

Post by CarRepairer »

aegis wrote:
knorke wrote:free flash editor/action script (thats what it is called?) compiler or is there?
flex.
Yeah but what about keyframe editor and all that other stuff you need.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Lua 2d game engine.

Post by Regret »

I have traveled back in time and registered on their forum.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua 2d game engine.

Post by knorke »

aegis wrote:
knorke wrote:free flash editor/action script (thats what it is called?) compiler or is there?
flex.
There is Flex 2, Flex 3 and a ton of adobe stuff. What exactly do i need? It seems more like a webpageeditor from the homepage...
I want to make games mostly just using basic drawing functions like lines, circles etc. The programs should run in a browser, like as .swf or something.
I think keyframe editors are more for that flash movies like spoonguard, charlie goes to candy mountain etc? So dont need those.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lua 2d game engine.

Post by aegis »

yeah I do most of my flash work with actionscript. it's cleaner, more flexible, and more powerful than using the flash ide for animations/etc
Post Reply

Return to “Off Topic Discussion”