Page 1 of 1

Gravity problems

Posted: Sat May 25, 2013 7:40 pm
by roggie12
I'm having trouble with gravity. I know how to do character movement (Moving left, right, up, down) but i don't understand the gravity part. I'm making a game with my friends from school and i'm only starting with Love2d. I'm finding it hard to understand most of the stuff. I don't know if it's that the tutorials are really complexed or if i'm just not cut out to be making games but i'm gonna try my best ;) .I'm just learning from video tutorials on YouTube but i don't understand gravity and physics so any help will be much appreciated.

Thank you in advance

Here's the code that i have so far:

Code: Select all

function love.load()
stuff = love.graphics.newImage("textures/enemy1.png")
x=10
y=1
end
function love.update(dt)
if love.keyboard.isDown("up") then
y = y - 1
elseif love.keyboard.isDown("down") then
y = y + 1
elseif love.keyboard.isDown("left") then
x = x - 1
elseif love.keyboard.isDown("right") then
 x= x + 1
end
end
function love.draw()
love.graphics.draw(stuff, x, y)
end
This code just makes the pic move it's not animated or anything.sorry i had to delete the love2d file another one will be uploaded soon :)

Re: Gravity problems

Posted: Sat May 25, 2013 8:22 pm
by Robin
... did you just make three topics about the same thing?

Re: Gravity problems

Posted: Sat May 25, 2013 8:25 pm
by roggie12
Sorry. I thought that they didn't post properly so i made them again they didn't show up in my 'View your posts' option. Im really new to this. I also didn't know how to edit topics til just now

Re: Gravity problems

Posted: Sat May 25, 2013 8:51 pm
by Robin
Because of spam, new members have to have their first post approved before they can post freely. You're not the first that didn't see their post and tried again.

Re: Gravity problems

Posted: Sun May 26, 2013 10:13 am
by micha
Try this tutorial. It covers gravity:
Platform game tutorial

Re: Gravity problems

Posted: Sun May 26, 2013 12:36 pm
by roggie12
thank you