Search found 1173 matches

by darkfrei
Sun Apr 30, 2023 6:00 pm
Forum: Support and Development
Topic: a couple questions about tables
Replies: 2
Views: 722

Re: a couple questions about tables

1. Define each map 2. Define allMaps as list: {map1, map2, map3, map3, map5} 3. Amount of maps is #allMaps 4. world = allMaps[mapSelect] Also do the iterations as for i = 1, 10 do; for i = 18, 4, -1 do; for i = 1, #list-1, 2 do; :x but never for i = 1, 2, 0.1 do, the float error makes bad things. Be...
by darkfrei
Sat Apr 29, 2023 6:45 am
Forum: Support and Development
Topic: How would i detect collison between a player and object using box2d
Replies: 2
Views: 631

Re: How would i detect collison between a player and object using box2d

Hello I am currently making a game for my class and I was wondering how I would detect Collison between a Player and object using box2d. I would also wondering how you could spawn the object that the player collided with in a random location on the tiled map through the lenses of a camera. Just fro...
by darkfrei
Fri Apr 28, 2023 3:09 pm
Forum: Support and Development
Topic: What's up with gamepad axes?
Replies: 13
Views: 2166

Re: What's up with gamepad axes?

Bobble68 wrote: Fri Apr 28, 2023 3:04 pm
darkfrei wrote: Fri Apr 28, 2023 3:00 pm Your square is software limited, but the circle has mechanical limitations, it looks like the stick cannot me moved to the end position.
How odd, it's a fairly decent controller.
My was the cheapest https://www.amazon.de/gp/product/B075SJ3NJ6 and works pretty well.
by darkfrei
Fri Apr 28, 2023 3:00 pm
Forum: Support and Development
Topic: What's up with gamepad axes?
Replies: 13
Views: 2166

Re: What's up with gamepad axes?

I have this picture with this file: https://github.com/darkfrei/love2d-lua-tests/blob/main/controller-input/controller-input-03.png https://github.com/darkfrei/love2d-lua-tests/blob/main/controller-input/controller-input-03.love Ooooh that's interesting, I get much the same as my first image with y...
by darkfrei
Fri Apr 28, 2023 2:51 pm
Forum: Support and Development
Topic: What's up with gamepad axes?
Replies: 13
Views: 2166

Re: What's up with gamepad axes?

I have this picture with this file:

Image


https://github.com/darkfrei/love2d-lua- ... ut-03.love
by darkfrei
Fri Apr 28, 2023 1:17 pm
Forum: Support and Development
Topic: How could I implement tilemap collisions for my platformer?
Replies: 5
Views: 740

Re: How could I implement tilemap collisions for my platformer?

MaxGamz wrote: Fri Apr 28, 2023 12:18 pm Does this method also work for STI implementation?
Yes, you can change it as you will, but I've never used STI and cannot help you with it.
But this method works here: viewtopic.php?p=246641#p246641
by darkfrei
Fri Apr 28, 2023 11:21 am
Forum: Support and Development
Topic: How could I implement tilemap collisions for my platformer?
Replies: 5
Views: 740

Re: How could I implement tilemap collisions for my platformer?

MaxGamz wrote: Fri Apr 28, 2023 11:15 am So the cValue is the name of the layer? Like the collidable layer? Sorry I'm just trying to understand but thanks for helping!
It's just the collision layer value, the collision can be just be the 1 as wall or floor:

Code: Select all

if grid[gy][gx] == 1 then
	return true -- collision
end
by darkfrei
Fri Apr 28, 2023 7:18 am
Forum: Support and Development
Topic: How could I implement tilemap collisions for my platformer?
Replies: 5
Views: 740

Re: How could I implement tilemap collisions for my platformer?

I found many tutorials relating to this topic but most of them had to deal with box2d and windfield. I heard I can implement this using a Grid but I am not familiar with this method at all. I don't plan to use box2d or windfield since I don't want realistic physics in my game, but I'm not sure what...
by darkfrei
Fri Apr 28, 2023 7:10 am
Forum: Libraries and Tools
Topic: Dithering with matrix
Replies: 8
Views: 6671

Re: Dithering with matrix

The gradient can be much smooth: function projectPointOnLineSegment(aX, aY, aZ, bX, bY, bZ, cX, cY, cZ) local dx, dy, dz = bX - aX, bY - aY, bZ - aZ local len2 = (dx*dx + dy*dy + dz*dz) if len2 == 0 then return 0 end local dot = (cX - aX)*dx + (cY - aY)*dy + (cZ - aZ)*dz local t = dot / len2^0.5 -- ...
by darkfrei
Fri Apr 28, 2023 6:50 am
Forum: Libraries and Tools
Topic: Dithering with matrix
Replies: 8
Views: 6671

Re: Dithering with matrix

The color dithering. 1. Find 2 nearest palette colors (point 1 and point 2) in 3D space to the current pixel color: function nearestColorIndex(r, g, b, palette) local firstIndex = 1 local secondIndex = 1 local min1 = math.huge local min2 = math.huge for index, color in ipairs(palette) do local dr = ...