Search found 14 matches

by yoyohoho
Fri May 22, 2020 7:15 am
Forum: General
Topic: Removing a table from another table
Replies: 5
Views: 7763

Removing a table from another table

Hello out there :) I have a problem when I'm trying to remove a table from another table. objects = {} local lock = GameObject { x = number y = number texture = 'string' otherstuff = true table.insert(objects, lock) Now I want to remove this object again. However, when I try to remove with pair it s...
by yoyohoho
Tue Apr 28, 2020 9:37 am
Forum: General
Topic: Help with HUMP class system
Replies: 3
Views: 3341

Re: Help with HUMP class system

Uh, there seems to be some confusion of concepts here. Lua function declarations are syntactic sugar for assignments. When you do this: function takeDamage() self.health = self.health - 1 return self.health end what Lua is doing under the hood is: takeDamage = function () self.health = self.health ...
by yoyohoho
Tue Apr 28, 2020 8:03 am
Forum: General
Topic: Help with HUMP class system
Replies: 3
Views: 3341

Help with HUMP class system

Hey everyone :) I'm working on the foundation of a CS50 lecture, but there are a couple of things regarding the HUMP class system that I just don't understand, and I haven't been able to find answers on the forum nor anywhere else. I've created a three classes (Player.lua, Enemy.lua, Orb.lua) and I'...
by yoyohoho
Tue Apr 21, 2020 8:37 am
Forum: General
Topic: Shader outruns the player
Replies: 6
Views: 4125

Re: Shader outruns the player

Just a little question, when you say that people are going to request my .love file, deos that mean that I should include the entire folder with all my game files or just a distributed version of the game? It means something we can run and test, in order to be able to debug ourselves. The idea is t...
by yoyohoho
Tue Apr 21, 2020 8:20 am
Forum: General
Topic: Shader outruns the player
Replies: 6
Views: 4125

Re: Shader outruns the player

Yeah, it looks like a double transformation. main.lua is not there, by the way. The forum software is bugged when it comes to multiple attachments. It's not possible to be more specific without the code, sorry. That's good to know, thanks. I figured it out (look at my reply to the first post), I'm ...
by yoyohoho
Tue Apr 21, 2020 8:18 am
Forum: General
Topic: Shader outruns the player
Replies: 6
Views: 4125

Re: Shader outruns the player

Before people start requesting for your love file, I think the problem has a connection with the camera. Looking at your gif, the shader begins to have a problem the moment the camera begins scrolling with the player. Just a little question, when you say that people are going to request my .love fi...
by yoyohoho
Tue Apr 21, 2020 7:36 am
Forum: General
Topic: Shader outruns the player
Replies: 6
Views: 4125

Shader outruns the player

Hey guys! I'm playing around with shaders for the first time and though it's challenging it's a lot of fun. I'm creating a 2D platformer, where the setting is a cave so I thought it would be neat to have the lightning only just around the player. However, I'm having a problem where this eclipse of l...
by yoyohoho
Thu Apr 16, 2020 8:27 am
Forum: General
Topic: Problems with a simple loop
Replies: 12
Views: 8128

Re: Problems with a simple loop

Awesome! Thank you so much. Does that also mean that once execution finishes the render function it moves on to the update function where it finishes the if statement until gameOver is >= 80 or does it only increment gameOver once and then not again until execution goes through the code again the n...
by yoyohoho
Wed Apr 15, 2020 9:09 am
Forum: General
Topic: Problems with a simple loop
Replies: 12
Views: 8128

Re: Problems with a simple loop

In the code you provide self.dy is only set to TEXT_SPEED when the gameState is "dead", is it intended ? My thinking was that I might want TEXT_SPEED to be different (so I should declare it as a variable instead of a constant) depending on the gameState. So if I'm alive I want menu-stuff ...
by yoyohoho
Wed Apr 15, 2020 9:05 am
Forum: General
Topic: Problems with a simple loop
Replies: 12
Views: 8128

Re: Problems with a simple loop

zorg wrote: Wed Apr 15, 2020 4:39 am We're also assuming that the render and update functions are in fact named love.draw and love.update, or at least are called from those functions.
Thank you for the reply. :) That makes a lot of sense. I call the functions in my main.lua file.