Hey,
I have couple files in my project.
In my movement.lua file I have 1 love.update funtion.
And I need one in main.lua file. but it does't work.
What should I do ?
Thanks
Can't we use multiple love.update() ?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Can't we use multiple love.update() ?
You must pay for your crimes against the earth.
Re: Can't we use multiple love.update() ?
You should keep the one in main.lua and rename the one in movement.lua (like movement.update(dt)) and call it during love.update
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Re: Can't we use multiple love.update() ?
This is the code like in my main.lua
in my movement.lua file, there is not only love.update funtion.
I changed it like
to
it is not working
Code: Select all
function love.update()
require 'movement' --Chracter Movement and Skinning Module
if love.keyboard.isDown("x") then
text = "Öp Örli Teknonoji Demosu"
else
text = "v.0000000.0.00.001.a"
end
end
I changed it like
Code: Select all
function love.update()
love.graphics.setBackgroundColor(255,255,255)
medium = love.graphics.newFont(20)
x = 10;
y = 10;
katsayi = 0.5;
Code: Select all
function movement.update()
love.graphics.setBackgroundColor(255,255,255)
medium = love.graphics.newFont(20)
x = 10;
y = 10;
katsayi = 0.5;
You must pay for your crimes against the earth.
Re: Can't we use multiple love.update() ?
Not trying to be sarcastic or rude, but, why do you think it's not working?semihmasat wrote:it is not working
(Hint: Are you calling the function movement.update() somewhere?)
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Re: Can't we use multiple love.update() ?
I am getting this error.
and no, I am not using movement.update() elsewhere.
and no, I am not using movement.update() elsewhere.
You must pay for your crimes against the earth.
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Re: Can't we use multiple love.update() ?
When I change the movement.update(dt) to love.update(dt) , codes on movement.lua's love.update started to work.But now main.lua codes.
I just have to move codes then.
I just have to move codes then.
You must pay for your crimes against the earth.
Re: Can't we use multiple love.update() ?
It would have worked the same if you just called movement.update() from love.update() (that's what I was trying you to realize).
No offense, but you clearly need to learn more about programming and about Lua before starting a complex project like a videogame. If you have this kind of problems now, I highly doubt you'll finish a game. Or if you do, most likely you won't understand what your code is about. Please don't get this as an insult.
No offense, but you clearly need to learn more about programming and about Lua before starting a complex project like a videogame. If you have this kind of problems now, I highly doubt you'll finish a game. Or if you do, most likely you won't understand what your code is about. Please don't get this as an insult.
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Re: Can't we use multiple love.update() ?
you are right.
actually I am learning on this time actually. this is my test and learning project.
actually I am learning on this time actually. this is my test and learning project.
You must pay for your crimes against the earth.
- semihmasat
- Prole
- Posts: 27
- Joined: Sun Mar 04, 2012 2:38 am
Re: Can't we use multiple love.update() ?
oh god : movement = {}
You must pay for your crimes against the earth.
Re: Can't we use multiple love.update() ?
I've been there, and I'd like to save you the time I didn't save. I was stubborn and continued trying to program a game, but I wasn't watching the big picture, the high amount of knowledge and work a videogame may need (unless you're thinking of a Pong and you use HardonCollider).semihmasat wrote:you are right.
actually I am learning on this time actually. this is my test and learning project.
My suggestion is: be patient. Keep on learning programming (you know, defining and calling a function is very very very BASIC stuff). Study the available Löve examples and tutorials. Read a book about Lua. Program stuff with different languages (not because I don't think Lua is good enough, but just to learn programming without sticking to a single language).
Imagine Löve was an instrument. You wouldn't expect to write a great song or play a great solo when you're just starting with it, right? Then you shouldn't expect to program a videogame if you don't know the basics
Who is online
Users browsing this forum: Google [Bot] and 9 guests