Search found 49 matches
- Mon Feb 02, 2015 7:08 pm
- Forum: Support and Development
- Topic: [SOLVED] Pong | Ball getting stuck inside game window
- Replies: 2
- Views: 1559
[SOLVED] Pong | Ball getting stuck inside game window
In my Pong game, the ball is getting stuck inside my game window, as well as the paddle seemingly at random. Here's a video where it happens at around 10 seconds: http://a.pomf.se/dztwne.webm In the bounce before it does the major screw up, you can see it glitch slightly and then the next bounce rea...
- Thu Jan 22, 2015 5:58 am
- Forum: Support and Development
- Topic: Love 0.9.1 returning a "no game" error
- Replies: 7
- Views: 3810
Re: Love 0.9.1 returning a "no game" error
I think he's saying that there's no background color to get so he's trying to set it instead of get it.Positive07 wrote:Actually:Doctory wrote:there is no getBackgroundColor so this is what i assumed you want
[wiki]love.graphics.getBackgroundColor[/wiki]
- Mon Dec 29, 2014 6:29 am
- Forum: Support and Development
- Topic: Simple Coding Question...
- Replies: 8
- Views: 6095
Re: Simple Coding Question...
I'm not sure of what you're asking really but you can simplify the drawing calls by doing this instead: love.graphics.print("IP: " ..ip.. " Name: " ..name.. " Red: " ..r.. " Green: " ..g.. " Blue: " ..b, 10, 10) Or separate lines: love.graphics.print...
- Mon Dec 08, 2014 12:26 am
- Forum: Support and Development
- Topic: Trouble understanding classes
- Replies: 15
- Views: 10235
Re: Trouble understanding classes
Yeah I really don't understand this at all. I think I'll just try and avoid using classes. Unless using a library will help me understand it more than from coding it from scratch. Idk. Lua is the first language that I'm learning and I feel like if I were to switch languages to try and learn somethin...
- Sun Dec 07, 2014 7:03 am
- Forum: Support and Development
- Topic: Trouble understanding classes
- Replies: 15
- Views: 10235
Re: Trouble understanding classes
When it comes to OO I prefer to use a slightly lower-level approach instead of libraries: Object = {} ObjectMT = { __index = Object } function Object:create(x, y, mt) local self = {} setmetatable(self, mt or ObjectMT) self.x = x self.y = y return self end function Object:destroy(self) self.x = nil ...
- Mon Dec 01, 2014 1:42 am
- Forum: Support and Development
- Topic: [Solved] Using local variables correctly?
- Replies: 5
- Views: 4128
Re: Using local variables correctly?
Ohhh. Okay. Thank you for your help!iggyvolz wrote:Yes, what you're doing is completely correct.
What I meant with the _G stuff is that anything you define as a "global" will automatically be put into the _G table for you.
- Mon Dec 01, 2014 1:37 am
- Forum: Support and Development
- Topic: [Solved] Using local variables correctly?
- Replies: 5
- Views: 4128
Re: Using local variables correctly?
So what I've been doing is correct? Declaring locals at the top of my files? Also, what does that line with the table mean? Any local variables can be used in tables as long as I define which table I want the local variable to be used in?
- Mon Dec 01, 2014 1:09 am
- Forum: Support and Development
- Topic: [Solved] Using local variables correctly?
- Replies: 5
- Views: 4128
[Solved] Using local variables correctly?
If I use local variables by just placing them at the top of my file like this: local number = 0 local vision = true function love.load() end ..blah blah... Is that even using local vars right? I'm not entirely sure what the point of them is. I read that they were faster than globals, so I started pu...
- Thu Nov 27, 2014 9:27 am
- Forum: Support and Development
- Topic: Trouble understanding classes
- Replies: 15
- Views: 10235
Re: Trouble understanding classes
This is the complete code player = {} player.__index = player function player:getX() return self.x end function player:getY() return self.y end function player:setX(x) self.x = x end function player:setY(y) self.y = y end function player.New(x, y) local p = setmetatable({}, player) p:setX(x) p:setY(...
- Thu Nov 27, 2014 8:10 am
- Forum: Support and Development
- Topic: Trouble understanding classes
- Replies: 15
- Views: 10235
Re: Trouble understanding classes
stuff Using this method, how would I create independent movement for each player? This is throwing me an error function player:Update(dt) if love.keyboard.isDown("d") then player1:setX() = player1:setX() + 10 end end I'm assuming it's because I'm calling the functions, but surely there's ...