Is it too late to ask too contribute?
Is it too late to ask too contribute?
Whoops, forgot this thing was happening. Here's the latest build.
Perhaps you could link to the 0.8.0 download page?
The newest downloads and media aren't working... :/
It's okay guys I fixed the turbo boost bug. I was unawares of love 0.8.0 I guess I'll upgrade or some shit. I'm trying to make it so you can add codeable objects to the map but my lua is not really up to scratch so I'm tearing my eyes out. Also, fucking code man - what is up with this whole rename the library shit. Is that a standard practice in lua? I hope not. Also do all arrays start at 1 in lua, or is it just that guys explode function? I'm so confused at this code sometimes I just like fucking write something I think should work and cross my fingers.
Kind of a stupid thing to do in a group project.
Okay so now I have to check it out.
_g = love.graphics function love.load() local t = love.timer.getMicroTime() for i=1, 10000 do love.graphics.point(0, 0) end print(love.timer.getMicroTime() - t) t = love.timer.getMicroTime() for i=1, 10000 do _g.point(0, 0) end print(love.timer.getMicroTime() - t) end
Result of 3 executions:
Well it seems like it -does- matter, only a tiny bit.. Anyway I'm still keeping it as less to type.Code:0.0018206217901025 0.001087894605007 0.0016644974093651 0.0011979902883468 0.0016570332954871 0.0012480620498536
Also, here's the result of having local _g:
Local doesn't matter.Code:0.0016707175018382 0.0011233491495659 0.0016887557758309 0.0010123204519914 0.0015503586655541 0.0010533730783209
You have one less table lookup doing that so obviously it's faster, though you have absolutely no reason to define it as a global.
Then you might as well use love.graphics. If you're gonna make shortcuts to globals at the top of your file they should be locals, it's just good practice.
You shouldn't use single letter variable names. It looks messy as fuck and has no advantage over normal variable names. You should use an editor with auto-complete if you can't be bothered to type it out.
Micro-optimizations like that are also pretty much useless. Yeah, it might run even a couple of microseconds faster, but would anyone even notice that? All that they do in the end is just clutter up the code.
Sorry if I came out as rude - wasn't my intention.
I suggest reading these and becoming familiar with the Lua syntax and naming conventions.
Being a good coder means knowing these naming conventions. Programming in Lua is also a really good read and important to know as a Lua coder. Lua isn't a hard language to know and understand, but it takes time to learn and remember common conventions and practices. This is pretty important for all languages.
I'm not going to enforce this in this event, but don't be an asshole and write terrible code for others to fix. Nobody wants to spend their 24 hours with the code fixing shit you did wrong.
Note: I am not taking minecraft into consideration here. Minecraft's code is god awful and the game, in a technical standpoint, is terrible.
For example, look at Notch. He is a bad programmer. Why? He knows computer science and understands common practices. A lot of his code is efficient and runs fast. Whats wrong with that? He doesn't know variable naming conventions. Here's an example of code in Catacomb Snatch (a game he made in a weekend for the Mojam):
What the fuck does that mean? We have no clue what xx or yy is or holds. A better name for these could be deltaX and deltaY.Code:int xy = xx*yy;
For me, programming is about having fun but also writing good code that I can show off. I want to know how to write good code and be persistant about writing good code. If this is going to be my career I want to be damn good at it.
What if you need help and you need to show your code? Or what if you decide that you do want to release it open source? Why make it hard on others(or yourself, if you end up changing it later)?
I've kinda run out of time and motivation for the day after a really busy day so I've kinda implemented some really cool stuff for the future to allow for objects in the game to interact with but at the same time have left them half complete. I'll see if I can gain any energy to finish them a little more, but I guess the future people will just need to hack on top of what I've done.
I know we already went over this whole _g thing, but for those who are still curious about optimizing Lua, This is actually pretty good.
Code:for i = 1, 1000000 do local x = math.sin(i) end runs 30% slower than this one: local sin = math.sin for i = 1, 1000000 do local x = sin(i) end
And open it with WinRAR:
Now this is a "compiled" LOVE game, including needed dll's. The .exe has been made by copying the .love file to the love.exe.
Now let's open that one with WinRAR.
There you have it, all source files are visible. That's the disadvantage of LOVE, it doesn't get compiled. So it's easier to (for example) upload fake scores to an online scoreboard, which means more people are gonna do such stuff. Now this is just an example, but there are many people who just don't want others to (easly) read their source. I'm one of those.
Private projects are ones that you don't give to anyone.
In any case, obfuscation should be something that happens later, not something you do while you write the thing.
Can you really not see how it's a bad thing to do?
Screw "personal projects". It's not called a habit for no reason.
In any case, using short variable names is to obfuscation what ROT13 is to cryptography.
A couple of minutes with global find/replace and your code is fully readable.
Write it cleanly and then destroy it with things like multiple variable redefinition, abstract stacks and befunged tables.