examples.love

Showcase your libraries, tools and other projects that help your fellow love users.
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: examples.love

Post by monolifed »

I got the wheel working with viewer
I might try to add love2d reference but probably not a good idea
Edit: I noticed that the animation example is flickering and the sample image is too small
Edit: animation example could have been simpler

Code: Select all

function love.load()
	image = love.graphics.newImage("assets/anim-boogie.png")
	local sw, sh = image:getDimensions()
	frames = {
		love.graphics.newQuad( 0,  0, 32, 32, sw, sh),
		love.graphics.newQuad(32,  0, 32, 32, sw, sh),
		love.graphics.newQuad(64,  0, 32, 32, sw, sh),
		love.graphics.newQuad( 0, 32, 32, 32, sw, sh),
		love.graphics.newQuad(32, 32, 32, 32, sw, sh),
		love.graphics.newQuad(64, 32, 32, 32, sw, sh)
	}
	frameindex = 1
	time = 0
end

function love.draw()
	love.graphics.draw(image, frames[frameindex], 100, 100)
end

function love.update(dt)
	time = time + dt
	frameindex = math.floor(time * 10) % #frames + 1
end
I think some of the examples could be pushed downwards and simpler versions of those can be added
Megadardery
Prole
Posts: 7
Joined: Sun Feb 07, 2016 12:45 pm

Re: examples.love

Post by Megadardery »

I think we should add two versions of the animation, one simple like yours, and one complicated using AnAL. I have an idea for the complicated one that could be extremely helpful for people seeking help, that is an idle animation that can be changed into a jump animation if the player actually jumps. That would need an additional example of how to implement basic jump in the first place, but oh well.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: examples.love

Post by bobbyjones »

probably should use anim8. AnAL is outdated I don't even understand how people are still using it.
User avatar
tuupakku
Prole
Posts: 21
Joined: Fri Feb 12, 2016 12:12 pm

Re: examples.love

Post by tuupakku »

Thanks for the update.

By the way in example 0015 (Rotating images) line 10 should probably be rewritten to something along the lines of:

Code: Select all

angle = (angle + dt) % (2 * math.pi)
to avoid those infinitely growing numbers.

Also isn't this example very weirdly named? You would think it's an example of a sprite rotating in place, but it's actually just circular motion.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: examples.love

Post by rmcode »

Maybe we should also have a thread about the org here on the forums. It probably makes sense to also add the love-api and the awesome-löve list to the organisation?
User avatar
Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: examples.love

Post by Jack5500 »

rmcode wrote:Maybe we should also have a thread about the org here on the forums. It probably makes sense to also add the love-api and the awesome-löve list to the organisation?
I think that's a great idea.
I added the awesome list. Could you add your love-api repo?
Last edited by Jack5500 on Fri Feb 12, 2016 3:37 pm, edited 1 time in total.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: examples.love

Post by rmcode »

Done :)
User avatar
Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: examples.love

Post by Jack5500 »

:3 Great
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: examples.love

Post by monolifed »

I wonder if it is possible to make the examples android compatible without polluting them with checks.
alissona2
Prole
Posts: 1
Joined: Mon May 27, 2013 8:15 pm

Re: examples.love

Post by alissona2 »

ingsoc451 wrote:At least it doesn't loop

You can add

Code: Select all

function love.keypressed(k)
    if k == "escape" then video:pause() end
end
in fact it can loop, but not natively ... did an alternative code for that:

Code: Select all

if vid:isPlaying() == false then --loop
	vid:pause()
	vid:rewind()
	vid:play()
end
Post Reply

Who is online

Users browsing this forum: darkfrei and 232 guests