Search found 721 matches

by Plu
Tue Oct 21, 2014 5:51 am
Forum: Support and Development
Topic: "loop in gettable" when I add 100 objects to an array
Replies: 4
Views: 5514

Re: "loop in gettable" when I add 100 objects to an array

Unfortunately I can't get the game to run due to no joysticks, but I spotted one thing that looks supsicious in your load function: bullet = bullet:new(100, -200, 0, 300); table.insert(bullets, bullet) You're making a variable that has the same name as your library here, and then you're setting a re...
by Plu
Sun Oct 19, 2014 8:24 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411426

Re: "Questions that don't deserve their own thread" thread

Usually entities are stored in a table, so to get rid of it you find its key in that table and then set that value to NIL.

Of course, the harder part is to make sure that any other references to it are also dropped, but that depends a bit on how your game is designed, I think.
by Plu
Fri Oct 17, 2014 8:58 am
Forum: General
Topic: Gameplay interspersed between animated cutscenes [Design]
Replies: 6
Views: 4071

Re: Gameplay interspersed between animated cutscenes [Design

Honestly it sounds like the worst combination of a game and a story you can have; people who love stories won't be able to complete unless they're good enough gamers and people who like good games will constantly be forced to wait through long story parts, when they're just looking for some play. Yo...
by Plu
Thu Oct 16, 2014 7:41 am
Forum: General
Topic: Where could I have someone read through my code?
Replies: 9
Views: 5067

Re: Where could I have someone read through my code?

For larger projects, dropping it here is probably a good idea :)
by Plu
Wed Oct 01, 2014 3:02 pm
Forum: General
Topic: Give me a simple challenge
Replies: 8
Views: 4074

Re: Give me a simple challenge

Using the Löve2D wiki is nothing to be ashamed of, I'm pretty sure that (correct me if I'm wrong) it's safe to say that everyone uses the wiki because if it didn't exist when I wouldn't have gotten into programming at all. I do programming for a living, and StackOverflow and the documentation for t...
by Plu
Mon Sep 29, 2014 8:21 am
Forum: Support and Development
Topic: Making a "hitbox" follow the player?
Replies: 10
Views: 8738

Re: Making a "hitbox" follow the player?

Yeah, there are two basic ways. The simple one is to turn the hitbox into a sensor: http://leafo.net/love/wiki/fixture_setsensor1.html This will make the hitbox not resolve collisions but it will still trigger callbacks (ie; you can detect when it hits and stops hitting something, but it won't push ...
by Plu
Mon Sep 22, 2014 9:57 am
Forum: Support and Development
Topic: Separation of draw-loop and update-loop threads. Possible?
Replies: 6
Views: 3270

Re: Separation of draw-loop and update-loop threads. Possibl

This sounds to me like it's in the category of "If you have to ask, you don't understand well enough to make it work".

It's going to be a huge undertaking for probably no gain and loads of really weird bugs.
by Plu
Mon Sep 22, 2014 9:55 am
Forum: Support and Development
Topic: Using the love api in other classes/tables other than main.
Replies: 3
Views: 3007

Re: Using the love api in other classes/tables other than ma

love should be a global that's everywhere, unless your other file is either outside of love (ie; you're calling it through your own Lua interpreter) or if it's running inside a thread or channel, which by default don't load any love modules. But yeah; include a .love and we'll be able to say more. (...
by Plu
Mon Sep 15, 2014 7:32 am
Forum: Support and Development
Topic: [SOLVED]Remove an object from a table.
Replies: 11
Views: 12220

Re: Remove an object from a table.

Add this in your creation function, after you make the fixture. coin.fixture.setUserData( coin ) It will store a reference to the coin inside the fixture. Now, when you resolve the collision, you should be able to get to the fixture, and then you can recover the coin by doing this: fixture.getUserDa...
by Plu
Fri Sep 12, 2014 8:24 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411426

Re: "Questions that don't deserve their own thread" thread

Try this:

Code: Select all

require "../game/tilemap"
That should work.

(Sidenote: your main.lua should be in the main folder, this setup isn't going to work when you try to distribute the game)
(Unless they're two different projects)