Search found 1173 matches
- 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...
- 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...
- 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?
My was the cheapest https://www.amazon.de/gp/product/B075SJ3NJ6 and works pretty well.
- 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...
- Fri Apr 28, 2023 2:51 pm
- Forum: Support and Development
- Topic: What's up with gamepad axes?
- Replies: 13
- Views: 2166
- 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?
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
- 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?
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
- 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...
- 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 -- ...
- 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 = ...