Newbie here gonna start out small

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.
mrpoptart
Prole
Posts: 17
Joined: Mon Apr 25, 2011 5:31 am

Newbie here gonna start out small

Post 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.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Newbie here gonna start out small

Post 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.
mrpoptart
Prole
Posts: 17
Joined: Mon Apr 25, 2011 5:31 am

Re: Newbie here gonna start out small

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Newbie here gonna start out small

Post 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.
Help us help you: attach a .love.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Newbie here gonna start out small

Post 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?
User avatar
sharpobject
Prole
Posts: 44
Joined: Fri Mar 18, 2011 2:32 pm
Location: California

Re: Newbie here gonna start out small

Post 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.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Newbie here gonna start out small

Post 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.
mrpoptart
Prole
Posts: 17
Joined: Mon Apr 25, 2011 5:31 am

Re: Newbie here gonna start out small

Post 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.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Newbie here gonna start out small

Post 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)
mrpoptart
Prole
Posts: 17
Joined: Mon Apr 25, 2011 5:31 am

Re: Newbie here gonna start out small

Post 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
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 95 guests