Some questions

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
PedroChurro
Prole
Posts: 25
Joined: Tue Oct 09, 2012 8:22 pm
Location: In my room

Some questions

Post by PedroChurro » Fri Oct 12, 2012 10:33 pm

So, I thought, I have so many questions, and I really don't want to spam the forums, so, can I post the questions I have on this topic? It would be really useful.

Here are some questions to start:

1: So, I'm already trying to make a game, and I'm currently doing the menu. But there is one problem, I have a background I want to use for the menu, but when I use it, it covers up the buttons(Start, quit, etc.). How can I change that?

2:How can I make my character to jump, and do a small animation when walking?

3:The tutorials I followed didn't cover how to make text with a custom font. What's the code for that?

Sorry for being such a noob.
Last edited by PedroChurro on Fri Oct 12, 2012 10:51 pm, edited 1 time in total.
I try to make games.

User avatar
paritybit
Citizen
Posts: 53
Joined: Thu Sep 06, 2012 3:52 am

Re: Some questions

Post by paritybit » Fri Oct 12, 2012 10:44 pm

Drawing order matters. What you draw last is on top. So, you want to draw the background first and the buttons last.

Animations are a more difficult subject, since you're new to this you probably want to use an existing library like anim8. But the very basics are that you want to have a bunch of images that are played in sequence so that it looks like your character is doing some action.

User avatar
PedroChurro
Prole
Posts: 25
Joined: Tue Oct 09, 2012 8:22 pm
Location: In my room

Re: Some questions

Post by PedroChurro » Fri Oct 12, 2012 10:49 pm

paritybit wrote:Drawing order matters. What you draw last is on top. So, you want to draw the background first and the buttons last.

Animations are a more difficult subject, since you're new to this you probably want to use an existing library like anim8. But the very basics are that you want to have a bunch of images that are played in sequence so that it looks like your character is doing some action.
Thanks, and also, yes, that is what I was planning to do, "have a bunch of images that are playing in sequence". But I don't know how to code that.
I try to make games.

User avatar
paritybit
Citizen
Posts: 53
Joined: Thu Sep 06, 2012 3:52 am

Re: Some questions

Post by paritybit » Fri Oct 12, 2012 10:58 pm

PedroChurro wrote:But I don't know how to code that.
Take a look at anim8 (linked in the original response); it's a library for doing that and the tutorials will probably help.

User avatar
Nsmurf
Party member
Posts: 191
Joined: Fri Jul 27, 2012 1:58 am
Location: West coast.

Re: Some questions

Post by Nsmurf » Sat Oct 13, 2012 2:46 am

This might be a bit hard for a beginner, but for a simple animation system, you could do something like this:

Code: Select all

anm = {love.graphics.newImage('lol1.png'), love.graphics.newImage('lol2.png')}
anmon = 1

function love.update(dt)

if anmon < table.getn(anm) then
    anmon = anmon + 1*dt
else
    anmon = 1
end

end

function love.draw()
    love.graphics.draw(anm[round(anmon)])
end

function round(n, deci) deci = 10^(deci or 0) return math.floor(n*deci+.5)/deci end
However, I DO NOT suggest that you use this. To start off with, I would suggest that you use something like anim8, or the newly created MASH.

See this tutorial for fonts.

It's a bit confuzzling, and probably to complex for what you want, but you could use this for drawing order.

Good luck with your game :awesome:
OBEY!!!
My Blog
UE0gbWUgd2l0aCB0aGUgd29yZCAnSE1TRycgYXMgdGhlIHN1YmplY3Q=

User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Some questions

Post by substitute541 » Sat Oct 13, 2012 6:41 am

Answer no. 1 : Drawing order matters. What's at the bottom goes at the front of everything else.
Answer no. 2 : Either try ready-made libraries, or just look at the wiki
Answer no. 3 : https://love2d.org/wiki/love.font
Currently designing themes for WordPress.

Sometimes lurks around the forum.

User avatar
PedroChurro
Prole
Posts: 25
Joined: Tue Oct 09, 2012 8:22 pm
Location: In my room

Re: Some questions

Post by PedroChurro » Sat Oct 13, 2012 2:01 pm

Thanks, I think I'll try anim8.
I try to make games.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], MrFariator and 29 guests