Page 1 of 2
Newbie here gonna start out small
Posted: Mon Apr 25, 2011 5:39 am
by mrpoptart
Hello all. I am a very big newbie to Love and these forums. I have used LUA before with a game called Tibia. Use to run ot servers of tibia all the time. I have a small knowledge of LUA, but having used it before, shouldn't be that hard to pick up on.
I plan to start small by making a "defend the base game". It sounds simple in my head but i know it will get worse lmao. I have been reading the wiki, the LUA online book, and i have downloaded some games here and looked at the source code to give me an idea of what has to go on (non of your code will be used for this project, simply looked to see to how stuff worked). So i guess ill get started with some graphics and my main.lua and see how it goes.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 6:04 am
by BlackBulletIV
Welcome! Good to hear someone new is
not starting on some big epic game
.
mrpoptart wrote:non of your code will be used for this project, simply looked to see to how stuff worked
By all means, feel free to use the code we post! That is, unless there's an explicit license saying you can't, which I've never seen.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 6:37 am
by mrpoptart
Well thats great to hear. I am having some trouble making my sprites for the game. If you have an editor suggestion it would be great. Thanks for your support and i hope i can make this game and then start on something more in depth.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 7:02 am
by Robin
BlackBulletIV wrote:mrpoptart wrote:non of your code will be used for this project, simply looked to see to how stuff worked
By all means, feel free to use the code we post! That is, unless there's an explicit license saying you can't, which I've never seen.
"Use" the code as in "look at" is not a problem, of course.
Before you copy parts of the source code of random games here, take a good look at the license. It may conflict with other licenses or with what you want to do. Also remember: games without a license are subject to full copyright. Luckily, most of the useful code around here is open source.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 8:16 am
by BlackBulletIV
Nah I was meaning the real "use", as in put in your game. One thing I did forget though, is conflicting licenses, not just licenses saying "look, but don't touch."
Robin wrote:Also remember: games without a license are subject to full copyright. Luckily, most of the useful code around here is open source.
Oh really? Didn't know that. What about the code snippets we post? It'd be public domain unless otherwise stated I'm guessing?
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 8:26 am
by sharpobject
BlackBulletIV wrote:Oh really? Didn't know that. What about the code snippets we post? It'd be public domain unless otherwise stated I'm guessing?
Nope. I doubt anyone will have a problem as a result, though.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 8:28 am
by nevon
BlackBulletIV wrote:Nah I was meaning the real "use", as in put in your game. One thing I did forget though, is conflicting licenses, not just licenses saying "look, but don't touch."
Robin wrote:Also remember: games without a license are subject to full copyright. Luckily, most of the useful code around here is open source.
Oh really? Didn't know that. What about the code snippets we post? It'd be public domain unless otherwise stated I'm guessing?
Depends. See
Threshold of Originality. In general though, no, just because you post something on the interwebs, that doesn't mean it automagically becomes public domain.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 8:52 am
by mrpoptart
Hello again all. Having some trouble again, of course. I need help with a few things, but ill ask 1 for now.
How do i set a background picture to be the background in a love game.
For example, i would like to replace the plain black screen when you test your game, to my background image so i can see how everything lines up together.
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 9:06 am
by nevon
mrpoptart wrote:Hello again all. Having some trouble again, of course. I need help with a few things, but ill ask 1 for now.
How do i set a background picture to be the background in a love game.
For example, i would like to replace the plain black screen when you test your game, to my background image so i can see how everything lines up together.
Just initialize the image (
love.graphics.newImage) and then draw it at (0, 0) (
love.graphics.draw)
Re: Newbie here gonna start out small
Posted: Mon Apr 25, 2011 9:14 am
by mrpoptart
Thank you nevon. It worked like a charm. But now my tank will now move in the image at all. here is my code, can you help me see what is wrong?
Code: Select all
function love.load()
tank = love.graphics.newImage("tank.png")
x = 500
y = 500
speed = 100 ;
background = love.graphics.newImage("background.png")
x = 0
y = 0
speed = 0
end
function love.update(dt)
if love.keyboard.isDown("right") then
x = x + (speed * dt)
elseif love.keyboard.isDown("left") then
x = x - (speed * dt)
end
if love.keyboard.isDown( "escape" ) then
love.event.push( "q" )
end
end
function love.draw()
love.graphics.draw(background, x, y)
love.graphics.draw(tank, x, y)
end