Search found 248 matches

by arampl
Fri Mar 13, 2015 11:40 pm
Forum: Support and Development
Topic: How do I remove drawn images & printed text?
Replies: 21
Views: 8608

Re: How do I remove drawn images & printed text?

You can't draw anything outside of love.draw()

Code can look like this:

Code: Select all

curr = 1

function love.draw()
love.graphics.draw(backgrounds[curr])
end

function love.keypressed(key)
if key == "q" then
curr = 2
else
by arampl
Fri Mar 13, 2015 6:23 am
Forum: Support and Development
Topic: table.remove wont "Remove" table
Replies: 21
Views: 11618

Re: table.remove wont "Remove" table

I am
sorry.jpg
sorry.jpg (67.24 KiB) Viewed 1279 times
by arampl
Fri Mar 13, 2015 2:45 am
Forum: Support and Development
Topic: table.remove wont "Remove" table
Replies: 21
Views: 11618

Re: table.remove wont "Remove" table

Guys, I agree that optimization is the root of evil. This is just a small useful trick. Positive, if you're not sure about internals just make tests: function love.load() sqx1 = {} sqx2 = {} sqy1 = {} sqy2 = {} for i = 1, 1000000 do sqx1[i] = love.math.random() sqx2[i] = love.math.random() sqy1[i] =...
by arampl
Thu Mar 12, 2015 5:29 am
Forum: Support and Development
Topic: Asset(s) Located In Subfolders
Replies: 1
Views: 1822

Re: Asset(s) Located In Subfolders

Sure. For example:

sprite = love.graphics.newImage("sprites/sprite.png")
background = love.graphics.newImage("backgrounds/something.png")

It is not only a matter of better organizing. Imagine you have two files with the same name...
by arampl
Thu Mar 12, 2015 4:26 am
Forum: Support and Development
Topic: table.remove wont "Remove" table
Replies: 21
Views: 11618

Re: table.remove wont "Remove" table

May be not "lie", just "you are wrong"?
Positive07 wrote: ... compiles both cases to the same byte code ... the later could even be faster...
How? Isn't it a contradiction?

Without using math.sqrt program doesn't depend on any optimizations and becomes more readable.
by arampl
Wed Mar 11, 2015 8:17 pm
Forum: Support and Development
Topic: table.remove wont "Remove" table
Replies: 21
Views: 11618

Re: table.remove wont "Remove" table

Also take a note that

distance = ((player.x - enemy.x) ^ 2 + (enemy.y - player.y) ^ 2) ^ 0.5

is faster than

distance = math.sqrt((player.x - enemy.x) ^ 2 + (enemy.y - player.y) ^ 2)
by arampl
Mon Mar 09, 2015 3:07 pm
Forum: Libraries and Tools
Topic: Love Game Maker
Replies: 39
Views: 25005

Re: Love Game Maker

Worst thing about Game Maker - it is written in the Delphi, so it almost impossible for developers to port its IDE to other platform. I'll never fill comfortable to develop something on Windows. EDIT: Game Maker also uses its own scripting language - big mistake (Qt also did this mistake), it must b...
by arampl
Mon Mar 09, 2015 2:43 pm
Forum: General
Topic: [Beginner] I can't seem to grasp platformers
Replies: 21
Views: 8375

Re: [Beginner] I can't seem to grasp platformers

Please try. I love being proved wrong - it happens often. Not this time, for sure! Platformers is the next level of mastery (wonder when I reach this level) My fisrt game was exactly "shooter" (very simple game for ZX Spectrum, in the style of "Space Invaders"), then Tetris (of ...
by arampl
Sat Mar 07, 2015 10:27 am
Forum: Libraries and Tools
Topic: lua utils
Replies: 31
Views: 35578

Re: lua utils

looks cool. :) Thanks! you might as well convert the SVG files to a simpler format that Love2D could just render without doing any math Of course. All that you want to generate procedurally can be done in love.load() or before loading next level of your game. Even create pngs (even texture atlases)...
by arampl
Sat Mar 07, 2015 9:48 am
Forum: Libraries and Tools
Topic: lua utils
Replies: 31
Views: 35578

Re: lua utils

Check my post in the "What's everyone working on? (tigsource inspired)" section (page 110). May be you find this interesting. Self-intersecting beziers (it's only the beginning of full paths support). SVG import is planned. I'm thinking about full-scale vector editor and new lua+vector gra...