Search found 56 matches

by EmmanuelOga
Tue Mar 15, 2011 3:04 pm
Forum: Support and Development
Topic: Problems With Central Scaling [SOLVED]
Replies: 7
Views: 926

Re: Problems With Central Scaling

Here are some helpers I've been using: local LG = love.graphics local scaleAround = function(x, y, scale) if scale and scale ~= 1 then LG.translate(x, y) LG.scale(scale) LG.translate(-x, -y) end end local rotateAround = function(x, y, angle) if angle and angle ~= 0 then LG.translate(x, y) LG.rotate(...
by EmmanuelOga
Tue Mar 15, 2011 2:00 am
Forum: Games and Creations
Topic: An obscure arcade remake
Replies: 12
Views: 5531

Re: An obscure arcade remake

I spent some time trying to figure out what to do, I picked up that barrely thingie and went around trying to find out the point where everything starts to get distorted. Is that the objective of the game? I'm not sure how to win (or lose). Very cool graphic style!, but unclear objectives. EDIT: ha,...
by EmmanuelOga
Mon Mar 14, 2011 7:37 pm
Forum: Support and Development
Topic: Problem with In-Game Zooming [SOLVED]
Replies: 2
Views: 414

Re: Problem with In-Game Zooming

The reason is that love.graphics.scale operates in the current scale. So if you first scaled everything up 2x, then you'll need to scale down 0.5 to get back to normal. An even better method is pushing and popping the scale/translation settings. Something like: love.graphics.push() -- saves current ...
by EmmanuelOga
Sun Mar 13, 2011 11:57 pm
Forum: Support and Development
Topic: Problem overriding love.graphics.print
Replies: 11
Views: 1900

Re: Problem overriding love.graphics.print

This is way it does not work: https://bitbucket.org/rude/love/src/13f004d1baff/src/scripts/graphics.lua#cl-1268 Try: love.graphics.oldPrint = love.graphics.print1 function love.graphics.print1(...) love.graphics.scale(2, 2) love.graphics.oldPrint(...) end function love.draw() love.graphics.print("Ha...
by EmmanuelOga
Sun Mar 13, 2011 11:08 pm
Forum: General
Topic: prototype modeling as an alternative to OOP
Replies: 10
Views: 1412

Re: prototype modeling as an alternative to OOP

I agree it is more verbose than it could. I guess it could be trimmed easily at least 50%, and then with a little more work another 25% :). If you absolutely can't stand read it, then just look at this short quote: Imagine you're listening to announcers commenting on an NFL (American football) game....
by EmmanuelOga
Sun Mar 13, 2011 3:12 am
Forum: General
Topic: prototype modeling as an alternative to OOP
Replies: 10
Views: 1412

prototype modeling as an alternative to OOP

Hi, I see from time to time in these forums posts about OOP implementations for lua. I wanted to share this article which I found very interesting in this regard: http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html In the article the author explains prototypical modeling as an alte...
by EmmanuelOga
Fri Mar 11, 2011 5:13 pm
Forum: Libraries and Tools
Topic: ClosureClass
Replies: 18
Views: 1854

Re: ClosureClass

How come you limited you functions to the local scope, just interested thats all :) Because otherwise they'd be global, rather than encapsulated into an object. Right, top-level local functions inside a given file are useful to keep those functions local to the scope of that file. If you want to sh...
by EmmanuelOga
Fri Mar 11, 2011 3:40 pm
Forum: Libraries and Tools
Topic: ClosureClass
Replies: 18
Views: 1854

Re: ClosureClass

Hey, thanks for sharing this. In my case I like to use closures for building objects in a more raw style.You don't really need full blown classes while working with a prototypical language like lua. The two guidelines I follow are: * Choose composition over inheritance * Does that really need to be ...
by EmmanuelOga
Thu Mar 10, 2011 12:06 am
Forum: General
Topic: Learning LOVE the most efficient way
Replies: 10
Views: 1520

Re: Learning LOVE the most efficient way

[*] Use prototype based programming like JavaScript does (feels most natural in lua), or [*] ditch OO and program in some other style, e.g. functional.[/list] The style of OOP I enjoy the most using lua (and hence recommend) is outlined here: http://lua-users.org/wiki/ObjectOrientationClosureApproa...
by EmmanuelOga
Wed Mar 09, 2011 4:33 pm
Forum: Support and Development
Topic: Alternative to spritesheets for large animations?
Replies: 5
Views: 881

Re: Alternative to Spritesheets?

http://i.imgur.com/xCxqg.gif I use ANaL for most of my animations, but I have a whole batch of images I'd rather not have to make massive sprite sheets for (like above). What's the problem with massive sprite sheets? Do you create those by hand? If you automate the sheet creation it should be ok (d...