AnAL help! (oh god ._.)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

AnAL help! (oh god ._.)

Post by Miken1 »

(Jesus why do you guys need to name a library AnAL, why!)

I need a breif explaination on how the different functions works for example.

What should I do if I want to draw the second row of animations in this megaman sprite sheet


Image
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 1:54 am, edited 1 time in total.
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: AnAL help! (oh god ._.)

Post by Miken1 »

So so you recommend to make seperate sheets for each animation?
One for jumping and one for walking etc...
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 2:16 am, edited 2 times in total.
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: AnAL help! (oh god ._.)

Post by Miken1 »

Thank you for the help!
pielago
Party member
Posts: 142
Joined: Fri Jun 14, 2013 10:41 am

Re: AnAL help! (oh god ._.)

Post by pielago »

this going down

Code: Select all

function love.load()
	require 'anal'
	k={}
	k.x=15
	k.y=10
	k.w=50
	k.h=50
	k.speed=200	
	
	fF =love.graphics.newImage('f.png')	-- 4 sprites going down  120x50 f.png
	walkF=newAnimation(fF,30,50,0.1,0)
	facing ='front'
end

function love.draw()
	if facing== 'front' then
		walkF:draw(k.x,k.y)
	end
end

function love.update(dt)
	if love.keyboard.isDown("s") then
		k.y=k.y+k.speed*dt
		walkF:update(dt)
		facing ='front'
	end	
	
end

function love.keyreleased(key, unicode)           --reset it
	if key == 's' then
		walkF=newAnimation(fF,30,50,0.1,0)
		facing ='front'	
	end

end











Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 4 guests