Physics + sprite image

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Chatalov
Prole
Posts: 1
Joined: Fri Jun 06, 2014 4:15 pm

Physics + sprite image

Post by Chatalov »

Hello everyone I am new to the forum,
I wonder how I can assign to a physical character that is an image sprite.

When I create a character that is how I do:

sprite = love.graphics.newImage "sprite.png"

and then I atribo movement to it from the image:

quads = {
down = {
Quad (0, 0, 32, 48, 128, 192);
Quad (32, 0, 32, 48, 128, 192);
Quad (64, 0, 32, 48, 128, 192);
Quad (96, 0, 32, 48, 128, 192);
};
{left =
Quad (0, 48, 32, 48, 128, 192);
Quad (32, 48, 32, 48, 128, 192);
Quad (64, 48, 32, 48, 128, 192);
Quad (96, 48, 32, 48, 128, 192);
};
{right =
Quad (0, 96, 32, 48, 128, 192);
Quad (32, 96, 32, 48, 128, 192);
Quad (64, 96, 32, 48, 128, 192);
Quad (96, 96, 32, 48, 128, 192);
};
up = {
Quad (0, 144, 32, 48, 128, 192);
Quad (32, 144, 32, 48, 128, 192);
Quad (64, 144, 32, 48, 128, 192);
Quad (96, 144, 32, 48, 128, 192);
};
}

I wonder how I can assign no physical this image sprite
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Physics + sprite image

Post by Ranguna259 »

[wiki]love.physics[/wiki] and lot's of other lib which I can't remember right now, just search on the forum..
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
Post Reply

Who is online

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