Search found 131 matches

by Muris
Tue Feb 17, 2015 11:08 am
Forum: Support and Development
Topic: Nil value problem
Replies: 4
Views: 4456

Re: Nil value problem

Basically the problem is, how values are passed and how they react after being passed. For example local a = 3 local b = a + 1 a = 5 print(b) -- prints 4 So when you set the players position to mousePos, the mousePos is nil at that moment, because when you require lua-file it does everything that is...
by Muris
Tue Feb 17, 2015 9:14 am
Forum: General
Topic: Bored...
Replies: 10
Views: 5490

Re: Bored...

I think that trying to give ideas is generally not a good idea. The problem is that people have different stuff of interests, like someone might be really into driving games, others not. More likely the person that is into driving games wants to make something about driving games. If you like music,...
by Muris
Tue Feb 17, 2015 8:26 am
Forum: General
Topic: Programs to practice coding
Replies: 6
Views: 3818

Re: Programs to practice coding

I think something smart would be like thinking what kind of subsystem your project needs, then choosing a small project out of it. Like lets say I would need to program some AI, I could create another project just to fiddle around how AI should work, and later on when getting back to main project ju...
by Muris
Sat Feb 14, 2015 1:40 pm
Forum: General
Topic: Creating and Spreading LÖVE...
Replies: 2
Views: 1917

Re: Creating and Spreading LÖVE...

Sounds like perfect topic for valentines. Lövely day it is.
by Muris
Fri Feb 13, 2015 10:10 am
Forum: Support and Development
Topic: Creating multiple selectable characters
Replies: 19
Views: 6947

Re: Creating multiple selectable characters

Seems like people just answered. Something to add strings arent same as numbers: if 1 == "1" then print( "One is one") else print( "One isn't one!") end This prints: "One isn't one!", this is because they are different types. It is same as false is not nil or ...
by Muris
Fri Feb 13, 2015 9:56 am
Forum: Support and Development
Topic: [LOVEFRAMES] Buttons draw but can't be clicked, Help!
Replies: 1
Views: 1826

Re: [LOVEFRAMES] Buttons draw but can't be clicked, Help!

Are you calling loveframes mousereleased/mousepressed functions? Also if I understand the code correctly, you are creating new button on every frame? On love frames, you do not need to do that, just creating a button once then using it should be enough.
by Muris
Fri Feb 13, 2015 1:12 am
Forum: Support and Development
Topic: speech bubbles
Replies: 4
Views: 3209

Re: speech bubbles

By drawing it manually, you can create a lot more stylized bubble. The downside would be if you want to support multiple resolutions. The scaling of images might not look so good, or if you do not scale, it might become too small, if shown on somethong like mobile phone and the resolution is bigger....
by Muris
Fri Feb 13, 2015 12:54 am
Forum: General
Topic: Avoiding Singletons in Lua
Replies: 5
Views: 4622

Re: Avoiding Singletons in Lua

Locals are only valid after declaring, and a variable or function that is local on one lua file, cannot be accessed from other lua-file, except if you use function and return it. The way how I use globals or I guess its quite close to singleton is by using a table called GLOBALS, and I define it in ...
by Muris
Thu Feb 12, 2015 4:10 pm
Forum: Support and Development
Topic: Creating multiple selectable characters
Replies: 19
Views: 6947

Re: Creating multiple selectable characters

I honestly think the best way to approach this is to make a function, where you create a table with common values, then return the table and fill the rest of the values manually, basically kind of like OOP aproach. Something along the lines: local function createCharacter( o ) o = o or {} o.x = o.x ...
by Muris
Thu Feb 12, 2015 3:43 pm
Forum: Support and Development
Topic: My image is bleeding out hardly. Need an aid.
Replies: 5
Views: 4504

Re: My image is bleeding out hardly. Need an aid.

Also, if you haven't already, modify the line where you draw your image to something like this: love.graphics.draw(player.img, math.floor(player.xPos+0.5), math.floor(player.yPos+0.5) I always thought the idea is to add 0.5 offset after flooring aka love.graphics.draw(player.img, math.floor(player....