Search found 118 matches

by ninwa
Sun Nov 14, 2010 9:12 am
Forum: Games and Creations
Topic: Zombie Game
Replies: 36
Views: 4032

Re: Zombie Game

I got to a wave of about 150 before dying. I enjoyed it, even though it's very simple right now. I look forward to seeing more guns and different sorts of zombies added. Experimenting with map layouts would be fun, too.
by ninwa
Sat Nov 13, 2010 11:54 pm
Forum: Libraries and Tools
Topic: Primitive "Tiled" map loader and 2D game lighting
Replies: 26
Views: 12607

Re: Primitive "Tiled" map loader and 2D game lighting

Things are becoming very good ninwa. Was hard for you develop the XML Tiled reader?. "Tiled" webpage says that can be exported in Lua but I foundn't in Mac version that option. I didn't write an XML reader so much as a quick and dirty .tmx parser. It's limited in functionality, but it gets the job ...
by ninwa
Sat Nov 13, 2010 11:13 pm
Forum: Support and Development
Topic: Listing Save Files (Solved)
Replies: 18
Views: 3221

Re: Listing Save Files

Robin wrote:Or, even better, putting all save games in a dedicated subfolder. (You know, like "saves/".)
Don't be ridiculous.
by ninwa
Sat Nov 13, 2010 10:58 pm
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

You're almost there! :) Take a look at this: for i=1, #enemies do if not CheckCollision(player, enemies[i]) then -- the vector from enemy to the player local vx = player.x - enemies[i].x local vy = player.y - enemies[i].y -- normalize it, i.e. divide it by it's length local length = math.sqrt(vx * v...
by ninwa
Sat Nov 13, 2010 10:54 pm
Forum: Support and Development
Topic: Listing Save Files (Solved)
Replies: 18
Views: 3221

Re: Listing Save Files

I propose a simpler solution:

Code: Select all

local filesTable = love.filesystem.enumerate("")
for i,v in ipairs(filesTable) do
    if  v:find(".sav") ~= nil and love.filesystem.isFile(v) then
        table.insert(self.mainmenu, v)
   end
end
Assuming save-files have the extension '.sav'
by ninwa
Sat Nov 13, 2010 9:50 am
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

Sorry Ryne, I just caught this before going to bed myself, so I mostly skimmed your question, but if I understand you correctly: To access all of your enemies you need to do it iteratively. Iteration is a term often used in omputer programming and it means to go through an array (or in our case, tab...
by ninwa
Sat Nov 13, 2010 9:05 am
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

I'm not entirely sure why love.load exists. [...] the short answer is: It doesn't matter, but putting it in love.load makes it "prettier." As for the first part, love.load isn't called when the file is loaded, so there's a time difference, the most important thing is that the window is created just...
by ninwa
Sat Nov 13, 2010 8:58 am
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

Question 1: Here you have the "enemies" table outside of love.load. I thought that ALL tables had to be in love.load(). I guess that isn't the case, though I was just wondering if the table would still work, even if it were in love.load. I'm not entirely sure why love.load exists. It's probably an ...
by ninwa
Sat Nov 13, 2010 8:21 am
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

Specifically addressing: function spawnEnemy(x,y, hp) table.insert(enemies, x = 100, y = 100, hp = 100) end This should be: function spawnEnemy(x,y, hp) table.insert(enemies, {x = x, y = y, hp = hp}) end I didn't mean to be confusing, but the { and } within table.insert was meant to stay. Sorry, tha...
by ninwa
Sat Nov 13, 2010 8:14 am
Forum: Support and Development
Topic: Weapons / Multiple Enemies / ** Now Bullets **
Replies: 30
Views: 2159

Re: Weapons / Multiple Enemies.

Ryne: http://codepad.org/XM4QwNYP

Codepad fucked the formatting up a little bit, do your best to ignore that. :)