Search found 107 matches

by NoreoAlles
Wed Apr 13, 2022 9:13 pm
Forum: Support and Development
Topic: How to better deal with Block based games
Replies: 8
Views: 2119

Re: How to better deal with Block based games

map = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}, {0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,}, {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,}, {1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,}, {1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,1,1,1,1,1,1,1,1,...
by NoreoAlles
Wed Apr 13, 2022 8:11 pm
Forum: Support and Development
Topic: AABB collision between player and multiple boxes
Replies: 5
Views: 2266

Re: AABB collision between player and multiple boxes

Hey, i want to make a game where you have blocks wich can be broken an build so the player has to move over them smothly... Your AABB is wrong, that's why it doesn't work. It will always return true. Below is a proper implementation of it, note how all 4 conditions need to be true in order for a co...
by NoreoAlles
Wed Apr 13, 2022 6:17 pm
Forum: Support and Development
Topic: AABB collision between player and multiple boxes
Replies: 5
Views: 2266

AABB collision between player and multiple boxes

Hey, i want to make a game where you have blocks wich can be broken an build so the player has to move over them smothly. I was asking about this issue yesterday, when i was told that the Box2d engine isnt the best for this task. So i then dove into AABB collision and got it working. So now, i have ...
by NoreoAlles
Tue Apr 12, 2022 8:12 pm
Forum: Support and Development
Topic: How to better deal with Block based games
Replies: 8
Views: 2119

Re: How to better deal with Block based games

What is the problem you're trying to solve? That's not clear to me so far. I'm also not sure what you mean by grounded/ungrounded, and I'm not familiar with the callbacks you're referring to. Are you using a library, or are you referring to functions you've written yourself? Either way, please prov...
by NoreoAlles
Tue Apr 12, 2022 7:47 pm
Forum: Support and Development
Topic: How to better deal with Block based games
Replies: 8
Views: 2119

How to better deal with Block based games

Hey, i have a game in wich i create a map with a forloop wich goes through a table like this one: blocks = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,1,1,1,1,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,0,0,1,1,1, 1,0,0,...
by NoreoAlles
Mon Mar 28, 2022 2:31 pm
Forum: Support and Development
Topic: Crash when using my function
Replies: 4
Views: 2397

Re: Crash when using my function

BrotSagtMist wrote: Mon Mar 28, 2022 1:29 pm Youre not actually using math.floor(v), thats about the only error i see.
It has to be v=math.floor(v).

Further a construction like local v = v is nonsense since having v in the function definition already makes it a local.
Thanks, that fixed it.
by NoreoAlles
Mon Mar 28, 2022 2:30 pm
Forum: Support and Development
Topic: Crash when using my function
Replies: 4
Views: 2397

Re: Crash when using my function

zorg wrote: Mon Mar 28, 2022 1:58 pm If it crashes, post the error and traceback you get; if it hangs, then you just learned why arithmetic with floating point numbers equaling a specific number might not ever work unless you keep your numbers whole.
It just hangs
by NoreoAlles
Mon Mar 28, 2022 1:05 pm
Forum: Support and Development
Topic: Crash when using my function
Replies: 4
Views: 2397

Crash when using my function

Hey, i want to be able to place blocks in my Platformer and wrote this function to have them all on the same grid. --v is the value, m is the value that v should be the multiple of and dir says if v should be subtracted by one or if one should be added to it function roundToMultiple(v, m, dir) local...
by NoreoAlles
Sun Mar 13, 2022 4:54 pm
Forum: Support and Development
Topic: OOP Map Question
Replies: 3
Views: 2242

Re: OOP Map Question

nehu wrote: Sun Mar 13, 2022 3:28 pm ...
hope it helped ! :crazy:
Yes it did, thanks you so much. :P
by NoreoAlles
Sun Mar 13, 2022 11:58 am
Forum: Support and Development
Topic: OOP Map Question
Replies: 3
Views: 2242

OOP Map Question

I have a project in wich i have a Block class Block = {} Block.__index = Block function Block.new(x, y, r, g, b ) local instance = setmetatable({}, Block) instance.x = x instance.y = y instance.width = 50 instance.height = 50 instance.r = r instance.g = g instance.b = b instance.body = love.physics....